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-1){
		    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					
}
 
function validate(){
	if(document.form1.name.value==""){
	alert("Please Enter 'Name' !");
	  document.form1.name.focus();
	  return false;
	 }
	if(document.form1.company.value==""){
	alert("Please Enter 'Company' !");
	  document.form1.company.focus();
	  return false;
	 }	 
	if(document.form1.address1.value==""){
	alert("Please enter 'Address' !");
	  document.form1.address1.focus();
	  return false;
	 }	 
    if (echeck(document.form1.email.value)==false){
	  document.form1.email.focus();
	  return false;
	 }	 	 
	if(document.form1.county.value==""){
	alert("Please enter 'County' !");
	  document.form1.county.focus();
	  return false;
	 }
	if(document.form1.postcode.value==""){
	  alert("Please enter a valid 'Post Code' !");
	  document.form1.postcode.focus();
	  return false;
	 }		 

	if(document.form1.comments.value==""){
	alert("Please enter 'Comments/Suggestions' !");
	  document.form1.comments.focus();
	  return false;
	}

 return true;

}