function validateForm(thisform) {

    

    with (thisform) { 
        //Required           
        if (checkString(first_name,"»First Name«")==false) { 
        selectField(document.getElementById('first_name').id,'first_name');

        return false;
        }
        else {
        deselectField(document.getElementById('first_name').id);
        }

        
        //Required
        if (checkString(last_name,"»Last Name«")==false) {
        selectField(document.getElementById('last_name').id,'last_name');
        return false;
        }
        else {
        deselectField(document.getElementById('last_name').id);
        }

        
        

        
        //Required
        if (checkString(CompanySize,"»Company Size«")==false) {
        selectField(document.getElementById('CompanySize').id,'CompanySize');
        return false;
        }
        else {
        deselectField(document.getElementById('CompanySize').id);
        }

        
        //Required
        if (checkString(country,"»Country«")==false) {
        selectField(document.getElementById('country').id,'country');
        return false;
        }
        else {
        deselectField(document.getElementById('country').id);
        }


        


        


        
        //Required
        if (checkString(zip,"»Zip/Postal Code«")==false) {
        selectField(document.getElementById('zip').id,'zip');
        return false;
        }
        else {
        deselectField(document.getElementById('zip').id);
        }
        
        var ZipPostalCodeString = zip.value; 
        if (country.value=='United States' || country.value=='US'){       
            if (ZipPostalCodeString.length < 5  || ZipPostalCodeString.length > 10) {
                alert("");
                selectField(document.getElementById('zip').id,'zip');
                return false;
            }
            else {
                deselectField(document.getElementById('zip').id);
            }
        }
        if (country.value=='Canada' || country.value=='CA'){       
            if (ZipPostalCodeString.length < 6 || ZipPostalCodeString.length > 7) {
                alert("You've entered an invalid postal code. Please correct and resubmit.");
                selectField(document.getElementById('zip').id,'zip');
                return false;
            }
            else {
                deselectField(document.getElementById('zip').id);
            }
        }

        
        //Required
        if (checkString(email,"»E-mail Address«")==false) {
        selectField(document.getElementById('email').id,'email'); 
        return false;
        }
        else {
        deselectField(document.getElementById('email').id);
        }

        
        //Required
        if (checkString(ConfirmEmailAddress,"»Confirm E-mail Address«")==false) {
        selectField(document.getElementById('ConfirmEmailAddress').id,'ConfirmEmailAddress');
        return false;
        }
        else {
        deselectField(document.getElementById('ConfirmEmailAddress').id);
        }
        
        if (ConfirmEmailAddress.value!=email.value) {
        alert("The e-mail address you entered does not match the one you entered in the 'E-mail' field. Please reconfirm your e-mail address.");
        selectField(document.getElementById('ConfirmEmailAddress').id,'ConfirmEmailAddress');
        ConfirmEmailAddress.select();
        return false;
        }
        else {
        deselectField(document.getElementById('ConfirmEmailAddress').id);
        }

        
        //Required
        if (checkString(phone,"»Business Phone«")==false) {
        selectField(document.getElementById('phone').id,'phone');
        return false;
        }
        else {
        deselectField(document.getElementById('phone').id);
        }


        

    }

    //copy contents of State/Province or Region/Province/State to a single hidden Region/Province/State field for form submission
    if(thisform.StateProvince != null) {
        if(thisform.StateProvince.value != '') {
            thisform.state.value = thisform.StateProvince.value;
        }
    }    
    if(thisform.RegionProvinceState != null) {
        if(thisform.RegionProvinceState.value != '') {
            thisform.state.value = thisform.RegionProvinceState.value;
        }
    }

    //copy contents of "CompanySize" field to hidden "00N60000001SXb4" input field for SalesForce compatibility
    if(thisform.CompanySize != null) {
        if(thisform.CompanySize.value != '') {
            thisform.elements['00N60000001SXb4'].value = thisform.CompanySize.value;
        }
    }

    //populate a hidden FormURL field
    if(thisform.FormURL) thisform.FormURL.value = window.location.href;

     

      
  
}
//end
