// JavaScript Document


function validate()
   {
if (document.frmSendInquiry.pmode.selectedIndex ==0)
		{
			alert("Please choose your Payment Mode");
		        document.frmSendInquiry.pmode.focus();
			return false;
		}

  if ((document.frmSendInquiry.chequeno.value=="") || (document.frmSendInquiry.chequeno.value.length < 3))
      {
       alert("\nFrom Field is either empty or less than 3 chars.\n\nPlease re-enter  Cheque / Draft No.");
       document.frmSendInquiry.chequeno.focus();
       return false;
    }
  if ((document.frmSendInquiry.bank.value=="") || (document.frmSendInquiry.bank.value.length < 3))
      {
       alert("\nFrom Field is either empty or less than 3 chars.\n\nPlease re-enter Bank Name.");
       document.frmSendInquiry.bank.focus();
       return false;
    }
  if ((document.frmSendInquiry.amount.value=="") || (document.frmSendInquiry.amount.value.length < 3))
      {
       alert("\nFrom Field is either empty or less than 3 chars.\n\nPlease re-enter Amount.");
       document.frmSendInquiry.amount.focus();
       return false;
    }

  if ((document.frmSendInquiry.name.value=="") || (document.frmSendInquiry.name.value.length < 3))
      {
       alert("\nFrom Field is either empty or less than 3 chars.\n\nPlease re-enter your Name.");
       document.frmSendInquiry.name.focus();
       return false;
    }
	
if (document.frmSendInquiry.Email.value=="")
		{
			alert("Please enter Email");
			document.frmSendInquiry.Email.focus();
			return false;
		}
		var str = document.frmSendInquiry.Email.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.Msg.value=="") || (document.frmSendInquiry.Msg.value.length < 10))
      {
       alert("\nThe Inquiry Message is either empty or less than 10 chars.\n\nPlease re-enter your Inquiry Message.");
       document.frmSendInquiry.Msg.focus();
       return false;
    }
    return true;
 }


