/* *********************************************************
	OpenHelpWin.js - Global include used to open a 
	new window sized to 50% of the parent window.  This
	routine also determines browser version.
	
	## to invoke this function add the following code ##
	## to your anchor tag instead of the http:	  ##					##
	##	onClick="openHelpWin('url.asp');"	  ##
	## (where the 'url.asp' is the url address)       ##
 ********************************************************* */

/* *********************************************************
	Common Routines
 ********************************************************* */
/* **********************************************************
	openHelpWin
	Open a new help window using URL passed to it
 ********************************************************** */
/*
function openHelpWin(sURLh){
	var objScreenSize = getScrSize();
	var sWdth = objScreenSize.Wdth * .5;
	var sHght = objScreenSize.Hght * .5;

	sURLh = window.open(sURLh, "HELP",
			"width=" + sWdth + ",height=" + sHght + ",menubar=no,toolbar=no,resizable=yes,location=no,scrollbars,status");

	return sURLh;
}
*/
function openHelpWin(sURLh,p_Width,p_Height, bDoReturn){
	var objScreenSize = getScrSize();
	var sWdth = objScreenSize.Wdth * .5;
	var sHght = objScreenSize.Hght * .5;
	if (openHelpWin.arguments.length > 1){
		if(p_Width == -1){
			sWdth = objScreenSize.Wdth - 10;
		}
		else{
			sWdth = p_Width;
		}
	}
	if (openHelpWin.arguments.length > 2){
		if(p_Height == -1) {
			sHght = objScreenSize.Hght - 75;
		}
		else{
			sHght = p_Height;
		}
	}
	sURLh = window.open(sURLh, "HELP",
			"width=" + sWdth + ",height=" + sHght + ",menubar=no,toolbar=no,resizable=yes,location=no,scrollbars,status");

	if(sURLh) sURLh.focus();
	if(bDoReturn) return sURLh;
}



/* *********************************************************
	A simple "sniffer" that determines browser version and vendor.
	It returns a browser object. 	   	s*d*t	e*l*t
 ********************************************************* */
function getBrowser() {
	// Create the browser object.
	var browser = new Object();

	// Figure out the browser major version.
	browser.ver = parseInt(navigator.appVersion);

	// Now figure out if the browser is from one of the two
	// major browser vendors. Start by assuming it is not.
	browser.isNav = false;
	browser.isIE = false;
	browser.id = "unknown";

	if (navigator.appName.indexOf("Netscape") != -1) {
    	browser.isNav = true;
		browser.id = "NS";
	}

	if (navigator.appName.indexOf("Microsoft") != -1) {
   		browser.isIE = true;
		browser.id = "IE";
	}

	return browser;
}

/* *********************************************************
	getScreenSize
	Set size of screen and return width and height as object
 ********************************************************* */
function getScrSize() {
	var ScreenWdth = null;
	var ScreenHght = null;
	var objBrowser = getBrowser();

	if (objBrowser.isIE && objBrowser.ver >= 4) {
		ScreenWdth = window.screen.width;
		ScreenHght = window.screen.height;
	}

	if (objBrowser.isNav) {
		if (navigator.javaEnabled()) {
			var toolkit = java.awt.Toolkit.getDefaultToolkit();
			var scrSize = toolkit.getScreenSize();
			ScreenWdth = scrSize.width;
			ScreenHght = scrSize.height;
		}
	}

	if (ScreenWdth == null) {
		ScreenWdth = 641;
	}
	if (ScreenHght == null) {
		ScreenHght = 481;
	}
	this.Wdth = ScreenWdth;
	this.Hght = ScreenHght;
	//the following line of code causes problems if no forms are defined on the
	//parent page so be warned and aware
	if (typeof(document.forms[0].screenresw) == "object"){
        document.forms[0].screenresw.value = this.Wdth;
	document.forms[0].screenresh.value = this.Hght;};

	return this;
}