/* Universal Javascript Functions File */




function showDialog(dlgUrl, dlgTitle, dlgParams, nonModal)
{

	
	if (is_mozilla||nonModal)
	{
		dlgParams = replace(dlgParams,"dialog","");
		dlgParams = replace(dlgParams,":","=");
		if (is_mozilla)
			dlgParams = replace(dlgParams,"px;",";");
		var nonModalDlg = window.open(dlgUrl, dlgTitle, dlgParams);
	}
	else
		if (is_ie)
			return window.showModalDialog(dlgUrl, dlgTitle, dlgParams);
	
}

function InitDropDown(obj, vIdx) 
{	

	if (obj != null && obj != undefined)
		{	
			for (i=0; i < obj.options.length; i++) 
			{
				if (obj.options[i].value == vIdx) 
				{
					obj.options[i].selected = true;
				}
			}
		}
}	



  
function TrimVariable(_sVar)
{
	if (_sVar.length > 0) 
	{
		while(''+_sVar.charAt(_sVar.length-1) == ' ')
			_sVar = _sVar.substring(0,_sVar.length-1);
		while(''+_sVar.charAt(0) == ' ')
			_sVar = _sVar.substring(1,_sVar.length);
	}
	return _sVar;
}

function WriteInnerHTML(objName, innerText)
{
	if (is_mozilla)
	{
		objName += "Mozilla";
		if (document.getElementById(objName) != undefined)
		{
			document.getElementById(objName).innerHTML = innerText;
		} 
	}
	else if (is_ie)
	{
		if (document.getElementById(objName) != undefined)
		{
			document.getElementById(objName).innerHTML = innerText;	
		} 
	}
	else if (is_nav) 
	{

	}
	
}

function Show(showobj) {

	if (is_mozilla||is_ie)
	{

		if (document.getElementById(showobj) != undefined)
		{

			document.getElementById(showobj).style.visibility = "visible";
			document.getElementById(showobj).style.position= "relative";
		}

		return true;
	}
	
	if (is_nav) 
	{
	
		{
			//if(ver >= 6.0) {
				//document.getElementById(showobj).style.visibility = 'visible';}
			//if ((ver >= 4.0) || (ver <= 5.0)) {
			document.layers[showobj].visibility = 'show';
			document.layers[showobj].position= "relative";
		}
		return true;
	}
	

}

function Hide(hideobj) {

	if (is_mozilla||is_ie) 
	{
		if (document.getElementById(hideobj) != undefined)
		{
			document.getElementById(hideobj).style.visibility = "hidden";
			document.getElementById(hideobj).style.position= "absolute";
		}
		return true;
	}
	
	if (is_nav) 
	{
		{
			//if(ver >= 6.0) {
				//document.getElementById(showobj).style.visibility = 'hidden';}
			//if ((ver >= 4.0) || (ver <= 5.0)) {
				document.layers[showobj].visibility = 'hide';
				document.layers[showobj].position= "relative";
		}
		return true;
	}
}


function numeric(nStr)
{
	var newStr = "";
	
	if ((nStr==null)||(nStr==undefined))
		nStr = "0";

	// strip out symbols and non-numeric chars
	for (var i=0; i<nStr.length; i++)
	{
		if (!isNaN(nStr.substr(i,1))||(nStr.substr(i,1)==".")||(nStr.substr(i,1)=="-"))
		{
			newStr = newStr + nStr.substr(i,1);
		}	
	}
	
	if (isNaN(parseFloat(newStr)))
		newStr = "0";
	
	return parseFloat(newStr)

}


function formatCurrency(n)
{
	n = (n * 100);
    n = Math.round(n);
    n = (n / 100);
	var nStr = n.toString();
	return "$" + n.toString();
}

function formatDecimal(objName) {

	var obj = eval("document.forms[0].elements['" + objName + "']");
	var num = obj.value;
	num = numeric(num.toString());
	
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
	
	obj.value = (((sign)?'':'') + '' + num + '.' + cents);
	return true
}

function formatInteger(objName) {

	var obj = eval("document.forms[0].elements['" + objName + "']");
	var num = obj.value;
	num = numeric(num.toString());
	
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
	
	obj.value = (((sign)?'':'') + '' + num);
	return true
}


