function Validate(){
	//alert("mail");
	if((checkEmailId()==true) && (checkEmailIdFormat()==true) && (passwordvalidate()==true))
	{
	   return true;
	} else{
 		return false;
	 }
}

function checkEmailId(){
	var email=document.indexform.emailid.value;
	if (email==""){
		alert("Please Enter Email Id");
		document.indexform.emailid.focus();
		return false;
	} else {
		return true;
		}
}

function checkEmailIdFormat()
{
	email=document.indexform.emailid.value;
	if(email!=""){
		atValue = email.indexOf("@");
		dotValue = email.lastIndexOf(".");
		var atFlag = 0;
		var dotFlag = 0;	
		
		if ( (atValue != -1) && (atValue != 0) && (atValue != (email.length)-1) )
		{
			atFlag = 1;
		}
	
		if ( (dotValue != -1) && (dotValue != 0) && (dotValue != (email.length)-1) )
		{
			dotFlag = 1;
		}	
		
		else
		{
			alert("Please enter correct Email Address.");
			document.indexform.emailid.value="";
			document.indexform.emailid.focus();
			return false;
		}
	}	
	return true;
}  

function passwordvalidate(){
	//alert("hi");
	var pwd1=document.indexform.password.value;
	if (pwd1==""){
		alert("Please enter Password");
		document.indexform.password.focus();
		return false;
	}else{
		return true;
	}
}
