ns4 = (document.layers)? true:false

ie4 = (document.all)? true:false



if(document.images) {

	var upB=new Image()

	upB.src="/img/buttons/bottomButtonUp.gif"

	var downB=new Image()

	downB.src="/img/buttons/bottomButtonDown.gif"

	

	var upSubmitB=new Image()

	upSubmitB.src="/img/buttons/submitUp.gif"

	var downSubmitB=new Image()

	downSubmitB.src="/img/buttons/submitDown.gif"

}



function changeImg(whichImg, img) {

	if (document.images) {

		document[whichImg].src = eval(img + "B.src");

	}

}



function submitForm(whichForm) {

	if (document.forms) {

		document[whichForm].submit();

	}

}



function submitForm2(whichForm,whichval) {

    document[whichForm].temp.value=whichval;

	if (document.forms) {

		document[whichForm].submit();

	}

}



// swap fields

function swap(hideobj,showobj) {

	hidenon(hideobj)

	shownon(showobj)

}



// Show/Hide functions for non-pointer layer/objects

function shownon(showobj) {

	if (ns4) document.layers[showobj].visibility = "show"

	else if (ie4) document.all[showobj].style.visibility = "visible"

}



function hidenon(hideobj) {

	if (ns4) document.layers[hideobj].visibility = "hide"

	else if (ie4) document.all[hideobj].style.visibility = "hidden"

}



function isNumber(testval) {

	if(testval.length == 0) return false;

		

	// if(isNaN(parseInt(testval)) || (parseInt(testval)==0) ) return false;

	var dots = 0;

	for(var i = 0; i < testval.length; i++)

	{

		if(!(testval.charAt(i)=="1" || testval.charAt(i)=="2" || testval.charAt(i)=="3" ||

		     testval.charAt(i)=="4" || testval.charAt(i)=="5" || testval.charAt(i)=="6" ||

			 testval.charAt(i)=="7" || testval.charAt(i)=="8" || testval.charAt(i)=="9" ||

			 testval.charAt(i)=="0" || testval.charAt(i)==".")) return false;
			 
		if(testval.charAt(i)==".") dots++;

	}
	
	if(dots > 1) return false;

	return true;

}



function LTrim(val) {
	while(val.charAt(0) == " ")
	{
		val = val.substring(1);
	}
	return val;
}

function ltrim(val) { return LTrim(val); }

function RTrim(val) {
	while(val.charAt(val.length-1) == " ")
	{
		val = val.substring(0, val.length-2);
	}
	return val;
}

function rtrim(val) { return RTrim(val); }

function Trim(val) { return LTrim(RTrim(val)); }

function trim(val) { return Trim(val); }
