
function messageWindow(title, msg)
{
  var width="300", height="125";
  var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
  var msgWindow = window.open("","msgWindow", styleStr);
  var head = '<head><title>'+title+'</title></head>';
  var body = '<center>'+msg+'<br><p><form><input type="button" value="   Done   " onClick="self.close()"></form>';
  msgWindow.document.write(head + body);
}


var popUpWin=0;
function popUpWindow(URLStr,width, height)
{
var left = (screen.width/2) - width/2;
  var top = (screen.height/2) - height/2;
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos)
{
	if(win)
	 {
	   if(!win.closed)
	           win.close();
	 }
if(pos=="full")
       {
		   w = screen.width;
		   h = screen.height;
		   LeftPosition=1;
		   TopPosition=1;
	   }

if(pos=="random")
       {
		     LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
			 TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	   }
	   
if(pos=="center")
       {
		      LeftPosition=(screen.width)?(screen.width-w)/2:100;
			  TopPosition=(screen.height)?(screen.height-h)/2:100;
	   }
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}