function CheckForm () {

    //Intialise variables
    var errorMsg = "";
    var errorMsgLong = "";

    //Check for a firstname
    if (document.contactform.realname.value == ""){
        errorMsg += "\n\tName \t\t\t- Enter your first name please";
    }
    
    //Check for a email address
    if (document.contactform.email.value == ""){
        errorMsg += "\n\tEmail \t\t\t- Enter your email address please";
    }
    //Check for at least one line in the billing address
    if (document.contactform.address1.value == ""){
        errorMsg += "\n\tAddress \t\t\t- Enter an address Please";
    }
    //Check for a town or city
    if (document.contactform.town.value == ""){
        errorMsg += "\n\tTown/City \t\t- Enter a towm/city Please";
    }
    //Check for a county
    if (document.contactform.county.value == ""){
        errorMsg += "\n\tCounty \t\t\t- Enter your county Please";
    }
    //Check for details entered
   if (document.contactform.enquiry.value == ""){
       errorMsg += "\n\tEnquiry \t\t\t- Enter your enquiry Please";
    }
    
    //If there is a problem with the form then display an error
    if ((errorMsg != "") || (errorMsgLong != "")){
        msg = "___________________________________________________________________\n\n";
        msg += "Your details have not been added because you have not filled in all of the required fields in the form.\n";
        msg += "Please enter your details and re-submit the form.\n";
        msg += "___________________________________________________________________\n\n";
        msg += "The following field(s) need to be corrected: -\n";
        
        errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
        return false;
    }
    
    return true;
}


