function validateForm(){
	
	
	if(trim(document.getElementById('user').value)=="")
	{
		alert("Please specify Email Address.");
		document.getElementById('user').focus();
		return false;
		
	}
	
	
	var contactEmail = trim(document.getElementById('user').value);
	if(contactEmail !="")
	{
		if(!checkEmail(contactEmail,null,"Please enter valid email address."))
		{
			document.getElementById('user').focus();
			return false;
		}
	}	
	if(trim(document.getElementById('password').value) =="")
	{
		alert("Please specify password.");
		document.getElementById('password').focus();
		return false;
		
	}
	/*
	var userName = document.frmLogin.user.value;
	var password =document.frmLogin.password.value;
	
	
	
	if(userName=="")
	{
	alert("Please specify your user name." );
	document.frmLogin.user.focus();
	return false;
	}
	if(password=="")
	{
	alert("Please specify your password." );
	document.frmLogin.password.focus();
	return false;
	}
	*/
return true;
}//end of validateAdmin function

/*
function validLength ( strVal, strMsg ) {
  if ( strVal.length < 1) {
		alert( strMsg );
		return false;
  }  //End of IF
  
} //End of FUNC validLength
function validateUserName(){
	var userName = document.getElementById('user');
	if(validLength ( userName.value,"Please specify your user name." ) == false ){
		userName.focus();
		return false;
	}
}
*/
function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}



function checkEmail(field,excval,errstmt){
var emailregex=/^[\w]+\+?\w*@[\w]+\.[\w.]+\w$/;
var match=field.match(emailregex);
     if (!match) {
          if (errstmt) alert(errstmt);
          if (excval) eval(excval);
          return false;
     }else return true;
}
