function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
	if ((str.match("yahoo.com"))|| (str.match("sify.com")) || (str.match("rediffmail.com"))|| (str.match("gmail.com")))
		{
		    alert("Please enter your business E-mail ID.")
		    return false
		 }
	 
 		 return true					
	}



function frm_Validate(){
	if(document.krishna.client_name.value==""){
	alert("Please enter your name.");
	document.krishna.client_name.focus();
	return false;
	}

// Email Validation 

	var emailID=document.krishna.email;
	
	if ((emailID.value==null)||(emailID.value==""))
		{
			alert("Please enter your E-mail ID.");
			emailID.focus();
			return false;
		}
	
	if (echeck(emailID.value)==false)
		{
			emailID.value="";
			emailID.focus();
			return false;
		}



// end of valid email-id check
	
	if(document.getElementById('client_country').value=="")
	{
	alert("Please select Country Name.");
	document.krishna.client_country.focus();
	return false;
	}
    if(document.krishna.client_contact.value=="")
	{
	alert("Please enter Contact Number.");
	document.krishna.client_contact.focus();
	return false;
	}
	if(document.krishna.client_url.value=="")
	{
	alert("Please enter Website URL.");
	document.krishna.client_url.focus();
	return false;
	}
	
	if(document.getElementById('wp1').checked==false && document.getElementById('wp2').checked==false && document.getElementById('wp3').checked==false)
	{
	alert("Please select Link Building Packages");
	return false;
	}
	
	if(document.krishna.target_keywords.value=="")
	{
	alert("Please enter Target Keywords.");
	document.krishna.target_keywords.focus();
	return false;
	}
	
	if(document.krishna.client_message.value=="")
	{
	alert("Please enter Message.");
	document.krishna.client_message.focus();
	return false;
	}
	
	if(document.krishna.captcha.value=="")
	{
	alert("Please enter Verification Code.");
	document.krishna.captcha.focus();
	return false;
	}
}
