function check()
{
var txtname = document.getElementById("txtname");
var txtemail = document.getElementById("Email");
var txtenq = document.getElementById("enq");
var txtdesc = document.getElementById("Description");
if( txtname.value=="")
		{
		alert("Please Enter Your Full Name!");
		txtname.focus();
		return false;
		}
if(txtname.value.length > 100)
      {
        alert("Name length cannot exceed 100 characters.");
        txtname.focus();
        return;
      }
if( txtemail.value=="")
		{
		alert("Please Enter Your valid Email Address !");
		txtemail.focus();
		return false;
		}
if (echeck(txtemail.value)==false)
       {
		txtemail.value=""
		txtemail.focus()
		return false
	   }
	
if( txtenq.value=="")
		{
		alert("Please Enter Your Enquiry Type !");
		txtenq.focus()
		return false;
		}
if( txtdesc.value=="")
		{
		alert("Please Enter Your Description !");
		txtdesc.focus()
		return false;
		}
		
}
function echeck(txtemail) {
		var at="@"
		var dot="."
		var lat=txtemail.indexOf(at)
		var ltxtemail=txtemail.length
		var ldot=txtemail.indexOf(dot)
		if (txtemail.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (txtemail.indexOf(at)==-1 || txtemail.indexOf(at)==0 || txtemail.indexOf(at)==ltxtemail){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (txtemail.indexOf(dot)==-1 || txtemail.indexOf(dot)==0 || txtemail.indexOf(dot)==ltxtemail){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (txtemail.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (txtemail.substring(lat-1,lat)==dot || txtemail.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (txtemail.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (txtemail.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function CheckTextAreaLength(Obj, Len)
  {
    var Str;
    Str = Obj.value;
    if (Str.length >= Len)
    {
      alert("Cannot Exceed " + Len + " Characters")
      event.keyCode = 0
      return;
    }  
  }
   function printpage()
{
window.print();  
}
