function checkForm(formName) {
    var error = '';
    if (formName=='contacts') {
        if (document.forms['contacts'].firstname.value == '') { error = "\r\n firstname"}
        if (document.forms['contacts'].surname.value == '') { error += "\r\n surname"}
        if (document.forms['contacts'].email_address.value == '') { error += "\r\n email"}
        if (document.forms['contacts'].phone.value == '') { error += "\r\n phone"}
        if (document.forms['contacts'].company.value == '') { error += "\r\n company"}
        if (document.forms['contacts'].message.value == '') { error += "\r\n message"}
        myForm = document.forms['contacts'];
    }
    
    if (formName=='distributor') {
        if (document.forms['distributor'].firstname.value == '') { error = "\r\n firstname"}
        if (document.forms['distributor'].surname.value == '') { error += "\r\n surname"}
        if (document.forms['distributor'].email.value == '') { error += "\r\n email"}
        if (document.forms['distributor'].phone.value == '') { error += "\r\n phone"}
        if (document.forms['distributor'].company.value == '') { error += "\r\n company"}
        if (document.forms['distributor'].facsimile.value == '') { error += "\r\n facsimile"}
        if (document.forms['distributor'].address.value == '') { error += "\r\n address"}
        if (document.forms['distributor'].city.value == '') { error += "\r\n city"}
        if (document.forms['distributor'].state.value == '') { error += "\r\n state"}
        if (document.forms['distributor'].zipcode.value == '') { error += "\r\n zipcode"}
        if (document.forms['distributor'].message.value == '') { error += "\r\n message"}
        myForm = document.forms['distributor'];        
    }
    
    if (formName=='ask') {
        if (document.forms['ask'].firstname.value == '') { error = "\r\n firstname"}
        if (document.forms['ask'].surname.value == '') { error += "\r\n surname"}
        if (document.forms['ask'].email.value == '') { error += "\r\n email"} 
        if (document.forms['ask'].phone.value == '') { error += "\r\n phone"}
        if (document.forms['ask'].company.value == '') { error += "\r\n company"}
        if (document.forms['ask'].message.value == '') { error += "\r\n details of wear problem"}
        myForm = document.forms['ask'];      
    }
    
    if (error) { 
        alert ("Please fill in these fields:\r\n "+error); 
    } else {
       myForm.submit();
    }
    
}