function AlphaValidate()
{
	keycode = document.all ? event.keyCode : e.which;
	if ((keycode >= 33 && keycode <= 47) || (keycode >= 65 && keycode <= 90) || 
	    (keycode >= 97 && keycode <= 122)|| (keycode >= 129 && keycode <= 144)|| 
	    (keycode ==  8) || (keycode == 13) || 
	    (keycode == 18) || (keycode == 37) || 
	    (keycode == 39) || (keycode == 46) )
		{return true;}
	else
		{return false;}
}
function AlphaNumericValidate()
{
	keycode = document.all ? event.keyCode : e.which;
	if ((keycode >= 33 && keycode <= 57) || (keycode >= 65 && keycode <= 90) || 
	    (keycode >= 97 && keycode <= 122)|| (keycode >= 129 && keycode <= 144)|| 
	    (keycode ==  8) || (keycode ==  9) ||
	    (keycode == 13) || 
	    (keycode == 18) || (keycode == 37) || 
	    (keycode == 39) || (keycode == 46) )
		{return true;}
		
	else if	((keycode ==  9)&& (window.event.shiftKey))
		{return true;}
	else 
		{return false;}
}
function NumericValidate()
{	

	keycode = document.all ? event.keyCode : e.which;
	if (  ((keycode >= 48 && keycode <= 57)  || 
	      (keycode ==  8) || (keycode ==  9) || 
	      (keycode == 13) || 
	      (keycode == 18) || (keycode == 37)) && 
	      (!window.event.shiftKey))
		{ return true;}
		
	else if	((keycode ==  9)&& (window.event.shiftKey))
		{return true;}
	else
		{ return false;}
}
function IntegerValidate()
{	keycode = document.all ? event.keyCode : e.which;
	if (  ((keycode >= 48 && keycode <= 57)  || 
	      (keycode ==  8) || (keycode ==  9) || 
	      (keycode == 13) || 
	      (keycode == 18) || (keycode == 37) || 
	      (keycode == 39) || (keycode == 46) ||
	      (keycode == 188))  && 
	      (!window.event.shiftKey))
		{ return true;}
	else if	((keycode ==  9)&& (window.event.shiftKey))
		{return true;}
	else
		{		
			window.event.keyCode = 0;
			return false;
		}
}
function DecimalValidate()
{	keycode = document.all ? event.keyCode : e.which;
	if (  ((keycode >= 48 && keycode <= 57)  || 
	      (keycode ==  8) || (keycode ==  9) || 
	      (keycode == 13) || 
	      (keycode == 18) || (keycode == 37) || 
	      (keycode == 39) || (keycode == 46) ||
	      (keycode == 188) || (keycode == 190)) && 
	      (!window.event.shiftKey))
		{ return true;}
	else if	((keycode ==  9)&& (window.event.shiftKey))
		{return true;}
	else
		{		
			window.event.keyCode = 0;
			return false;
		}
}

function formatValue(numval)
{
	var nNumVal = new Number(numval);
	var sFormattedNumber = nNumVal.toLocaleString();
	return sFormattedNumber; 
}
function validDateChars()
{
	if ((keycode >= 48 && keycode <= 57) || (keycode >= 37 && keycode <= 40) || (keycode >= 96 && keycode <= 105) || keycode == 8 || keycode == 9 || keycode == 13 || keycode == 27 || keycode == 191 || keycode == 111)
		{
			return true;
		}
		else
		{	
			return false;
		}
}


 function getTarget(e) {
  // IE5
   if (e.srcElement) {
   	return e.srcElement;
   }
    if (e.target) {
   	return e.target;
   }	
 }

  function getKeyCode(e) {
 //IE5
 if (e.srcElement) {
 	return e.keyCode
 }
  // NC5
  if (e.target) {
   return e.which
  }
 }

 function isNumeric(c)
{
	var sNumbers = "01234567890";
	if (sNumbers.indexOf(c) == -1)
		return false;
	else return true;
	
}  

function isAlpha(c)
{
	var lCode = c.charCodeAt(0);
	if (lCode >= 65 && lCode <= 122 )
 	  {	
		return true;
         }
	else 
	return false;
}  

