function validatelogin() 
{
if(document.form1.email.value=="")
	{
	hideAllErrors();
  document.getElementById("mailError").style.display ="inline";
	document.form1.email.select() ;
 	document.form1.email.focus() ;
	return false ;
	}
	else
	{
	var xat=document.form1.email.value.indexOf("@") ;
 	var xat2=document.form1.email.value.lastIndexOf("@") ;
 	var xdot=document.form1.email.value.indexOf("." ,xat+2) ;
	
	}
if((xat!=xat2)||(xat==-1) ||(xdot==-1))
	{
  hideAllErrors();
  document.getElementById("wrongmailError").style.display ="inline";
	document.form1.email.select() ;
	document.form1.email.focus() ;
 	return false ;
	}
	
	else if(document.form1.password.value=="")
	{
	hideAllErrors();
  document.getElementById("passError").style.display ="inline";
	document.form1.password.select() ;
 	document.form1.password.focus() ;
	return false ;
	}	
	return true;

}
  function hideAllErrors() 
  {
  document.getElementById("mailError").style.display = "none"
document.getElementById("wrongmailError").style.display = "none"
 document.getElementById("passError").style.display = "none"
 }