function client_email1(){
var filter=/^.+@.+\..{2,3}$/
var mail=document.forgotpassword.client_email.value;


if(trimSpaces(mail)==""){
alert("Please Enter Email Address!");
 document.forgotpassword.client_email.focus();
 return false;
}
else{
	
if(!filter.test(mail)){
	alert("Please input a valid email address!")
	
	document.forgotpassword.client_email.focus();
	document.forgotpassword.client_email.value='';
	
  	  return false;
	}
}


}





function trimSpaces(stringValue) 
{
	   // Checks the first occurance of spaces and removes them
	   for(i = 0; i < stringValue.length; i++) 
	   {
		    if(stringValue.charAt(i) != " ") 
		     {			break;		}
	   }
	
	   if(i > 0) 
	   {		stringValue = stringValue.substring(i);	}
	
	   // Checks the last occurance of spaces and removes them
	   strLength = stringValue.length - 1;
	   for(i = strLength; i >= 0; i--) 
	   {
		   if(stringValue.charAt(i) != " ") 
		   {		break;		}
	   }
	
	   if(i < strLength)
	   {		stringValue = stringValue.substring(0, i + 1);	}
	
	   // Returns the string after removing leading and trailing spaces.
	return stringValue;
}




