    var browser = "unknown"
    var version = 0
    var detected = false
    var ua = window.navigator.userAgent
    if(ua.substring(0,7) == "Mozilla") {
         if(ua.indexOf("MSIE") > 0) {browser = "IE"}
         else {browser = "NS"}
    }
    if (ua.indexOf("5.") > 0) {version = 5}
    else if(ua.indexOf("4.") > 0){version = 4}
    else if(ua.indexOf("3.") > 0){version = 3}

	var defaultInfo = "";
	
	function writeInfo(txt) {
		txt = "<font class=HelpHeader>Info:</font><BR><font class=HelpText>" + txt;
		if (browser=="IE") {
			document.all['infodesc'].innerHTML = txt +"</font>";
			//document.all['infodesc'].style.background = "white";
		}
		else {
			document.layers['infodesc'].document.open();
			document.layers['infodesc'].document.write(txt +"</font>");
			document.layers['infodesc'].document.close();
		}
	}
	
	function clearInfo() {
		if (browser=="IE") {
			document.all['infodesc'].innerHTML = defaultInfo;
			//document.all['infodesc'].style.background = "white";
		}
		else {
			document.layers['infodesc'].document.open();
			document.layers['infodesc'].document.write(defaultInfo);
			document.layers['infodesc'].document.close();
		}
	}
	
	if (browser=="IE") {
		//document.all['infodesc'].style.top = 260;
		//document.all['infodesc'].style.left = 450;
	}
	
	var frmElem;
	function OpenWiz(nm, rtn, pg) {
		switch (nm) {
			case "ProviderWiz":
				frmElem = rtn;
				window.open(pg, "wiz", "width=400,height=300,top=10,left=10,resizable=no,scrollbars=yes");
				break;
			case "AddComments":
				frmElem = rtn;
				window.open(pg, "addcomments", "width=520,height=490,top=10,left=10,resizable=yes,scrollbars=yes");
				break;
			case "GeoWiz":
				frmElem = rtn;
				window.open(pg, "wiz", "width=450,height=200,top=10,left=10,resizable=no,scrollbars=yes");
				break;
			case "SpaceFinder":
				frmElem = rtn;
				window.open(pg, "wiz", "width=750,height=430,top=10,left=10,resizable=no,scrollbars=no");
				break;
			case "CCWiz":
				frmElem = rtn;
				window.open(pg, "wiz", "width=355,height=230,top=10,left=10,resizable=no,scrollbars=yes");
				break;
			case "DatePicker":
				frmElem = rtn;
				window.open(pg, "wiz", "width=355,height=230,top=10,left=10,resizable=no,scrollbars=yes");
				break;
			case "WOdetail":
				frmElem = rtn;
				window.open(pg, "wodetail", "width=500,height=450,top=10,left=10,resizable=yes,scrollbars=yes,status=yes");
				break;
			case "LabMat":
				frmElem = rtn;
				window.open(pg, "labmat", "width=800,height=580,top=10,left=10,resizable=yes,scrollbars=yes,status=yes");
				break;
			case "WOform":
				frmElem = rtn;
				window.open(pg, "woform", "width=700,height=490,top=10,left=10,resizable=no,scrollbars=yes");
				break;
		}
	}
	
	function replace(string,text,by) {
		var strLength = string.length, txtLength = text.length;
		if ((strLength == 0) || (txtLength == 0)) return string;
		var i = string.indexOf(text);
		if ((!i) && (text != string.substring(0,txtLength))) return string;
		if (i == -1) return string;
	    var newstr = string.substring(0,i) + by;
		if (i+txtLength < strLength)
			newstr += replace(string.substring(i+txtLength,strLength),text,by);
	    return newstr;
	}
	
	function printPage() {
		if (version > 4) {window.print();}
		else {alert("If you are using MS Internet Explorer 4, you must select 'Print' from the the 'File' menu.");}
	}
	
	function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas) { 
        if (isNaN(parseInt(num))) return "0";
	
		var tmpNum = num;
		var iSign = num < 0 ? -1 : 1;		// Get sign of number
		
		// Adjust number so only the specified number of numbers after
		// the decimal point are shown.
		tmpNum *= Math.pow(10,decimalNum);
		tmpNum = Math.round(Math.abs(tmpNum))
		tmpNum /= Math.pow(10,decimalNum);
		tmpNum *= iSign;					// Readjust for sign
		
		
		// Create a string object to do our formatting on
		var tmpNumStr = new String(tmpNum);
	
		// See if we need to strip out the leading zero or not.
		if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
			if (num > 0)
				tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
			else
				tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
			
		// See if we need to put in the commas
		if (bolCommas && (num >= 1000 || num <= -1000)) {
			var iStart = tmpNumStr.indexOf(".");
			if (iStart < 0)
				iStart = tmpNumStr.length;
	
			iStart -= 3;
			while (iStart >= 1) {
				tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
				iStart -= 3;
			}		
		}
	
		// See if we need to use parenthesis
		if (bolParens && num < 0)
			tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";
	
		return tmpNumStr;		// Return our formatted string!
	}