/******************************************************************************
* showpage.js                                                                *
*                                                                             *
* This is only to fix problems that appear to be inherent with passing too    *
* many arguments in an on-event handler...                                    *
*                                                                             *
* Copyright 2001 by Chris Davis / Precision Interconnect                      *
* Last update: February 14, 2001                                              *
******************************************************************************/

function showpage (pageURL, width, height)
{
	var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
		parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
	var isMinIE4 = (document.all) ? 1 : 0;
	var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;

	// Calculate window offsets
	leftoffset=(screen.width-width)/2;
	topoffset=(screen.height-height)/2;
	if (leftoffset<0)
		leftoffset = 0;
	if (topoffset<0)
		topoffset = 0;
	
	varWindowOptions = new String();
	
	// Accounting for fact that Netscape can specify X and Y coordinates when a new window opens.
	if (isMinNS4){
		// Netscape is nice enough to give us ability to position a new window when calling window.open...
		WindowOptions = "height=" + height + ",width=" + width + ",screenX=" + leftoffset + ",screenY=" + topoffset + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		newwin=window.open(pageURL,'moreinfo',WindowOptions);
		newwin.document.bgColor="FFFFFF";
		newwin.focus();
	}else if (isMinIE4) {
		WindowOptions = 'height=' + String(height) + ',width=' + String(width) + ',left=' + String(leftoffset) + ',top=' + String(topoffset) + ',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes';
		newwin=window.open(pageURL,'moreinfo',WindowOptions);
		newwin.focus();
		//newwin.document.bgColor="FFFFFF";
		// Account for browser border size and resize, in case window instance was open already.
	}else {
		// If browser isn't identified as IE4+ or NS4+, then windows is opened at default location
		WindowOptions = "height=" + height + ",width=" + width + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		window.open(pageURL,'_blank',WindowOptions);
	}
}


function showpageright (pageURL, width, height)
{
	var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
		parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
	var isMinIE4 = (document.all) ? 1 : 0;
	var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;

	// Calculate window offsets
	leftoffset=screen.width-width-32;
	topoffset=(screen.height-height)/2;
	if (leftoffset<0)
		leftoffset = 0;
	if (topoffset<0)
		topoffset = 0;
	
	// Accounting for fact that Netscape can specify X and Y coordinates when a new window opens.
	// IE 4.x and 5.x do not...
	if (isMinNS4){
		// Netscape is nice enough to give us ability to position a new window when calling window.open...
		WindowOptions = "height=" + height + ",width=" + width + ",screenX=" + leftoffset + ",screenY=" + topoffset + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		newwin=window.open(pageURL,'moreinfo',WindowOptions);
		newwin.document.bgColor="FFFFFF";
		newwin.focus();
	}else if (isMinIE4) {
		// Internet Explorer is not.
//		WindowOptions = "height=" + height + ",width=" + width + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		WindowOptions = 'height=' + String(height) + ',width=' + String(width) + ',left=' + String(leftoffset) + ',top=' + String(topoffset) + ',status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes';
		newwin=window.open(pageURL,'moreinfo',WindowOptions);
		newwin.focus();
		newwin.moveTo(leftoffset, topoffset);
		newwin.document.bgColor="FFFFFF";
		// Account for browser border size and resize, in case window instance was open already.
		newwin.resizeTo(width,height);
	}else {
		// If browser isn't identified as IE4+ or NS4+, then windows is opened at default location
		WindowOptions = "height=" + height + ",width=" + width + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		window.open(pageURL,'_blank',WindowOptions);
	}
}

// Opens a new window but doesn't change the background color to white
function showpageorigbackground (pageURL, width, height)
{
	var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
		parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
	var isMinIE4 = (document.all) ? 1 : 0;
	var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;

	// Calculate window offsets
	leftoffset=(screen.width-width)/2;
	topoffset=(screen.height-height)/2;
	if (leftoffset<0)
		leftoffset = 0;
	if (topoffset<0)
		topoffset = 0;
	
	// Accounting for fact that Netscape can specify X and Y coordinates when a new window opens.
	// IE 4.x and 5.x do not...
	if (isMinNS4){
		// Netscape is nice enough to give us ability to position a new window when calling window.open...
		WindowOptions = "height=" + height + ",width=" + width + ",screenX=" + leftoffset + ",screenY=" + topoffset + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		newwin=window.open(pageURL,'moreinfo',WindowOptions);
		newwin.focus();
	}else if (isMinIE4) {
		// Internet Explorer is not.
		WindowOptions = "height=" + height + ",width=" + width + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		newwin=window.open(pageURL,'moreinfo',WindowOptions);
		newwin.focus();
		newwin.moveTo(leftoffset, topoffset);
		// Account for browser border size and resize, in case window instance was open already.
		newwin.resizeTo(width,height);
	}else {
		// If browser isn't identified as IE4+ or NS4+, then windows is opened at default location
		WindowOptions = "height=" + height + ",width=" + width + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes";
		window.open(pageURL,'_blank',WindowOptions);
	}
}
