// JavaScript Document

// -- Validate support form ------------------------------------------------
function validateSupport(){
	
	var formProblem = 0;
	var otherWrong = 0;
	var alertText = "Please enter:\n";
	
	if(document.forms.contactForm.contactName.value == ""){
		formProblem = 1;
		otherWrong = 1;
		alertText = alertText + "A name\n";
	}
	if(document.forms.contactForm.contactEmail.value == ""){
		formProblem = 1;
		otherWrong = 1;
		alertText = alertText + "An email address\n";
	}
	if(document.forms.contactForm.contactAddress.value == ""){
		formProblem = 1;
		otherWrong = 1;
		alertText = alertText + "An address\n";
	}
	if(document.forms.contactForm.artTitle.value == ""){
		formProblem = 1;
		otherWrong = 1;
		alertText = alertText + "The title of the piece\n";
	}
	if(document.forms.contactForm.artDesc.value == ""){
		formProblem = 1;
		otherWrong = 1;
		alertText = alertText + "The description of the piece\n";
	}
	if(document.forms.contactForm.artPrice.value == ""){
		formProblem = 1;
		otherWrong = 1;
		alertText = alertText + "The price of the piece\n";
	}
	if(document.forms.contactForm.iAgree.checked == false){
		formProblem = 1;
		if(otherWrong == 0){
			alertText = "Please click 'I agree to the terms'\n";
		}else{
			alertText = alertText + "\n\nPlease click 'I agree to the terms'\n";
		}
	}
	
	if(formProblem == 1){
		alert(alertText);
		return false;
	}
}
// -------------------------------------------------------------------------