// JavaScript Document
function trim(fieldValue){
	var s = new String(fieldValue);
	var str = ""
	var strSpace = " ";
	var i,j,intCount;	
	//to replace the enter pressed with space
	for(intCount=0;intCount<s.length;intCount++){
		if (!((s.charCodeAt(intCount)!=13) && (s.charCodeAt(intCount)!=10)))
			s=s.replace(s.charAt(intCount)," ");
	}
	
	for (i=0;i<s.length && s.charAt(i) == strSpace;i++);
	for (j=s.length; j>=0 && s.charAt(j - 1) == strSpace; j--);

	for (;i<j;i++)
		str = str + s.charAt(i);
	return (str)		
}
function isPhone(ph){
	if(ph.indexOf(".")!=-1)
		return false;	
	ph=ph.replace(" ","");	
	if(isNaN(ph))		
		return false;
	return true;
}
re = /^\w+([\.-]?\w+)*@[a-zA-Z0-9]+([\.-]?\w+)*(\.\w{2,3})+$/

function validateEmail(Email){
	if (re.test(Email)) {
		return true;
	}
	return false;
}
function validatate(frm){
	em=trim(frm.eEmail.value);
	if(em=="" || !validateEmail(em)){
		alert("Please enter valid email address.");
		frm.eEmail.focus();
		return false;
	}
		
}