// JavaScript Document


function validate()
   {
  if ((document.frmSendInquiry.TxtReg_Id.value=="") || (document.frmSendInquiry.TxtReg_Id.value.length < 4))
      {
       alert("\Registration Field is either empty or less than 4 chars.\n\nPlease re-enter your Registration code.");
       document.frmSendInquiry.TxtReg_Id.focus();
       return false;
    }
	
if (document.frmSendInquiry.TxtEmail.value=="")
		{
			alert("Please enter Email");
			document.frmSendInquiry.TxtEmail.focus();
			return false;
		}
		var str = document.frmSendInquiry.TxtEmail.value
		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
		 }
  if ((document.frmSendInquiry.TxtMsg.value=="") || (document.frmSendInquiry.TxtMsg.value.length < 10))
      {
       alert("\nThe Query Field is either empty or less than 10 chars.\n\nPlease re-enter your Query Field.");
       document.frmSendInquiry.TxtMsg.focus();
       return false;
    }
    return true;
 }

