
function set() {
    var name = document.getElementById("yname").value;
//var name=getElementsByName("entry.1732209079").value;
//alert(name);
var mobile = document.getElementById("phone").value;
	var email = document.getElementById("email").value;
	var cname = document.getElementById("cname").value;
 //alert(name);
	/*var combox = document.getElementById("combox").value;*/
        var regex=/^[A-Za-z\s]+$/;
	var atposition=email.indexOf("@");  
var dotposition=email.lastIndexOf("."); 
             
 if(!regex.test(name)||!isNaN(name)||name.length==0)
{
 alert("Please enter your name"); 
  document.getElementById("yname").focus();
document.getElementById("yname").select();
 //document.getElementById("msgname").innerHTML="please fill name";
 return false;     

}

 else if (atposition<1 || dotposition<atposition+2 || dotposition+2>=email.length||email.length==0){ 
     alert("Please enter your valid email id");
     document.getElementById("email").focus();
document.getElementById("email").select(); 
//document.getElementById("msgname3").innerHTML="enter emailaddress";
  return false;  
  }

 else if(mobile.length != 10||mobile.length==0)
{
    alert("Please enter your valid mobile number");
    document.getElementById("phone").focus();
document.getElementById("phone").select();
//document.getElementById("msgname2").innerHTML="enter mobile number";
 return false;
}
	
else  if(!isNaN(cname)||cname.length==0)
{
 alert("Please enter your company name"); 
  document.getElementById("cname").focus();
document.getElementById("cname").select();
 //document.getElementById("msgname").innerHTML="please fill name";
 return false;     

}	
	/*
	else  if(!regex.test(combox)||!isNaN(combox)||combox.length==0)
{
 alert("Please enter your message"); 
  document.getElementById("combox").focus();
document.getElementById("combox").select();
 //document.getElementById("msgname").innerHTML="please fill name";
 return false;     

}
	*/
   


}

function set1() {
 
    var name = document.getElementById("yname1").value;
	var mobile = document.getElementById("phone1").value;
	var email = document.getElementById("email1").value;
	var cname = document.getElementById("cname1").value;
	
        var regex=/^[A-Za-z\s]+$/;
	var atposition=email.indexOf("@");  
var dotposition=email.lastIndexOf("."); 
             
 if(!regex.test(name)||!isNaN(name)||name.length==0)
{
 alert("Please enter your name"); 
  document.getElementById("yname1").focus();
document.getElementById("yname1").select();
 
 return false;     

}

 else if (atposition<1 || dotposition<atposition+2 || dotposition+2>=email.length||email.length==0){ 
     alert("Please enter your valid email id");
     document.getElementById("email1").focus();
document.getElementById("email1").select(); 
  return false;  
  }

 else if(mobile.length != 10||mobile.length==0)
{
    alert("Please enter your valid mobile number");
    document.getElementById("phone1").focus();
document.getElementById("phone1").select();
 return false;
}
	
else  if(!isNaN(cname)||cname.length==0)
{
 alert("Please enter your company name"); 
  document.getElementById("cname1").focus();
document.getElementById("cname1").select();
  return false;     

}	

   


}





