function validate(){

	if(document.rfq.Name.value==''){
		alert("Please Input Your Name");
		document.rfq.Name.focus();
		return false;
	}

	if(document.rfq.Email.value==''){
		alert("Please Input Email ID");
		document.rfq.Email.focus();
		return false;
	}
	if(eCheck(document.rfq.Email.value)==false){
			document.rfq.Email.value="";
			document.rfq.Email.focus();
			return false;
	}
	if(document.rfq.Company.value==''){
		alert("Please Input Company Name.");
		document.rfq.Company.focus();
		return false;
	}
	if(document.rfq.Phone.value==''){
		alert("Please Input Phone No.");
		document.rfq.Phone.focus();
		return false;
	}
	if(document.rfq.projdesc.value==''){
		alert("Please Input Project Description.");
		document.rfq.projdesc.focus();
		return false;
	}

	if(document.rfq.code.value==''){
		alert("Please Input Code.");
		document.rfq.code.focus();
		return false;
	}


}
function validate2(){

	if(document.rfq1.Name.value==''){
		alert("Please Input Your Name");
		document.rfq1.Name.focus();
		return false;
	}

	if(document.rfq1.Email.value==''){
		alert("Please Input Email ID");
		document.rfq1.Email.focus();
		return false;
	}
	if(eCheck(document.rfq1.Email.value)==false){
			document.rfq1.Email.value="";
			document.rfq1.Email.focus();
			return false;
	}
	if(document.rfq1.Company.value==''){
		alert("Please Input Company Name.");
		document.rfq1.Company.focus();
		return false;
	}
	if(document.rfq1.Phone.value==''){
		alert("Please Input Phone No.");
		document.rfq1.Phone.focus();
		return false;
	}
	if(document.rfq1.projdesc.value==''){
		alert("Please Input Project Description.");
		document.rfq1.projdesc.focus();
		return false;
	}

	if(document.rfq1.code.value==''){
		alert("Please Input Code.");
		document.rfq1.code.focus();
		return false;
	}


}
function validate1(){

	if(document.theform.txtName.value=='')	{
		alert("Please Input Name.");
		document.theform.txtName.focus();
		return false;
	}
	if(document.theform.Address.value==''){
		alert("Please Input Your address");	
		document.theform.Address.value=='';
		document.theform.Address.focus();
		return false;
	}
	
	if(document.theform.City.value==''){
		alert("Please Input City Name");
		document.theform.City.value=='';
		document.theform.City.focus();
		return false;
	}
	
	/*if(document.theform.State.value==''){
		alert("Please Input State Namd");
		document.theform.State.value=='';
		document.theform.State.focus();
		return false;
	}
	if(document.theform.Pin.value==''){
		alert("Please Input Pin Code");
		document.theform.Pin.value=='';
		document.theform.Pin.focus();
		return false;
	}
	if(document.theform.Phone.value==''){
		alert("Please Input Phone No");
		document.theform.Phone.value=='';
		document.theform.Phone.focus();
		return false;
	}*/
	if(document.theform.Email.value==''){
		alert("Please Input Email ID.");
		document.theform.Email.value=='';
		document.theform.Email.focus();
		return false;
	}
	if(eCheck(document.theform.Email.value)==false){
			document.theform.Email.value="";
			document.theform.Email.focus();
			return false;
	}
	if(document.theform.Comments.value==''){
		alert("Please Input Your Comments");	
		document.theform.Comments.value=='';
		document.theform.Comments.focus();
		return false;
	}
	document.theform.submit();
	return true;
}
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(dot) == lstr-1  || str.indexOf(dot) == lstr-2){
			 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
		 }

 		 return true					
}	
// JavaScript Document