<!--

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 IsValidEmail(email){

	invalidChars = " /:,;"

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

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

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

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

	return true;
}

function PhotoWindow(strFilename){
	
	var posX = (screen.width / 2) - 420;
	
	window.open("photo_window.php?f="+ strFilename, "PhotoWindow","height=600,width=840,left="+ posX +",top=100,toolbar=0,scrollbars=0,resizable=yes");
}

// -->