// JavaScript Document

function addOption(selectbox,text,value ){
	var optn = document.createElement("option");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}	
function toggleDates(val){
	e = document.getElementById('start_date_00NA0000001a2d5');
	e.options.length = 0;

	addOption(e, 'None', '');

	if(val.value=="Cosmetology"){
		for(var i=0;i<cosmoDates.length;i++){
			addOption(e, cosmoDates[i], cosmoDates[i]);
		}
	}
	if(val.value=="Skin Therapy"){
		for(var i=0;i<skinDates.length;i++){
			addOption(e, skinDates[i], skinDates[i]);
		}
	}
}
function toggleSearch(val){
	if(val.value=="Online Research"){
		document.getElementById('sel_search').style.display = 'block';
		document.getElementById('00NA0000001Y0gc').focus();
	}else{
		document.getElementById('sel_search').style.display = 'none';
	}
	
}
function validate_app_form(myForm){
	var error = "";

	if(myForm['first_name'].value==""){
		error += "Please tell us your first name.\n";
	}
	if(myForm['last_name'].value==""){
		error += "Please tell us your last name.\n";
	}
	if(myForm['email'].value==""){
		error += "Please tell us your email address.\n";
	}
	if(myForm['00NA0000001XLav'].value==""){
		error += "Please tell us your age.\n";
	}
	if(myForm['phone'].value==""){
		error += "Please tell us your daytime phone number.\n";
	}
	if(myForm['street'].value==""){
		error += "Please tell us your address.\n";
	}
	if(myForm['city'].value==""){
		error += "Please tell us what city you live in.\n";
	}
	if(myForm['state'].value==""){
		error += "Please tell us what state you live in.\n";
	}
	if(myForm['zip'].value==""){
		error += "Please tell us your zip code.\n";
	}
	if(myForm['start_date_00NA0000001a2d5'].value=="" && myForm['program_00NA0000001XLbK'].value!="Educator Training"){
		error += "Please tell us your potential start date.\n";
	}
	if(myForm['00NA0000001XLbK'].value==""){
		error += "Please tell us which career area interests you most.\n";
	}
	if(myForm['00NA0000001XLci'].value==""){
		error += "Please tell us your highest level of education.\n";
	}
	
	
	if(myForm['request'].value==""){
		error += "Please tell us the nature of your request.\n";
	}

	if(error!=""){
		alert(error);
		return false;
	}else{
		if(myForm['emaillist']!=null){
			
		}
		
		return true;
	}
}
