function formvalidation()
{
if(document.enquiry.fullname.value=="")
{
alert("Enter the Name");
document.enquiry.fullname.focus();
return false;
}

var emailID=document.enquiry.email;
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}	
if(document.enquiry.phone.value=="")
{
alert("Enter the Phone No");
document.enquiry.phone.focus();
return false;
}
if(document.enquiry.description.value=="")
{
alert("Enter the Description");
document.enquiry.description.focus();
return false;
}
}


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
		 }

 		 return true					
	}

function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
if(unicode==9)
{
return true;
}
if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
if (unicode<48||unicode>57) //if not a number
return false //disable key press
}
}
function validatenewsletter()
{
if(document.nl.name.value=='Enter your name' || document.nl.name.value=='')
{
alert("Enter your name");
document.nl.name.focus();
return false
}
if(document.nl.email.value=='Enter your email' || document.nl.email.value=='')
{
alert("Enter your Email id");
document.nl.email.focus();
return false
}
if (echeck(document.nl.email.value)==false){
		document.nl.email.value="";
		document.nl.email.focus();
		return false
	}	
return true;
}


