// Trim leading and trailing spaces
function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}

// Validate email address
function emailAddressIsValid(str){
	var emailAddressFormat = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,3}$/;
	if (!(emailAddressFormat.test(str))){
		return false;
	}
	return true;
}

function OpenImage(imgFile){
	if (new String(newWinImg)!="undefined" && newWinImg!=null) if (!newWinImg.closed) newWinImg.close();
	var newWinImg=window.open("","Picture","width=100,height=100,top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=no,menubar=no,status=no,toolbar=no,scrollbars=no,z-lock=yes");
	newWinImg.document.write('<HTML><HEAD><TITLE>Practiceedge - Picture</TITLE></HEAD><BODY marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 alink="#0033CC bgcolor="#E5F2FF" onload="window.resizeTo(parseInt(document.images[\'img\'].width)+10,parseInt(document.images[\'img\'].height)+29)"><IMG src="' + imgFile + '" name=img></BODY></HTML>')
	newWinImg.document.close()
	newWinImg.focus();
}

function ForgotPassword(){
	var obj = window.open('app_forgot.php', 'ForgotPassWnd', 'width=350,height=100,scrollbars=no,resizable=no');
	obj.focus();
	obj.moveTo((screen.width - 370)/2, (screen.height - 120)/2);
}
