/*
 var spamQuestion = new Array();

spamQuestion[spamQuestion.length] = {	question: "13 + 7 = ", 
										answer: "20" };

spamQuestion[spamQuestion.length] = {	question: "10 &#8212; 2 = ", 
										answer: "8" };

spamQuestion[spamQuestion.length] = {	question: "8 + 15 = ", 
										answer: "23" };

spamQuestion[spamQuestion.length] = {	question: "11 + 3 = ", 
										answer: "14" };

spamQuestion[spamQuestion.length] = {	question: "9 + 9 = ", 
										answer: "18" };

spamQuestion[spamQuestion.length] = {	question: "24 &#8212; 5 = ", 
										answer: "19" };

spamQuestion[spamQuestion.length] = {	question: "17 &#8212; 6 = ", 
										answer: "11" };

function printQuestion() {
	var currIndex = Math.floor(Math.random() * (spamQuestion.length));
	var output = '<p align="center">Security Question: &nbsp; ' + spamQuestion[currIndex].question +
				' <input type="text" name="CBFA254B12B71BF812FE414890DC7290" id="CBFA254B12B71BF812FE414890DC7290" size="5" /></p>';
	output += ' <input type="hidden" name="spamTestQuestionNumber" id="spamTestQuestionNumber" value="' + currIndex + '" class="field" tabindex="7" /></p>';
    document.write(output); 
}

*/


function MM_validateForm() {
	var thisForm = document.forms.IWLPForm;
	var errorMessage = "";
	thisForm.action = "http://internationalwaterlaw.org/admin/CA6CD0C85EF3326162E7CD56D0828E45.php";
	thisForm.method = "post";

	errorMessage = checkTextBoxes();
	errorMessage += checkTextarea();
	/* errorMessage += checkRadio(); */
	/* errorMessage += checkSpamAnswer(); */ 
	
	if(errorMessage.length == 0) {
		thisForm.submit();
	}
	else {
		alert(errorMessage);
	}
}

/*
function checkSpamAnswer() {
	var errorMessage = "";
	if( ! getAnswer()) {
		errorMessage = "Please answer the Security Question.\n";
	}
	return errorMessage;
}
*/

function checkTextBoxes() {
	var errorMessage = "";
	var thisForm = document.forms.IWLPForm;
	if (thisForm.B340F0B0C2E6545EDACBDBF0DEE527BC.value.length < 2) {
	    errorMessage += "Please enter your name.\n";
	}
	if (thisForm.E5170B8D4B428B2154EB32695578A9AF.value.length < 4) {
	    errorMessage += "Please enter your email address\n";
	}
	return errorMessage;
}

function checkTextarea() {
	var errorMessage = "";
	var thisForm = document.forms.IWLPForm;
	if (thisForm.D51B66AFE6ED334485CECC2DFDE89D2D.value.length < 10) {
	    errorMessage += "Please enter a comment or question (10 character minimum).\n";
    }
	return errorMessage;
}



/* 
function displayCleCheckbox(freeorpro) {
	var cleEnclosureBox = document.getElementById("law_faculty_cle_check");
	var cleCheckBox = document.getElementById("law_faculty_cle_ckbox");

	if(freeorpro == "free") {
		cleEnclosureBox.style.display = 'block';
	}
	else if(freeorpro == "pro") {
 		cleEnclosureBox.style.display = 'none';
		cleCheckBox.checked = false;
	}
}
*/

/*
function displayGuestName() {

	var nameOfGuestContainer = document.getElementById("name_of_guest_container");
	var nameOfGuest = document.getElementById("name_of_guest");
	var dinnerAmount = document.getElementById("dinner_amount");

	if(dinnerAmount.checked == true) {
		nameOfGuestContainer.style.display = 'block';
	}

	else if(dinnerAmount.checked == false) {
 		nameOfGuestContainer.style.display = 'none';
		name_of_guest.value = "";
	}
}

function displayRequestBothMaterials() {
	var bothMaterialsOptionContainer = document.getElementById("bothMaterialsOptionContainer");
	var reg_amount_400 = document.getElementById("reg_amount_400");
	var bothMaterialsAmount = document.getElementById("bothMaterialsAmount");

	if(reg_amount_400.checked == true) {
		bothMaterialsOptionContainer.style.display = 'block';
	}

	else if(reg_amount_400.checked == false) {
 		bothMaterialsOptionContainer.style.display = 'none';
		bothMaterialsAmount.checked = false;
	}
}
*/

/*
function displayHowDidYouHearOther(sttus) {
	var heardOtherEnclosureBox = document.getElementById("heard_about_symposium_other_container");
	var heardOtherCheckBox = document.getElementById("heard_about_symposium_other");
	var heard_about_symposium_other_text = document.getElementById("heard_about_symposium_other_text");

	if(heardOtherCheckBox.checked == true) {
		heardOtherEnclosureBox.style.display = 'block';
	}

	else if(heardOtherCheckBox.checked == false) {
 		heardOtherEnclosureBox.style.display = 'none';
		heard_about_symposium_other_text.value = "";
	}
}
*/

