// JavaScript Document
function openPopupWindow(url, name, width, height, returnWindow)
{
	var horizontalOffset, verticalOffset, offsetAmount, windowToReturn, closethiswindow;
		
	offsetAmount = 0;
	
	if(width == -1)
	{
	
  	if ((screen.Height >= 0) && (screen.Width >= 0)) {
     		 width = screen.Width - 10;
 	 }
  	else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) {
      		 width = screen.availWidth - 10;
  	}
	}	
	
	if(height == -1)
	{
	if ((screen.Height >= 0) && (screen.Width >= 0)) {
     		 height = screen.Height - 75;
    }
  	else if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) {
      		 height = screen.availHeight - 45;
    }
	}
	
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		horizontalOffset = window.screenLeft + offsetAmount;
		verticalOffset = window.screenTop + offsetAmount;
	}
	else
	{
		horizontalOffset = window.screenX + offsetAmount;
		verticalOffset = window.screenY + offsetAmount;
	}
	
	if(horizontalOffset + width > screen.availWidth || verticalOffset + height > screen.availHeight)
	{
		horizontalOffset = 0;
		verticalOffset = 0;
	}
		
	windowToReturn = window.open(url, name, "toolbar=0,location=0,directories=0,status=yes,menubar=no,scrollbars=1,resizable=yes,screenX=" + horizontalOffset + ",screenY=" + verticalOffset + ",left=" + horizontalOffset + ",top=" + verticalOffset + ",width=" + width + ",height=" + height);
	//Please do not publish with the return window statement
	//if(returnWindow)
	//{
	//	return(windowToReturn);
	//}
}

function centerPopUp( url, name, width, height, scrollbars ) { 
 
	if( scrollbars == null ) scrollbars = "0" 
 
	str  = ""; 
	str += "width=" + width + ","; 
	str += "height=" + height + ","; 
	str += "location=0,"; 
 	str += "resizable=1,"; 
	str += "scrollbars=" + scrollbars + ","; 
	// 20060525DC - added location to string to remove the URL from the title bar at top.
 	//str += "menubar=0,"; 
 	str += "toolbar=0,";
 	
	if ( window.screen ) { 
		var ah = screen.availHeight - 30; 
		var aw = screen.availWidth - 10; 
 
		var xc = ( aw - width ) / 2; 
		var yc = ( ah - height ) / 2; 
 
		str += ",left=" + xc + ",screenX=" + xc; 
		str += ",top=" + yc + ",screenY=" + yc; 
	} 
	window.open( url, name, str ); 
} 

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	
  if (selObj.options[selObj.selectedIndex].value != "0") {

	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
  }
}