function help(num){
var helpdiv = document.getElementById("helpdiv");
if(num==1){
helpdiv.innerHTML = "<i>Student Number</i> - Applies to multiple children enrolled in the Academy from the same household.";
}
else if(num==2){
helpdiv.innerHTML = "<i>Ministry Discount</i> - Applies to students who have one or more parents employed full-time in the ministry.";
}
else if(num==3){
helpdiv.innerHTML = "<i>Member Discount</i> - Applies to members of Emmanuel Baptist Church.";
}
else if(num==4){
helpdiv.innerHTML = "<i>Full Payment Discount</i> - Available to those who pay entire year tuition in full or in two payments.";
}

}


function Continue(){

var no_of_studentsind = document.getElementById("no_of_students").selectedIndex;
var no_of_students = document.getElementById("no_of_students").options[no_of_studentsind].value;
var ministry_discountind = document.getElementById("ministry_discount").selectedIndex;
var ministry_discount = document.getElementById("ministry_discount").options[ministry_discountind].value;
var member_discountind = document.getElementById("member_discount").selectedIndex;
var member_discount = document.getElementById("member_discount").options[member_discountind].value;
var full_payment_discountind = document.getElementById("full_payment_discount").selectedIndex;
var full_payment_discount = document.getElementById("full_payment_discount").options[full_payment_discountind].value;

//document.getElementById("steptwo").innerHTML="One Moment . . .";
var url = 'tuition_continue.php?no_of_students='+no_of_students;;
new ajax (url, {method: "get", update: $('steptwo')});

}

function Calculate(){

var no_of_studentsind = document.getElementById("no_of_students").selectedIndex;
var no_of_students = document.getElementById("no_of_students").options[no_of_studentsind].value;
var ministry_discountind = document.getElementById("ministry_discount").selectedIndex;
var ministry_discount = document.getElementById("ministry_discount").options[ministry_discountind].value;
var member_discountind = document.getElementById("member_discount").selectedIndex;
var member_discount = document.getElementById("member_discount").options[member_discountind].value;
var full_payment_discountind = document.getElementById("full_payment_discount").selectedIndex;
var full_payment_discount = document.getElementById("full_payment_discount").options[full_payment_discountind].value;

var num_in_k = 0;
var num_in_e = 0;
var num_in_h = 0;

for(i=1;i<=no_of_students;i++){
	
	var x = document.getElementById("student" + i).selectedIndex;
	var y = document.getElementById("student" + i).options[x].value;
	
	if(y=="0"){
		num_in_k++; //Number of students in K-4/5
		}
	else if(y=="1"){
		num_in_e++; //Number of students in 1st-6th
		}
	else if(y=="2"){
		num_in_h++; //Number of students in 7th-12th
		}
	
}

document.getElementById("steptwo").innerHTML += "<p>One Moment . . .</p>";
var url = 'tuition_calculate.php?no_of_students='+no_of_students+'&ministry_discount='+ministry_discount+'&member_discount='+member_discount+'&full_payment_discount='+full_payment_discount+'&num_in_k='+num_in_k+'&num_in_e='+num_in_e+'&num_in_h='+num_in_h;
new ajax (url, {method: "get", update: $('calculator')});

}

function StartOver(){
document.getElementById("calculator").innerHTML += "<p>One Moment . . .</p>";
var url = 'tuition_startover.php?start=yes';
new ajax (url, {method: "get", update: $('calculator')});
}
