
var capPass = 0;

function tipper(tipid,actioner,value){if(actioner=='show'){document.getElementById(tipid).innerHTML=value;document.getElementById(tipid).style.display='block';}
if(actioner=='hide'){document.getElementById(tipid).innerHTML='';document.getElementById(tipid).style.display='none';}}


function validateRequestInfo2(){
	var starter=document.ri2;
	capC = $("#recaptcha_challenge_field").val();
	capR = $("#recaptcha_response_field").val();
	$.post('/captcha_checker.php', { 'recaptcha_challenge_field': capC, 'recaptcha_response_field': capR}, function(data){
		//alert(capPass);
		if(capPass != 'y'){
			if(data == 0){
				alert("Captcha Code Incorrect.");
				capPass = 'n';
				Recaptcha.reload();
				return 0;
			} else {
				capPass = 'y';
			}
		}
	if(starter.name.value==''){alert("Please enter your name.");starter.name.focus();return 0;}
	if(starter.address.value==''){alert("Please enter your street address.");starter.address.focus();return 0;}
	if(starter.city.value==''){alert("Please enter your city name.");starter.city.focus();return 0;}
	if(starter.state.selectedIndex==0){alert("Please select your state.");starter.state.focus();return 0;}
	if(starter.zip.value==''){alert("Please enter your zip code.");starter.zip.focus();return 0;}
	if(starter.phone.value==''){alert("Please enter your home phone number.");starter.phone.focus();return 0;}
	if(starter.cellphone.value==''){alert("Please enter your cell phone number.");starter.cellphone.focus();return 0;}
	if(starter.time.selectedIndex==0){alert("Please select the best time to reach you.");starter.time.focus();return 0;}
	if(starter.email.value==''){alert("Please enter your email address.");starter.email.focus();return 0;}else{var str=starter.email.value;var re=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;if(!str.match(re)){alert("Your email address is invalid. Please verify that you have entered it correctly.");starter.email.focus();return 0;}}
	if(starter.highschool.value==''){alert("Please enter your high school attended.");starter.highschool.focus();return 0;}
	if (starter.hsgrad.value == '  High School Graduation Year'){
			alert("Please enter your graduation year.");
			starter.hsgrad.focus();
			return 0;
	}
	if(starter.campus.selectedIndex==0){alert("Please select a campus.");starter.campus.focus();return 0;}
	starter.submit();	
	});
}

function validateRequestInfo(){
	var starter=document.ri;
	if(starter.name.value==''){alert("Please enter your name.");starter.name.focus();return 0;}
	if(starter.address.value==''){alert("Please enter your street address.");starter.address.focus();return 0;}
	if(starter.city.value==''){alert("Please enter your city name.");starter.city.focus();return 0;}
	if(starter.state.selectedIndex==0){alert("Please select your state.");starter.state.focus();return 0;}
	if(starter.zip.value==''){alert("Please enter your zip code.");starter.zip.focus();return 0;}
	if(starter.phone.value==''){alert("Please enter your home phone number.");starter.phone.focus();return 0;}
	if(starter.cellphone.value==''){alert("Please enter your cell phone number.");starter.cellphone.focus();return 0;}
	if(starter.time.selectedIndex==0){alert("Please select the best time to reach you.");starter.time.focus();return 0;}
	if(starter.email.value==''){alert("Please enter your email address.");starter.email.focus();return 0;}else{var str=starter.email.value;var re=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;if(!str.match(re)){alert("Your email address is invalid. Please verify that you have entered it correctly.");starter.email.focus();return 0;}}
	if(starter.highschool.value==''){alert("Please enter your high school attended.");starter.highschool.focus();return 0;}
	if(starter.hsgrad.selectedIndex==0){alert("Please select your graduation year.");starter.hsgrad.focus();return 0;}
	if(starter.campus.selectedIndex==0){alert("Please select a campus.");starter.campus.focus();return 0;}
	starter.submit();
}

function validateApply(){
	var starter=document.apply;
	if(starter.name1.value=="  First Name"){alert("Please enter your first name.");starter.name1.focus();return 0;}
	if(starter.name2.value=="  Last Name"){alert("Please enter your last name.");starter.name2.focus();return 0;}
	if(starter.address.value=="  Street Address"){alert("Please enter your street address.");starter.address.focus();return 0;}
	if(starter.city.value=="  City"){alert("Please enter your city name.");starter.city.focus();return 0;}
	if(starter.zip.value=="  Zip"){alert("Please enter your zip code.");starter.zip.focus();return 0;}
	if(starter.phone1.value=="  Daytime Phone"){alert("Please enter your daytime phone number.");starter.phone1.focus();return 0;}
	if(starter.phone2.value=="  Evening Phone"){alert("Please enter your evening phone number.");starter.phone2.focus();return 0;}
	if(starter.phone3.value=="  Cell Phone"){alert("Please enter your cell phone number.");starter.phone3.focus();return 0;}
	if(starter.dob.value=="  Date of Birth"){alert("Please enter your Date of Birth.");starter.dob.focus();return 0;}
	if(starter.ssn.value=="  Social Security Number"){alert("Please enter your Social Security number.");starter.ssn.focus();return 0;}
	if(starter.high.value=="  High School Attended"){alert("Please enter your high school attended.");starter.high.focus();return 0;}
	if(starter.email.value=="  E-mail"){alert("Please enter your email address.");starter.email.focus();return 0;}
	else{var str=starter.email.value;var re=/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;if(!str.match(re)){alert("Your email address is invalid. Please verify that you have entered it correctly.");starter.email.focus();return 0;}}
	if(starter.hsgrad.selectedIndex==0){alert("Please select your graduation year.");starter.hsgrad.focus();return 0;}
	if(starter.interest.selectedIndex==0){alert("Please select your program of interest.");starter.interest.focus();return 0;}
	starter.submit();
}


var is={ie:navigator.appName=='Microsoft Internet Explorer',java:navigator.javaEnabled(),ns:navigator.appName=='Netscape',ua:navigator.userAgent.toLowerCase(),version:parseFloat(navigator.appVersion.substr(21))||parseFloat(navigator.appVersion),win:navigator.platform=='Win32'}
is.mac=is.ua.indexOf('mac')>=0;if(is.ua.indexOf('opera')>=0){is.ie=is.ns=false;is.opera=true;}
if(is.ua.indexOf('gecko')>=0){is.ie=is.ns=false;is.gecko=true;}
