function smallPopup(fileName,otherParams,height,width)
{
 	var aw = screen.availWidth;
    var ah = screen.availHeight;
    var h = height;
    var w = width;
    
    if (h==null)
    	h = 450;
    	
    if (w==null)
    	w = 400;

	var xOffset = (aw /2)-375;
	var yOffset = (ah /2)-275;
	
	fileName += "?sessionid=" + SessionId() + CollectionLine();
		
	if(otherParams != null && otherParams != "")
	{
		if (otherParams.charAt(0) != "&")
			fileName += "&";
			
		fileName += otherParams;
		fileName += "&";
	}
    var win = window.open(fileName,'','width='+w+',height='+h+',modal,scrollbars,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
    win.focus(); 
		
	return false;
}

function openPopup(fileName,otherParams,showSession,showLocation,showStatus,showToolbar)
{
	showSession = (showSession!=false);
	showLocation = (showLocation==true);
	showStatus = (showStatus==true);
	showToolbar = (showToolbar==true);

 	var aw = screen.availWidth;
    var ah = screen.availHeight;
		
	var xOffset = (aw /2)-375;
	var yOffset = (ah /2)-275;
	
	if (showSession)
		fileName += "?sessionid=" + SessionId();
	
	// Always include collection.
	fileName += CollectionLine();
		
	if(otherParams != null && otherParams != "")
	{
		if (otherParams.charAt(0) != "&")
			fileName += "&";
			
		fileName += otherParams;
		fileName += "&";
	}
	
    var win = window.open(fileName,'','width=750,height=500,modal' + (showToolbar?',toolbar':'') + ',scrollbars' + (showLocation?',location':'') + (showStatus?',status':'') + ',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
    win.focus(); 
		
	return false;
}

function openPopupMenu(fileName,otherParams)
{
 	var aw = screen.availWidth;
    var ah = screen.availHeight;
		
	var xOffset = (aw /2)-375;
	var yOffset = (ah /2)-275;
		
	fileName += "?sessionid=" + SessionId() + CollectionLine();

	if(otherParams != null && otherParams != "")
		fileName += otherParams;

    var win = window.open(fileName,'','width=750,height=500,modal,scrollbars,menubar,resizeable,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
    win.focus(); 
		
	return false;
}

function smallPopupModal(fileName,otherParams)
{
	ShowModalDialog(fileName, 400, 450, otherParams);		
	return false;
}

function openPopupModal(fileName, otherParams)
{
	ShowModalDialog(fileName, 750, 500, otherParams);
	return false;
}

function reportPopup(otherParams)
{
  	var aw = screen.availWidth;
    var ah = screen.availHeight;
		
	var xOffset = (aw /2)-475;
	var yOffset = (ah /2)-275;
		
	var fileName = "/report_win/?sessionid=" + SessionId() + CollectionLine() + "&" + otherParams;
	javacode = "<script language='JavaScript' type='text/javascript'>  window.location='";
	javacode += fileName;
	javacode += "'; </script> ";

	html = "<html><head></head>";
	html += "<body style='background-color: rgb(102, 102, 102); color: rgb(0, 0, 0);'alink='#ee0000' link='#0000ee' vlink='#551a8b'><br>";
	html += "<div style='text-align: center; color: rgb(255, 255, 255); background-color: rgb(102, 102, 102);'>";
	html += "<span style='font-weight: bold;'>Your report is being generated.</span>";
	html += "<br><br>";
	html += "Data Station Resources Check.";
	html += "<br><br>";
	html += "<span style='font-weight: bold;'>Please be patient.</span>";
	html += "</div>";
	html += "</body>";
	html += javacode;
	html += "</html>";
	
    var win = window.open('','','width=750,height=500,modal,scrollbars,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
    win.document.write(html);
    win.document.close();
    win.focus();
		
	return false;
}

function GetAConfirmation(promptText,button1,button2,button1conf,button2conf)
{
	var aw = screen.availWidth;
    var ah = screen.availHeight;
		
	xOffset = (aw /2)-275;
	yOffset = (ah /2)-100;
	
	var fileName = "/get_a_confirmation/?sessionid=" + SessionId() + CollectionLine() + "&prompt=" + promptText + "&button1=" + button1 + "&button1conf=" + button1conf + "&button2=" + button2 + "&button2conf=" + button2conf;
	var win = window.open(fileName,'','width=450,height=250,modal,scrollbars,screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
    win.focus();
}