function checkForm()
{
	var mf = document.findform;
    if (mf.FirstName.value.length < 2) {
        alert("Please enter your first name");
        mf.FirstName.focus(); return false;
    }
    if (mf.LastName.value.length < 2) {
        alert("Please enter your last name");
        mf.LastName.focus(); return false;
    }
/*
    if (mf.JobTitle.value.length < 2) {
        alert("Please enter your job title.");
        mf.JobTitle.focus(); return false;
    }
*/
    if (mf.Email.value.length > 0) {
        if (!isValidEmail(mf.Email.value)) {
            alert("Please make sure your email address is formatted correctly (e.g. joe@gateway.com)");
            mf.Email.focus(); return false;
        }
    } else {
        alert("Please enter your email address.");
        mf.Email.focus(); return false;
    }
    if (mf.Phone.value.length > 0) {
        if (!isNumeric(mf.Phone.value)) {
            alert("Please use only numerical digits for phone number.");
            mf.Phone.focus(); return false;
        }
    } else {
        alert("Please enter your phone number.");
        mf.Phone.focus(); return false;
    }
    if (mf.Phone.value.length > 0) {
        if (!isNumeric(mf.Phone.value)) {
            alert("Please enter your company phone number.");
            mf.Phone.focus(); return false;
        }
    } else {
        alert("Please enter your company phone number.");
        mf.Phone.focus(); return false;
    }
    if (mf.CoName.value.length < 3) {
        alert("Please enter the name of your company.");
        mf.CoName.focus(); return false;
    }
    if (mf.Address.value.length < 6) {
        alert("Please enter your company's street address.");
        mf.Address.focus(); return false;
    }
    if (mf.City.value.length < 3) {
        alert("Please enter the city your company is located in.");
        mf.City.focus(); return false;
    }
    if (mf.Prov.value.length < 2) {
        alert("Please enter the state or province your company resides in.");
        mf.Prov.focus(); return false;
    }
    if (mf.Postal.value.length < 5) {
        alert("Please enter the postal code or ZIP for your company.");
        mf.Postal.focus(); return false;
    }
    if (mf.Countries.value == 0) {
        alert("Please enter the country your company is located in.");
        mf.Countries.focus(); return false;
    }

    if (mf.Industry.selectedIndex == 0) {
        alert("Please enter your industry.");
        mf.Industry.focus(); return false;
    }

// Number of Employyes    
    var val = 0;
    for (var i=0; i<mf.EmpTotal.length; i++) {
        if (mf.EmpTotal[i].checked) { val += mf.EmpTotal[i].value; }
    }
    if (!val || val < 0) {
        alert("Please specify the number of employees at your company.");
        mf.totemps.focus(); return false;
    }

// Check one of more interested products
    val='';
    for (var i=0; i<mf.Interests.length; i++) {
        if (mf.Interests[i].checked) { val = mf.Interests[i].value; }
    }
    if (!val) {
        alert("Please specify the products you company is interested in.");
        mf.nbInt.focus(); return false;
    }

    // Spam checks
    if (mf.FirstName.value === mf.JobTitle.value || mf.FirstName.value === mf.LastName.value)
        { return false; }


    return true;    // return a true value if no errors are found
}

// function parameters are: field - the string field, count - the field for remaining
// characters  number and max - the maximum number of characters  
function charcount () 
{
    var max = 1000;
    var left = 0;
	var text = document.findform.Reqd;
    if (text.value.length > max)
        { text.value = text.value.substring(0, max); }
    else 
        { left = max - text.value.length; }
	document.getElementById('numleft').innerHTML = left;
}
