// Popup Window Version 1.0.2
// Written by Speedwell.
// Last Edited: 02/09/2003

// To reference the include file
// Place the following into the <head></head> section of the page
// <script language="Javascript" src="/common/popup.js"></script>

// Explanation of variables
// --  thisURL  : The page to open in a new window.
// --  winName  : The window name.
// --  wd       : The width of the new popup window.
// --  ht       : The height of the new popup window.
// --  scrlbars : Do you want the popup window to have scrollbars?
// --  resizing : Do you want to allow the user to resize the popup window?

// To call the function
// javascript:Popup('filename.htm','WindowPopup',600,300,'no','no');
var NewPopupWindow = null;

function Popup(thisURL,winName,wd,ht,scrlbars,resizing){   
  NewPopupWindow = null;
  NewPopupWindow = window.open(thisURL,winName,"toolbar=no,width=" + wd + ",height=" + ht + ",location=no,directories=no,status=yes,menubar=no,scrollbars=" + scrlbars + ",resizable=" + resizing);   
  // Don't Do the Focus in IE 3
  if (NewPopupWindow != null)
  {
	if (!((navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.substring(0, 3) < "3")))
	{
		NewPopupWindow.focus();
	}
  }
  
}
function NewPopup(thisURL,winName,wd,ht,scrlbars,resizing, winObj){   
  var NewWindow;
  if (winObj != null)
  {
    if (!winObj.closed)
    {
      winObj.focus();
      return winObj;
    }
  }
  NewPopupWindow = window.open(thisURL,winName,"toolbar=no,width=" + wd + ",height=" + ht + ",location=no,directories=no,status=yes,menubar=no,scrollbars=" + scrlbars + ",resizable=" + resizing);   
  // Don't Do the Focus in IE 3
  if (NewPopupWindow != null)
  {
	if (!((navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.substring(0, 3) < "3")))
	{
		NewPopupWindow.focus();
	}
  }
  return NewPopupWindow;  
}
function PopupModal(thisURL,wd,ht,scrlbars,resizing)
{		
   var sFeatures = "'dialogHeight:" + ht +"px;dialogWidth:" + wd + "px;status:No;edge:Raised;center:Yes;help:No;scroll:" + scrlbars + ";resizable:" + resizing + "'"; 
   NewWindow = window.showModalDialog(thisURL,'',sFeatures);		
}


// --------------------------------
// This function determines what your screen resolution is and then creates a popup window of that particular size.

// To call the function
// javascript:MaxPopup('filename.htm','WindowPopup');

function MaxPopup(thisURL,winName) {
	maxWindow = "height=" + (screen.availHeight-25) + ",width=" + (screen.availWidth-10) + ",top=0,left=0";
	window.open(thisURL,winName,maxWindow);
}


// --------------------------------
// This function creates a popup in the center of the screen.

// To call the function
// javascript:MidPopup('filename.htm','WindowPopup',600,300,'no','no');

function MidPopup(thisURL2,winName2,wd2,ht2,scrlbars2,resizing2) {
	NewWin2 = window.open(thisURL2,winName2,"toolbar=no,width=" + wd2 + ",height=" + ht2 + ",location=no,directories=no,status=yes,menubar=no,scrollbars=" + scrlbars2 + ",resizable=" + resizing2 + ",top=" + ((screen.availHeight/2)-(ht2/2)) + ",left=" + ((screen.availWidth/2)-(wd2/2)));
}

function MidPopup2(thisURL2,winName2,wd2,ht2,scrlbars2,resizing2) 
{
  var xpos = (screen.availWidth / 2) - (wd2 / 2); 
  var ypos = (screen.availHeight / 2) - (ht2 / 2);
  xpos = (xpos > 0) ? xpos : 0;
  ypos = (ypos > 0) ? ypos : 0;
  NewWin2 = window.open(thisURL2,'',"toolbar=no,width=" + wd2 + ",height=" + ht2 + ",location=no,directories=no,status=yes,menubar=no,scrollbars=" + scrlbars2 + ",resizable=" + resizing2 + ",top=" + ypos + ",left=" + xpos); 
}

