//This function finds the student price based on the 
//drop down selection
function getStudentPrice1()  //non UDEO member
{
    var registerStudentPrice=0;
	
	registerStudentPrice = document.forms["hsf_register"].elements["number_students"].value * 20;
	
	if (registerStudentPrice < 350) { registerStudentPrice = 350;}

    return registerStudentPrice;
}
function getStudentPrice2()  //NDEO Institutional Member
{
    var registerStudentPrice=0;
	
	registerStudentPrice = document.forms["hsf_register"].elements["number_students"].value * 10;

    return registerStudentPrice;
}
function getStudentPrice3()  //UDEO or NDEO Professional Member
{
    var registerStudentPrice=0;
	
	registerStudentPrice = document.forms["hsf_register"].elements["number_students"].value * 15;
	
	if (registerStudentPrice < 225) { registerStudentPrice = 225;}

    return registerStudentPrice;
}

//This function finds the lunch price based on the 
//drop down selection
function getLunchPrice1()
{
    var registerLunchPrice=0;
	
	var regLunch = document.forms["hsf_register"].elements["number_lunches"].value * 8;
	var vegLunch = document.forms["hsf_register"].elements["number_lunches_veg"].value * 8;
	
	registerLunchPrice = regLunch + vegLunch;
	
    return registerLunchPrice;
}

function calculateTotal1()  //non UDEO Member
{
    //Here we get the total price by calling our function
    //Each function returns a number so by calling them we add the values they return together
	var registerSubPrice = getStudentPrice1();
    var registerPrice = getStudentPrice1() + getLunchPrice1();
    
	var tagwords
	if ((document.forms["hsf_register"].elements["number_students"].value * 20) < 350) {tagwords = " [ $350 Minimum ]"; } else {tagwords ="";}
	
    //display the result
    var divobj1 = document.getElementById('subPrice');
    divobj1.style.display='block';
    divobj1.innerHTML = "<br />Amount: $" + registerSubPrice + tagwords;
	
	
	//display the result
    var divobj = document.getElementById('totalPrice');
    divobj.style.display='block';
    divobj.innerHTML = "Total Amount Due: $" + registerPrice;
	
	//hide the php posting
	var divobj3 = document.getElementById('subPricePHP');
    divobj3.style.display='none';
	var divobj4 = document.getElementById('totalPricePHP');
    divobj4.style.display='none';

}

function calculateTotal2()  // NDEO Institutional Member
{
    //Here we get the total price by calling our function
    //Each function returns a number so by calling them we add the values they return together
	var registerSubPrice = getStudentPrice2();
    var registerPrice = getStudentPrice2() + getLunchPrice1();
    
	var tagwords
	tagwords ="";
	
    //display the result
    var divobj1 = document.getElementById('subPrice');
    divobj1.style.display='block';
    divobj1.innerHTML = "<br />Amount: $" + registerSubPrice + tagwords;
	
	
	//display the result
    var divobj = document.getElementById('totalPrice');
    divobj.style.display='block';
    divobj.innerHTML = "Total Amount Due: $" + registerPrice;
	
	//hide the php posting
	var divobj3 = document.getElementById('subPricePHP');
    divobj3.style.display='none';
	var divobj4 = document.getElementById('totalPricePHP');
    divobj4.style.display='none';

}

function calculateTotal3()  // UDEO or NDEO Professional Member
{
    //Here we get the total price by calling our function
    //Each function returns a number so by calling them we add the values they return together
	var registerSubPrice = getStudentPrice3();
    var registerPrice = getStudentPrice3() + getLunchPrice1();
    
	var tagwords
	if ((document.forms["hsf_register"].elements["number_students"].value * 15) < 225) {tagwords = " [ $225 Minimum ]"; } else {tagwords ="";}
	
    //display the result
    var divobj1 = document.getElementById('subPrice');
    divobj1.style.display='block';
    divobj1.innerHTML = "<br />Amount: $" + registerSubPrice + tagwords;
	
	
	//display the result
    var divobj = document.getElementById('totalPrice');
    divobj.style.display='block';
    divobj.innerHTML = "Total Amount Due: $" + registerPrice;
	
	//hide the php posting
	var divobj3 = document.getElementById('subPricePHP');
    divobj3.style.display='none';
	var divobj4 = document.getElementById('totalPricePHP');
    divobj4.style.display='none';

}
/*
function hideTotal()
{
    var divobj = document.getElementById('totalPrice');
    divobj.style.display='none';
	var divobj1 = document.getElementById('subPrice');
    divobj1.style.display='none';
}
*/
//addLoadEvent(hideTotal);
