function fnPost()
{
   var oForm, arrArray;
   oForm = document.frmMain;

   if (!checkMandatoryWithAlert(oForm.elements["Name"],"Name"))return false;
   if (!checkMandatoryWithAlert(oForm.elements["Email"],"Email"))return false;
   if (!checkValidEmailWithAlertOptional(oForm.elements["Email"],"Email"))return false;
   if (!checkMandatoryWithAlert(oForm.elements["Contact"],"Contact"))return false;
   if (!checkNumericWithAlertOptional(oForm.elements["Contact"],"Contact",7))return false;
   if (!checkMandatory(oForm.elements["Fax"]))
   {
   }
   else
   {
      if (!checkNumericWithAlertOptional(oForm.elements["Fax"],"Fax",7))return false;
   }
   if (!checkMandatoryTextArea(oForm.elements["Enquiry"],"Feedback/Enquiry",1000))return false;

   //get values of topic and email addresses from list box and separate them

   //assign values to hidden fields
   sSelectedValue = oForm.elements["emailList"].value;
   arrArray = sSelectedValue.split("|");
   document.frmPost.elements["hdnEmail1"].value = arrArray[0];
   document.frmPost.elements["hdnEmail2"].value = arrArray[1];
   document.frmPost.elements["hdnEmail3"].value = arrArray[2];
   document.frmPost.elements["hdnEmail4"].value = arrArray[3];
   
   document.frmPost.elements["hdnName"].value = oForm.elements["Name"].value;

   document.frmPost.elements["hdnEmail"].value = oForm.elements["Email"].value;
   document.frmPost.elements["hdnCompany"].value = oForm.elements["Company"].value;
   document.frmPost.elements["hdnTitle"].value = oForm.elements["Title"].value;
   document.frmPost.elements["hdnAddress1"].value = oForm.elements["Address1"].value;
   document.frmPost.elements["hdnAddress2"].value = oForm.elements["Address2"].value;
   document.frmPost.elements["hdnZipCode"].value = oForm.elements["ZipCode"].value;
   document.frmPost.elements["hdnContact"].value = oForm.elements["Contact"].value;
   document.frmPost.elements["hdnFax"].value = oForm.elements["Fax"].value;
   document.frmPost.elements["hdnWebsite"].value = oForm.elements["Website"].value;
   document.frmPost.elements["hdnProductCat"].value = '-';
   document.frmPost.elements["hdnTypePurchase"].value = '-';
   document.frmPost.elements["hdnMessage"].value = oForm.elements["Enquiry"].value;
   document.frmPost.action = "contactform_sendmail_action.asp";
   document.frmPost.submit();
}



























