// Top bar code
/*
$(document).ready(function (){
	$("#res").hide();
	$("#btn_resources").click(function () {
		$("#res").slideToggle("slow");
		$(this).toggleClass("active");
		return false;
	});
	$('a#btn_chat').hover(function() {
		var currentImg = $('#icon_chat').attr('src');
		$('#icon_chat').attr('src', $('#icon_chat').attr('hover'));
		$('#icon_chat').attr('hover', currentImg);
		$("#btn_chat").stop();
		$("#btn_chat").animate({ 
			width: "70px"
      	}, 150 );
	}, function() {
		var currentImg = $('#icon_chat').attr('src');
		$('#icon_chat').attr('src', $('#icon_chat').attr('hover'));
		$('#icon_chat').attr('hover', currentImg);
		$("#btn_chat").stop();
		$("#btn_chat").animate({ 
			width: "28px"
      	}, 150 );
	});
});
*/

var options = Array();
	options["undergraduate"] = ['Applied Behavioral Sciences', 'Biology', 'Business Administration', 'Early Childhood Education', 'Early Childhood Practice', 'Elementary Education', 'English', 'Health Care Leadership', 'Human Services', 'Liberal Arts Studies', 'Management Information Systems', 'Management', 'Mathematics/Quantitative Studies', 'Political Science', 'Psychology', 'Social Science'];
	options["graduate"] = ['Administration and Supervision', 'Adult Education', 'Counseling', 'Curriculum and Instruction', 'Early Childhood Administration', 'Early Childhood Education', 'Early Childhood Practicing Professional Certification', 'Educational Psychology', 'Elementary Education', 'Health Services Administration', 'Human Resource Management & Development', 'Interdisciplinary Studies in Curriculum & Instruction', 'Language and Literacy', 'Library Information Specialist Endorsement', 'Management', 'Master of Business Administration', 'Mathematics Education', 'Middle Level Education', 'Progressive Leadership for Labor in Education', 'Psychology', 'Public Policy', 'Reading', 'Reading and Language', 'School Psychology', 'Secondary Education', 'Special Education', 'Subsequent Illinois Certification', 'Technology in Education', 'Written Communication'];
	options["doctoral"] = ['Adult Education', 'Community Psychology', 'Community College Leadership', 'Curriculum and Social Inquiry', 'Disability and Equity in Education', 'Educational Leadership', 'Educational Psychology', 'Reading and Language'];

function setOptions(obj) {
	var oTarget = document.getElementById('ddlProgramInterest');
		oTarget.options.length = 0;
		oTarget.options[0] = new Option('Please Select a Program of Interest', '');
	var aOptions = options[obj[obj.selectedIndex].value];

	for(var i=0; i<aOptions.length; i++) {
		oTarget.options[i+1] = new Option(aOptions[i], aOptions[i]);
	}
}

var email_re = /^[\w-\.]+@[\w\.-]+[\.]{1}[\w]{2,3}$/;
function validate(form) {
	if(form.elements['txtFirstName'].value == '') {
		alert('Please indicate your first name before proceeding');
		form.elements['txtFirstName'].focus();
		return false;
	}
	if(form.elements['txtLastName'].value == '') {
		alert('Please indicate your last name before proceeding');
		form.elements['txtLastName'].focus();
		return false;
	}
	if(form.elements['txtAddress'].value == '') {
		alert('Please indicate your address before proceeding');
		form.elements['txtAddress'].focus();
		return false;
	}
	if(form.elements['txtCity'].value == '') {
		alert('Please indicate your city before proceeding');
		form.elements['txtCity'].focus();
		return false;
	}
	if(form.elements['ddlState'].selectedIndex == 0) {
		alert('Please indicate your state before proceeding');
		form.elements['ddlState'].focus();
		return false;
	}
	if(form.elements['txtZip'].value == '') {
		alert('Please indicate your zip before proceeding');
		form.elements['txtZip'].focus();
		return false;
	}
	if(form.elements['txtEmail'].value == '' || !email_re.test(form.elements['txtEmail'].value)) {
		alert('Please provide a valid email address before proceeding');
		form.elements['txtEmail'].focus();
		return false;
	}
	if(form.elements['ddlEducationLevel'].selectedIndex == 0) {
		alert("Please indicate the level of education which you have completed before proceeding");
		form.elements['ddlEducationLevel'].focus();
		return false;
	}
	if(form.elements['ddlAreaInterest'].selectedIndex == 0) {
		alert("Please indicate your degree level of interest before proceeding");
		form.elements['ddlAreaInterest'].focus();
		return false;
	}

	
	/*if(form.elements['chkInfoSession_Register'].checked && form.elements['ddlInfoSession_ID'].selectedIndex == 0) {
		alert("Please indicate which Information Session you would like to register for before proceeding");
		form.elements['chkInfoSession_Register'].focus();
		return false;
	}*/
	
	
	if(form.elements['ddlProgramInterest'].selectedIndex == 0) {
		alert("Please indicate your program of interest before proceeding");
		form.elements['ddlProgramInterest'].focus();
		return false;
	}

	return true;
}
