function validate()
{

	var n=document.f1.CompanyName.value;
	if(n=="")
	{
		alert("Company Name cannot be blank")
		document.f1.CompanyName.focus();		
		return false;

	 }
        for (var i = 0; i < n.length; i++) {
                var ch = n.substring(i, i + 1);
                if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') {
                        alert("The NAME field only accepts letters.");
                        document.f1.cname.select();
                        document.f1.cname.focus();
						return false;
                }
        }
        
	
	var a=document.f1.contactname.value;
	if (a=="")
	{
		alert ("Please enter your Name");
		document.f1.contactname.select();
		document.f1.contactname.focus();
		return false;
	}
	var cp=document.f1.Address.value;
	if(cp=="")
	{
		alert("Address cannot be blank")
		document.f1.Address.select();
		document.f1.Address.focus();		
		return false;

	 }
	 var f=document.f1.City.value;
	if (f=="")
	{
		alert ("Please enter your City ");
		document.f1.City.select();
		document.f1.City.focus();
		return false;
	}	
	
	var t=document.f1.country.value;
	if (t=="")
	{
		alert ("Select your Country");
		document.f1.country.select();
		document.f1.country.focus();
		return false;
	}
	var te=document.f1.telNo.value;
	if (te=="")
	{
		alert ("Please enter your Telephone No.");
		document.f1.telNo.select();
		document.f1.telNo.focus();
		return false;
	}
    if (isNaN(document.f1.telNo.value))
    {
		alert ("Characters are not allowed for Telephone No.");
		document.f1.telNo.select();
		document.f1.telNo.focus();
		return false;
	}
	

	var e=document.f1.email.value;
	
    if (e == "") {
                alert("\nThe E-Mail field is blank")
                document.f1.email.focus();
                return false;
        }
 if ((e.indexOf(" ")!=-1)) {
    alert("Sorry, but email address cannot contain spaces!");
	document.f1.email.focus();
    return false;
 }

 if ((e.indexOf("@")==-1)) {
    alert("E-mail address should contain '@' character!");
	document.f1.email.focus();
    return false;
 }

 if (e.indexOf("@")<2) {
    alert("This email address is incorrect!\nPlease verify the text before '@' character");
	document.f1.email.focus();
    return false;
 }

 if ((e.indexOf(".",e.indexOf("@")) - e.indexOf("@")) < 2 ) {
 alert("This email address is incorrect ! No domain specified.")
	document.f1.email.focus();
 return false;
 }
 
 if ((e.length - e.indexOf(".",e.indexOf("@"))) < 2 ) {
 alert("This email address is incorrect !")
	document.f1.email.focus();
 return false;
 }
 
 if (e.charAt(e.length-1) == "." ) {
 alert("This email address is incorrect ! Dot cannot be the last character.")
	document.f1.email.focus();
 return false;
 }
 


var r=document.f1.requirement_details.value;
	if (r=="")
	{
		alert ("Please enter your remarks.")
		document.f1.requirement_details.focus();
		return false;
	}
    
	if (r.length>300)
	{
		alert ("Give feedback Only in 300 characters")
		return true;
		for (var i = 0; i < r.length; i++) {
                var ch = r.substring(i, i + 1);
                if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' ') {
                        alert("The remark field accepts letters.");
                        document.f1.requirement_details.select();
                        document.f1.requirement_details.focus();
                        return false;
                }
        }
		}
		
submitform();
}
