// JavaScript Document
function ValidateAppForm(){ //v2.5.2

	var theForm = document.forms['application'];
	var emailRE = /(@\w[-._\w]*\w\.\w{2,4})$/;
	var errMsg = "";
	var setfocus = "";

	if (theForm['name'].value == ""){
		errMsg = "Please tell us your name.";
		setfocus = "['name']";
	}
	if (theForm['contactName'].value == ""){
		errMsg = "Please tell us a contact name.";
		setfocus = "['contactName']";
	}
	if (theForm['contactPhone'].value == ""){
		errMsg = "Please select a contact phone number.";
		setfocus = "['contactPhone']";
	}
	if (!emailRE.test(theForm['email'].value)){
		errMsg = "Please tell us your email address.";
		setfocus = "['email']";
	}
	if (theForm['long_playing'].value == ""){
		errMsg = "Please tell us how long you have been playing.";
		setfocus = "['long_playing']";
	}
	if (theForm['num_in_group'].value == ""){
		errMsg = "Please tell us how many performers in your group.";
		setfocus = "['num_in_group']";
	}
	if (theForm['often_perform'].value == ""){
		errMsg = "Please tell us how often you perform live.";
		setfocus = "['often_perform']";
	}
	if (theForm['describe_1'].value == ""){
		errMsg = "Please tell us three words to describe your musical genre.";
		setfocus = "['describe_1']";
	}
	if (theForm['website'].value == ""){
		errMsg = "Please tell us your MySpace or website URL.";
		setfocus = "['website']";
	}
	if (theForm['city'].value == ""){
		errMsg = "Please tell us what city you are from.";
		setfocus = "['city']";
	}
	if (theForm['file_1'].value == ""){
		errMsg = "Please submit three digital recordings.";
		setfocus = "['file_1']";
	}
	if (theForm['file_2'].value == ""){
		errMsg = "Please submit three digital recordings.";
		setfocus = "['file_2']";
	}
	if (theForm['file_3'].value == ""){
		errMsg = "Please submit three digital recordings.";
		setfocus = "['file_3']";
	}
	if (!theForm['terms'].checked){
		errMsg = "You must accept the Terms and Conditions before submitting an application.";
		setfocus = "['terms']";
	}

	if (errMsg != ""){
		alert(errMsg);
		eval("theForm" + setfocus + ".focus()");
	}else{
		//show_app_info(450, 250); //show the "please wait" popup 
		theForm.submit();
	}
}

function rolloverBtn(){
	var btn = document.getElementById("submitBtn");
	btn.src = "assets/images/misc/btnGoLarge-over.gif";
}

function rolloutBtn(){
	var btn = document.getElementById("submitBtn");
	btn.src = "assets/images/misc/btnGoLarge.gif";
}
