<!--

function trim(varString){

	var strTemp = varString.toString();
		
	if(strTemp.indexOf(" ") >= 0){
	
		// Left Trim
		for (i=0; i < strTemp.length; i++) {
			if(strTemp.charAt(i) == " "){
				strTemp = strTemp.substring(i + 1);
			}
			else{
				break
			}
		}
		
		// Right Trim
		for (i=strTemp.length - 1;  i >= 0; i--) {
			if(strTemp.charAt(i) == " "){
				strTemp = strTemp.substring(0, i);
			}
			else{
				break
			}
		}
	}
	
	return strTemp
}

function ShowError(strFormField){
	eval(strFormField).className = "show_error";	
}

function ClearError(strFormField){
	eval(strFormField).className = "clear_error";	
}

function IsValidEmail(strEmail) {

	invalidChars = " /:,;"

	if (strEmail == "") {
		return false;
	}

	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (strEmail.indexOf(badChar,0) > -1) {
			return false;
		}
	}
		
	atPos = strEmail.indexOf("@",1)
	if (atPos == -1) {
		return false;
	}

	periodPos = strEmail.indexOf(".",atPos)
	if (periodPos == -1) {
		return false;
	}

	if (periodPos + 3 > strEmail.length) {
		return false
	}

	return true;
	
}

function OpenWin(strURL, strName, intWidth, intHeight){
	
	var posX = (screen.width / 2) - (intWidth / 2);
	
	window.open(strURL, strName, "height="+ intHeight +",width="+ intWidth +",left="+ posX +",top=100,toolbar=0,scrollbars=yes,resizable=yes");
}

function GoURL(strURL){
	document.location.href = strURL;
}

function IsNumeric(varValue){
	
	varValue = varValue.toString();

	if (varValue.length == 0){
		return false;
	}
	
	for (var n = 0; n < varValue.length; n++){
	
		if (isNaN(varValue.substring(n, n+1)) && (varValue.substring(n, n+1) != "."))
			return false;
		}
		
	return true;
}
// -->