function courseCode(){
	document.courseNum.submit();
}

// validate application request form
function ValidateVetApply() {
	var emailID=document.vet_apply.email;
	var emailcheck=document.vet_apply.email.value;
	
	//student validation
	// first name	
	if (document.courseNum.AdProgramVersionID.value=="") {
		document.courseNum.AdProgramVersionID.focus();
		alert('You must select a course number.');
		return false; 
	}
	// first name	
	if (document.vet_apply.firstName.value=="") {
		document.vet_apply.firstName.focus();
		alert('Please enter your first name.');
		return false; 
	}
	// last name	
	if (document.vet_apply.lastName.value=="") {
		document.vet_apply.lastName.focus();
		alert('Please enter your last name.');
		return false; 
	}
	// address1
	if (document.vet_apply.address1.value=="") {
		document.vet_apply.address1.focus();
		alert('Please enter your address.');
		return false; 
	}
	// city
	if (document.vet_apply.city.value=="") {
		document.vet_apply.city.focus();
		alert('Please enter your city.');
		return false; 
	}
	// state
	if (document.vet_apply.state.value=="") {
		document.vet_apply.state.focus();
		alert('Please select your state.');
		return false; 
	}
	// zip
	if (document.vet_apply.zip.value=="") {
		document.vet_apply.zip.focus();
		alert('Please enter your postal code.');
		return false; 
	}
	// home phone1
	if (document.vet_apply.phoneHome1.value=="") {
		document.vet_apply.phoneHome1.focus();
		alert('Please enter your home phone number.');
		return false;
	}
	// home phone2
	if (document.vet_apply.phoneHome2.value=="") {
		document.vet_apply.phoneHome2.focus();
		alert('Please enter your home phone number.');
		return false;
	}
	// home phone3
	if (document.vet_apply.phoneHome3.value=="") {
		document.vet_apply.phoneHome3.focus();
		alert('Please enter your home phone number.');
		return false;
	}
	// email
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please enter your email address.")
		emailID.focus()
		return false;
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false;
	}
	// height
	if (document.vet_apply.height.value=="") {
		document.vet_apply.height.focus();
		alert('Please enter your height.');
		return false;
	}
	// weight
	if (document.vet_apply.weight.value=="") {
		document.vet_apply.weight.focus();
		alert('Please enter your weight.');
		return false;
	}
	//gender
	var genderSelected = false;
	for (i = 0;  i < document.vet_apply.gender.length;  i++) {
		if (document.vet_apply.gender[i].checked)
	    genderSelected = true;
	}
	if (!genderSelected){
	    alert('Please select your gender');
	    return (false);
	}
	//alumnus
	var alumnusSelected = false;
	for (i = 0;  i < document.vet_apply.alumnus.length;  i++) {
		if (document.vet_apply.alumnus[i].checked)
	    alumnusSelected = true;
	}
	if (!alumnusSelected){
	    alert('Are you an Outward Bound Alumnus?');
	    return (false);
	}
	// military status
	if (document.vet_apply.military_status.value=="") {
		document.vet_apply.military_status.focus();
		alert('Please enter your military status.');
		return false;
	}
	// deploy
	if (document.vet_apply.deploy.value=="") {
		document.vet_apply.deploy.focus();
		alert('Did you deploy in support of combat operations in OEF or OIF?');
		return false;
	}
	// job description
	if (document.vet_apply.job_description.value=="") {
		document.vet_apply.job_description.focus();
		alert('What was/is your military job description?');
		return false;
	}
	//recent deploy
	var deploySelected = false;
	for (i = 0;  i < document.vet_apply.recent_deployment.length;  i++) {
		if (document.vet_apply.recent_deployment[i].checked)
	    deploySelected = true;
	}
	if (!deploySelected){
	    alert('Please tell us about your most recent deployment');
	    return (false);
	}
	//decoration
	var awardSelected = false;
	for (i = 0;  i < document.vet_apply.award.length;  i++) {
		if (document.vet_apply.award[i].checked)
	    awardSelected = true;
	}
	if (!awardSelected){
	    alert('Have you been decorated for direct combat action?');
	    return (false);
	}
	// deploy area
	if (document.vet_apply.area.value=="") {
		document.vet_apply.area.focus();
		alert('What was your specific overseas area of operation?');
		return false;
	}
	// rank
	if (document.vet_apply.rank.value=="") {
		document.vet_apply.rank.focus();
		alert('What was your highest rank during your most recent deployment?');
		return false;
	}
	return true
}

function StudentReview() {
	//student select
	var studentSelected = false;
	for (i = 0;  i < document.studentReview.SyStudentID.length;  i++) {
		if (document.studentReview.SyStudentID[i].checked)
	    studentSelected = true;
	}
	if (!studentSelected){
	    alert('Please select an option');
	    return (false);
	}
}

// email validation
function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid E-mail")
	   return false
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid E-mail")
	   return false
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    alert("Invalid E-mail")
	    return false
	}
	 if (str.indexOf(at,(lat+1))!=-1){
	    alert("Invalid E-mail")
	    return false
	 }
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    alert("Invalid E-mail")
	    return false
	 }
	 if (str.indexOf(dot,(lat+2))==-1){
	    alert("Invalid E-mail")
	    return false
	 }
	 if (str.indexOf(" ")!=-1){
	    alert("Invalid E-mail")
	    return false
	 }
 	 return true
}