/*
Validate Form
*/

function ValidateContactForm()
{
    var fname = document.ContactForm.FirstName;
    var lname = document.ContactForm.LastName;
    var title = document.ContactForm.Title;
    var dept = document.ContactForm.Department;
    var comp = document.ContactForm.Company;
    var street = document.ContactForm.Street_Address;
    var city = document.ContactForm.City;
    var state = document.ContactForm.State;
    var zip = document.ContactForm.ZipCode;
    var country = document.ContactForm.Country;
    var phone = document.ContactForm.Telephone;
    var email = document.ContactForm.Email;
    var ao = document.ContactForm.AO;
    var payment = document.ContactForm.Payment;

    if (fname.value == "")
    {
        window.alert("Please enter your first name.");
        fname.focus();
        return false;
    }

    if (lname.value == "")
    {
        window.alert("Please enter your last name.");
        lname.focus();
        return false;
    }

    if (title.value == "")
    {
        window.alert("Please enter your Title or Position.");
        title.focus();
        return false;
    }

    if (dept.value == "")
    {
        window.alert("Please enter your Department.");
        dept.focus();
        return false;
    }

    if (comp.value == "")
    {
        window.alert("Please enter the name of your Company.");
        comp.focus();
        return false;
    }

    if (street.value == "")
    {
        window.alert("Please enter your street address.");
        street.focus();
        return false;
    }

    if (city.value == "")
    {
        window.alert("Please enter your city.");
        city.focus();
        return false;
    }

    if (state.value == "")
    {
        window.alert("Please enter your state or province.");
        state.focus();
        return false;
    }

    if (zip.value == "")
    {
        window.alert("Please enter Postal Zip Code.");
        zip.focus();
        return false;
    }

    if (country.value == "")
    {
        window.alert("Please enter your country.");
        country.focus();
        return false;
    }

	if (phone.value == "")
	{
		window.alert("Please enter your phone number.")
		phone.focus();
		return false;
	}
    
    if (email.value == "")
    {
        window.alert("Please enter a valid E-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid E-mail address.");
        email.focus();
        return false;
    }
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid E-mail address.");
        email.focus();
        return false;
    }

    if (ao.value == "")
    {
        window.alert("Please verify indicate whether you are associated with an AO or not.");
        ao.focus();
        return false;
    }
    
    if (payment.value == "")
    {
        window.alert("Please select a payment type.");
        payment.focus();
        return false;
    }

    return true;
}