
function Validate( strFormName )
  {

    var intFlag = 0;
    var strErrMsg;
    var strTempFieldValue;
    var boolErrRtn = false;
    var strOutput = "Please complete the following field(s): \n\n";

    var strFName = document.getElementById( "txtFName" ).value;
    var strLName = document.getElementById( "txtLName" ).value;
    var intPhone = document.getElementById( "txtPhone").value;
//        var intFax = document.getElementById( "txtFax" ).value;
    var strEmail = document.getElementById( "txtEmail" ).value;
//        var strOrgName = document.getElementById( "txtOrgName" ).value;

    var objContactTopicSales = document.getElementById( "rdoContactTopicSales" );
    var objContactTopicSupport = document.getElementById( "rdoContactTopicSupport" );
    var objContactTopicQuestion = document.getElementById( "rdoContactTopicQuestion" );

    var boolContactTopicSales  = objContactTopicSales.checked;
    var boolContactTopicSupport = objContactTopicSupport.checked;
    var boolContactTopicQuestion  = objContactTopicQuestion.checked;

    var strContactTopicDesc = "";
    var intselContactTopicIndex = 0;
    if (boolContactTopicSales)    { strContactTopicDesc = objContactTopicSales.value;     intselContactTopicIndex = 1; }
    if (boolContactTopicSupport)  { strContactTopicDesc = objContactTopicSupport.value;   intselContactTopicIndex = 3; }
    if (boolContactTopicQuestion) { strContactTopicDesc = objContactTopicQuestion.value;  intselContactTopicIndex = 2; }
    //alert("Desc = " + strContactTopicDesc); 

    document.getElementById( "hdnFullName" ).value = strFName + " " + strLName;
    document.getElementById( "hdnContactTopic" ).value = strContactTopicDesc;
    //alert("strContactTopicDesc = " + strContactTopicDesc);
    document.getElementById( "hdnContactTopicIndex" ).value = intselContactTopicIndex;

    var strQuestion_Comment = document.getElementById( "txaInquiry_Comment").value;


    boolValidateAllFields = true;

    strErrMsg = ChkFieldNotBlank ( strFName, 'First Name', 'first name', 2, true );
    if (strErrMsg.length > 0)
       {
         intFlag++;
         strOutput += strErrMsg + "\n";
       }

    strErrMsg = ChkFieldNotBlank ( strLName, 'Last Name', 'last name', 2, true );
    if (strErrMsg.length > 0)
       {
         intFlag++;
         strOutput += strErrMsg + "\n";
       }

    /*alert("Phone Length = " + intPhone.length);*/
//        if (intPhone.length >= 1)
//           {
         strErrMsg = ChkPhoneNumber( intPhone, true, true );
         if (strErrMsg.length > 0)
            {
             intFlag++;
             strOutput += strErrMsg + "\n";
            }
//           }

    strErrMsg = ChkEMail ( strEmail );
    if (strErrMsg.length > 0)
       {
        intFlag++;
        strOutput += strErrMsg + "\n";
       }

    if (boolContactTopicSales  &&  boolContactTopicQuestion  &&  boolContactTopicSupport)
       {
        intFlag++;
        strOutput = strOutput + "You must only choose one Contact Us Topic\n\n";
       }

    if (!(boolContactTopicSales  ||  boolContactTopicQuestion  ||  boolContactTopicSupport))
       {
        intFlag++;
        strOutput = strOutput + "Please select your Contact Us Topic\n\n";
       }

    if (boolContactTopicQuestion)
       {
        strErrMsg = ChkFieldNotBlank ( strQuestion_Comment, 'Inquiry/Comment', 'inquiry/comment', 2, true );
        if (strErrMsg.length > 0)
           {
             intFlag++;
             strOutput += strErrMsg + "\n";
           }
       }


    boolValidateAllFields = false;

    if (intFlag != 0)
       {
        alert( strOutput );

        return false;
       }


    document[strFormName].submit();

    return( true );
  }
