//global site Javascript

//Advisor Form Checking
function checkAdvisorForm(){
	
	var theForm = document.advisorInquiry;
	
	if( theForm.first_name.value == ""){
		alert('Please enter your first name.');
		theForm.first_name.focus();
		return;
	}
	
	if( theForm.last_name.value == ""){
		alert('Please enter your last name.');
		theForm.last_name.focus();
		return;
	}
	
	if( theForm.contact_preference.selectedIndex == 0  && theForm.contact_phone.value == "" ){
		alert('Please enter your phone number.');
		theForm.contact_phone.focus();
		return;
	}
	
	if( theForm.contact_email.value == "" ){
		alert('Please enter your email address.');
		theForm.contact_email.focus();
		return;
	}
	
	var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	if (!re.test(theForm.contact_email.value)) {
		alert("The email address you entered does not appear to be\n" +
			"valid. Please enter your complete email address.");
		theForm.contact_email.focus();
		return false;
	}

	
	theForm.submit();
	
}

