
function LoginValidate()
{
 
var sEmail=document.frmLogin.txtEmail.value;
var sPwd=document.frmLogin.txtPassword.value;
var regex = /^[a-zA-Z0-9_.]+@([a-zA-Z0-9_.]+\.)+[a-zA-Z0-9.-]{2,3}$/;	 	
  match = regex.test(sEmail)	
	if(sEmail == "")
	{
	 alert("Please Provide Your UserName");
	 document.frmLogin.txtEmail.focus();
	 return false; 
	}

	  if(! match)
		{
   			alert("Invalid Mailid, Please Provide Valid Emailid");
   			document.frmLogin.txtEmail.focus();
   			return false;  
		}

 	if(sPwd == "")
	{
	 alert("Please Provide Your Password");
	 document.frmLogin.txtPassword.focus();
	 return false; 
	}
 document.frmLogin.submit();
}
function advertiseValidate()
{
 
	var sName=document.frmAdv.txtName.value;
	var sEmail=document.frmAdv.txtEmail.value;
	var sCName=document.frmAdv.txtCompName.value;
	var sPhNo=document.frmAdv.txtPhNo.value;
	var sAddress=document.frmAdv.txtAdd.value;
	var sATitle=document.frmAdv.txtAdvtTitle.value;
	var sADesc=document.frmAdv.txtAdvDesc.value;
	var sALink=document.frmAdv.txtAdvLink.value;
	var regex = /^[a-zA-Z0-9_.]+@([a-zA-Z0-9_.]+\.)+[a-zA-Z0-9.-]{2,3}$/; 	
	match = regex.test(sEmail) 
 		if(sName == "")
			{
	 		alert("Please Provide Your Name");
	 		document.frmAdv.txtName.focus();
	 		return false; 
			}

 
			if(sEmail == "")
			{
			alert("Please Provide Your Email");
	 		document.frmAdv.txtEmail.focus();
	 		return false; 
			}

  			if(! match)
			{
   			alert("Invalid Mailid, Please Provide Valid Emailid");
   			document.frmAdv.txtEmail.focus();
   			return false;  
			}

			if(sCName == "")
			{
	 		alert("Please Provide Your Company Name");
	 		document.frmAdv.txtCompName.focus();
			return false; 
			}
	
			if(sPhNo == "")
			{
	 		alert("Please Provide Your Phone Number");
		 	document.frmAdv.txtPhNo.focus();
	 		return false; 
			}
	
			if(isNaN(sPhNo)||sPhNo.indexOf(" ")!=-1)
           	{
             alert("Enter numeric value")
			 document.frmAccount.txtPhNo.focus();
             return false;
           	}
	
			if(sAddress == "")
			{
	 		alert("Please Provide Your Address");
	 		document.frmAdv.txtAdd.focus();
		 	return false; 
			}

			if(sATitle == "")
			{
	 		alert("Please Provide the Title");
	 		document.frmAdv.txtAdvtTitle.focus();
	 		return false; 
			}
	

 			if(sADesc == "")
			{
	 		alert("Please Provide the Description");
	 		document.frmAdv.txtAdvDesc.focus();
	 		return false; 
			}
	
 return true;
}

