<!--

function getElement(f, clientID, name){
    return f.elements[clientID + ":" + name];
}

function checkWhitespace(f, clientID, name, text){
    var t = getElement(f, clientID, name);
    if (isWhitespace(t.value)){
        alert("Please complete the " + text + " field.");
        t.focus();
        return true;
    }    
    return false;
}

function checkContactUs(f, clientID){
	var formType=f.formType.value;
	switch(formType)
		{
		case "ContactUs":
			return checkContactForm(f,clientID);
		case "GotWood":
			return checkGotWood(f,clientID);
		case "PledgeRequestForm":
			return checkPledgeRequestForm(f,clientID);
		default: return true;
		
		}
	}

function checkContactForm(f, clientID){    
	if (checkWhitespace(f, clientID, "FirstNameTextBox", "First Name")){
        return false;
    }
    if (checkWhitespace(f, clientID, "LastNameTextBox", "Last Name")){
        return false;
    }
    if (checkWhitespace(f, clientID, "Address1TextBox", "Address")){
        return false;
    }
    if (checkWhitespace(f, clientID, "CityTextBox", "City")){
        return false;
    }
    if (checkWhitespace(f, clientID, "ZipCodeTextBox", "ZIP Code")){
        return false;
    }
    if (checkWhitespace(f, clientID, "CountryTextBox", "Country/Region")){
        return false;
    }
    var t = getElement(f, clientID, 'EMailTextBox');
    if (isWhitespace(t.value) || !isEmail(t.value)){
	    alert("Please provide a valid e-mail address");
        t.focus();
        return false;
    }    
    return true;
}

function checkGotWood(f, clientID){    
    if (checkWhitespace(f, clientID, "FirstNameTextBox", "First Name")){
        return false;
    }
    if (checkWhitespace(f, clientID, "LastNameTextBox", "Last Name")){
        return false;
    }
    if (checkWhitespace(f, clientID, "Address1TextBox", "Address")){
        return false;
    }
    if (checkWhitespace(f, clientID, "CityTextBox", "City")){
        return false;
    }
    if (checkWhitespace(f, clientID, "ZipCodeTextBox", "ZIP Code")){
        return false;
    }
    if (checkWhitespace(f, clientID, "CountryTextBox", "Country/Region")){
        return false;
    }
    var t = getElement(f, clientID, 'EMailTextBox');
    if (isWhitespace(t.value) || !isEmail(t.value)){
	    alert("Please provide a valid e-mail address");
        t.focus();
        return false;
    }    
    return true;
}
//-->