function isPunct(c)
{
	var lCode = c.charCodeAt(0);
	if (lCode >= 32 && lCode <= 47 )
 	  {	
		return true;
         }
	else 
	return false;

}



function getCaretPos()
{
	// get current selection. Object must have a focus at this time

	var currentRange=document.selection.createRange();
	var workRange=currentRange.duplicate();

	// select the whole contents and get 'all' selection

	event.srcElement.select();
	var allRange=document.selection.createRange();
	var len=0;

	// move current selection to the start of object
	// note: we do not use text.length property since it's not equal
	// to the caret actual position

	while(workRange.compareEndPoints("StartToStart",allRange)>0)
	{
	workRange.moveStart("character",-1);
	len++;
	}

	// restore original selection
	// it was lost when we did select() thing

	currentRange.select()

	// len contains the caret position if no selection
	// or selection start point offset if any

	return len;
	
}


function ApplyPhoneMask()
{
	oldValue = null;
	var sMask = "0123456789";
	var theKey = String.fromCharCode(window.event.keyCode);
	var theKeyCode = window.event.keyCode;
	var srcObject = window.event.srcElement;
	var srcVal = srcObject.value;

	// check for numeric 
	if (!isNumeric(theKey))
	{
		window.event.keyCode = 0;
		return false;
	}

	var bKeyAdded = false;

	var theRange = document.selection.createRange();
	var pos = getCaretPos();
	var selLen = theRange.text.length;
	
	if (selLen>0)
	{
		var selText = theRange.text;		
		bKeyAdded = true;
		srcVal = srcObject.value;
		srcVal = srcVal.substring(0,pos) + theKey + srcVal.substring(pos+selLen,srcVal.length);		
	}
	else
	{
		var selText = theKey;		
		bKeyAdded = true;
		srcVal = srcObject.value;
		srcVal = srcVal.substring(0,pos) + theKey + srcVal.substring(pos,srcVal.length);		

	}	
	pos = pos + 1;
	
	
/*
	// if all or part is selected, replace selection with keypress
	if (srcObject.setSelectionRange) 
	{
		// put NN6 compatible script here
	}
    else if (document.selection) 
    {
		var selText = document.selection.createRange().text;
		if (selText.length>0)
		{
			document.selection.createRange().text = theKey;
			document.selection.empty();
			bKeyAdded = true;
		}
    }
  
	srcVal = srcObject.value;

*/

	// check for tab or enter or backspace
	if ((theKeyCode==9)||(theKeyCode==13)||(theKeyCode==8)||(theKeyCode==46))
	{
		window.event.keyCode = 9;
		return true;
	}
	
	// get number with no punctuation
	var theNum = "";
	for (i=0;i<srcVal.length;i++)
		if (isNumeric(srcVal.charAt(i)))
			theNum += srcVal.charAt(i);
	
	// check for numeric
	if (!isNumeric(theKey))
	{
		window.event.keyCode = 0;
		return false;
	}
	
	// if number length => max (10) do nothing
	if (theNum.length > 10)
	{
		window.event.keyCode = 0;
		return false;	
	}
		
	// add typed char to number, then format
	if (!bKeyAdded)
		theNum += theKey;
		
	var addToPos = 0;
	var thePhone = "";
	for (i=0;i<theNum.length;i++)
	{
		switch (i)
		{
			case 0:
				thePhone += "(" + theNum.charAt(i);
				if (pos==1)
					addToPos+=1;				
				break;
			case 2:
				thePhone += theNum.charAt(i) + ") ";
				if (pos==4)
					addToPos+=2;				
				break;
			case 6:
				thePhone += "-" + theNum.charAt(i);
				if (pos>8)
					addToPos+=1;				
				break;
			default:
				thePhone += theNum.charAt(i);
				break;
		}
	}
	pos += addToPos;
	
	// cancel keypress and set phone value
	window.event.keyCode = 0;
	srcObject.value = thePhone;

	theRange.moveStart("character",pos);
	theRange.collapse();
	theRange.select();
	return true
	
}



