// JavaScript Document
function validateBackstagers() {
	msg = "";
	//Check for invalid characters in the user provided E-mail address
	for (i=0; i<document.form1.email.value.length; i++) {
		ch = document.form1.email.value.charAt(i);
		if (ch == '.') continue;
		if (ch == '-') continue;
		if (ch == '_') continue;
		if (ch == '@') continue;
		if (ch >= '0' && ch <= '9') continue;
		if (ch >= 'A' && ch <= 'Z') continue;
		if (ch >= 'a' && ch <= 'z') continue;
		msg = "E-mail address contains an invalid char: " + ((ch == ' ') ? "space" : ((ch >= '!' && ch <= '~') ? ch : "control character"));
		alert(msg);
		return false;
	}
	atIndex = document.form1.email.value.indexOf("@",0);
	periodIndex = document.form1.email.value.indexOf(".",0);
	if (atIndex < 1 ||
		atIndex + 3 >= document.form1.email.value.length ||
		periodIndex <= atIndex + 1 ||
		periodIndex + 1 >= document.form1.email.value.length) {
		msg = "E-mail address is invalid.";
	} else if (document.form1.contributionType.selectedIndex <= 0) {
		msg = "Please select the type of contribution in the Tax Deduductible contribution drop down list.";
    } else if (document.form1.contributionLevel.selectedIndex <= 0) {
		msg = "Please select the amount to contribute in the Level drop down list.";
	} else if (document.form1.contributionLevel.selectedIndex == 9 && document.form1.other.value == "") {
		msg = "When selecting a contribution level of Other, please\nenter an amount in the Other Amount field.";
	} else if (document.form1.contributionLevel.selectedIndex == 9 && document.form1.other.value <= 0) {
		msg = "When selecting a contribution level of Other, please\nenter an amount in the Other Amount field greater than zero.";
	} else if (document.form1.contributionLevel.selectedIndex != 9 && document.form1.other.value != "") {
		msg = "When entering an amount in the Other Amount field, please\nselect Other in the Contribution Level drop down list.";
	} else if (document.form1.cardType.selectedIndex <= 0) {
		msg = "Please select the type of credit card.";
	}
	if (msg == "") {
		return true;
	} else {
		alert(msg);
		return false;
	}
}