function ValidateDate(oDate,minDate,maxDate)
{

	if (IsCanceling())
		return true;

	var theDate = oDate.value;

	if (theDate == "")
		return true;	

	var mm = "";
	var dd = "";
	var yyyy = "";
	var msg = "";
		
	if (minDate=="")
		 minDate = '01/01/1900';
		 
	if (maxDate=="")
		 maxDate = '12/31/2099';
		 		 
	switch (theDate.length)
	{
		case 8:
			theDate = theDate.substring(0,6) + "20" + theDate.substring(6,8);
			oDate.value = theDate;
			break;
		case 10:
			// ok
			break;
		default:
			alert("Please enter a valid date");
			oDate.focus();
			oDate.select();
			return false;
			break;
	}
	
	mm = theDate.substring(0,2);
	dd = theDate.substring(3,5);
	yyyy = theDate.substring(6,10);

	var bInvalid = false;
	// test month, day, year
	switch (mm)
	{
		case "01":
		case "03":
		case "05":
		case "07":
		case "08":
		case "10":
		case "12":
			if (parseInt(dd)>31)
			{
				msg = "Day out of range";
				bInvalid = true;			
			}
			break;
		case "04":
		case "06":
		case "09":
		case "11":
			if (parseInt(dd)>30)
			{
				msg = "Day out of range";
				bInvalid = true;	
			}
			break;
		case "02":
			if ((parseInt(dd)==29)&&(parseInt(yyyy)%4==0))
			{
				//is leap year = true
				break;
			}
			else
			if ((parseInt(dd)==29)&&(parseInt(yyyy)%4!=0))
			{
				msg = "Day out of range";
				bInvalid = true;			
			}
			else
			if (parseInt(dd)>28)
			{
				msg = "Day out of range";
				bInvalid = true;			
			}
			break;			
		default:
			msg = "Month out of range";
			bInvalid = true;			
			break;
	}
		
	if (!bInvalid)
	{	
		if (minDate!="")
		{
			var theDateValue = new Date(theDate);
			var theMinDate = new Date(minDate);
			if (theDateValue < theMinDate)
			{
				msg = "Date may not be less than " + minDate;
				bInvalid = true;
			}
		}

		if (maxDate!="")
		{
			var theDateValue = new Date(theDate);
			var theMaxDate = new Date(maxDate);
			if (theDateValue > theMaxDate)
			{
				msg = "Date may not be greater than " + maxDate;
				bInvalid = true;
			}
		}
	}	
	if (bInvalid)
	{
		alert("Please enter a valid date\n\n" + msg);
		oDate.focus();
		oDate.select();
		return false;
	}

	return true;	
}





function setFocus(controlName) 
{	
	if (IsObject(controlName))
		if (!IsHidden(controlName))
		{
			document.all(controlName).focus();
			if (document.all(controlName).type != "select-one")
				{document.all(controlName).select();}
		}

}


function IsHidden(objName)
{

	if (!IsObject(objName))
		return true;
		
	var obj = document.forms[0].elements[objName];

	if (obj==undefined)
		obj = document.getElementById(objName);

	if (obj==undefined)
		return true;
	
	if (obj.style.visibility=="hidden")
		return true;
	else
		return false;

}


function IsObject(objName)
{

	var obj = document.forms[0].elements[objName];
	if (obj!=undefined)
		return true;
	else
		if (document.getElementById)
		{
			var div = document.getElementById(objName);
			if (div!=undefined)	
				return true;
			else
				return false;
		}
		else
			return false;

}


// Check whether string s is empty.
function isEmpty(s)
{   
	return ((s == null) || (s.length == 0) || (TrimVariable(s)=="") || (s=="blank"));
}



// Returns true if string s is empty or 
// whitespace characters only.
function hasWhitespace(s)

{   
	var i;
	
	// whitespace characters
	var whitespace = " \t\n\r";

    // Is s empty?
    if (isEmpty(s)) return false;

    // Search through string's characters one by one
    // until we find a whitespace character.
    // When we do, return true; if we don't, return false (i.e. no whitespace)

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (whitespace.indexOf(c) > -1) return true;
    }

    // All characters are not whitespace.
    return false;
}


// EMAIL VALIDATION 
function isValidEmail(email) {
	 var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
     var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
     if (!reg1.test(email) && reg2.test(email) && !hasWhitespace(email)) 
		return true;
	else
	{
		alert("Please enter a valid e-mail address");			
		return false;
		
	}
  }



function replace(theString, subStr1, subStr2){
        //replaces subStr1 with subStr2 in theString
        var i = theString.indexOf(subStr1);
        if (i == -1) 
			return theString;  
        else 
			return(theString.substring(0,i) + subStr2 + replace(theString.substring(i+subStr1.length,theString.length),subStr1,subStr2));
}


function IsPopupBlockerEnabled(url)
{
	var newWindow;
	var blockerEnabled = false;
	var features = 'location=no,scrollbars=no,status=no,menubar=no,titlebar=no,toolbar=no,resizable=no,height=1,width=1,top=9999, left=9999';
	newWindow= window.open(url,'',features);
	if (newWindow==undefined)			
		{
		   blockerEnabled=true;
		   alert('It appears a pop-up blocker is currently enabled.\nYou must allow pop-ups for this site to function properly.');
		}
	else
	    {
		 newWindow.close();
		  blockerEnabled=false;		  
		}
	return blockerEnabled;
}
				
/*
// ///////////////////////////
// checkCapsLock v1.0
// 
// If a user enters his password in a Web-based form with Caps Lock 
// accidentally on, he can become frustrated because his password is not 
// being accepted... and he may assume the application is the source of the 
// problem.
// 
// This JavaScript function will let the user know his Caps Lock is on and 
// about the potential for error.
// ///////////////////////////
*/

function checkCapsLock( e ) {
	var myKeyCode=0;
	var myShiftKey=false;
	var myMsg='Caps Lock is On.\n\nTo prevent entering your password incorrectly,\nyou should press Caps Lock to turn it off.';

	// Internet Explorer 4+
	if ( document.all ) {
		myKeyCode=e.keyCode;
		myShiftKey=e.shiftKey;

	// Netscape 4
	} else if ( document.layers ) {
		myKeyCode=e.which;
		myShiftKey=( myKeyCode == 16 ) ? true : false;

	// Netscape 6
	} else if ( document.getElementById ) {
		myKeyCode=e.which;
		myShiftKey=( myKeyCode == 16 ) ? true : false;

	}

	// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
	if ( ( myKeyCode >= 65 && myKeyCode <= 90 ) && !myShiftKey ) {
		alert( myMsg );

	// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
	} else if ( ( myKeyCode >= 97 && myKeyCode <= 122 ) && myShiftKey ) {
		alert( myMsg );

	}
	
}

/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
/* browser detection
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */

    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    
    var is_nav6 = (agt.indexOf("netscape6") != -1);
    //var is_nav6up = (is_nav && (is_major >= 5));
    
    var is_nav7 = (agt.indexOf("netscape/7") != -1);
    
    var is_gecko = (agt.indexOf('gecko') != -1);

    var is_safari = (agt.indexOf("safari/100.1")!=-1 || agt.indexOf("safari/125")!=-1);
	var is_mozilla = (agt.indexOf("mozilla/5")!=-1)

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    var is_aol   = (agt.indexOf("aol") != -1);
    var is_aol3  = (is_aol && is_ie3);
    var is_aol4  = (is_aol && is_ie4);
    var is_aol5  = (agt.indexOf("aol 5") != -1);
    var is_aol6  = (agt.indexOf("aol 6") != -1);

    var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

    var is_webtv = (agt.indexOf("webtv") != -1); 

    var is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    var is_AOLTV = is_TVNavigator;

    var is_hotjava = (agt.indexOf("hotjava") != -1);
    var is_hotjava3 = (is_hotjava && (is_major == 3));
    var is_hotjava3up = (is_hotjava && (is_major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    var is_js;
    if (is_nav2 || is_ie3) is_js = 1.0;
    else if (is_nav3) is_js = 1.1;
    else if (is_opera5up) is_js = 1.3;
    else if (is_opera) is_js = 1.1;
    else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
    else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
    else if (is_hotjava3up) is_js = 1.4;
    else if (is_nav6 || is_gecko) is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    //else if (is_nav6up) is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (is_ie5up) is_js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else is_js = 0.0;



/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */

