
function compute(obj) {
 obj.txtgrand_total.value = obj.txtfull_conf_amnt.value*1+obj.instit_full_day_fee.value*1+obj.instit_half_day_fee.value*1+obj.total_day_fee.value*1+obj.txtfca_total.value*1+obj.txtbl_total.value*1+obj.txtCEU_form_amount.value*1+ obj.txtcontribution_amount.value*1+ obj.txtmembership_amount.value*1;
} // compute() is the main calculation for totaling the fields for Grand Total

function daycheckF(){
if (document.getElementById('day6').checked == true && document.getElementById('day4').checked == true){  //Thurs Half
 alert("You cannot sign up for both Half and Full Institue on the same day.1")  // in case they select a day from Full Inst. when they have selected a day from Half day Institute. 
 	 document.getElementById('day6').checked = false;  
        return false
	}
	if (document.getElementById('day7').checked == true && document.getElementById('day5').checked == true){//Mon Half
 alert("You cannot sign up for both Half and Full Institue  on the same day.2")  // in case they select a day from Full Inst. when they have selected a day from Half day Institute.  
 	 document.getElementById('day7').checked = false;	
        return false
	}
}

function daycheckH(){
if (document.getElementById('day4').checked == true && document.getElementById('day6').checked == true){//Thu Full
 alert("You cannot sign up for both Half and Full Institue on the same day.3")  // in case they select a day from Half Inst. when they have selected a day from Full 
	   document.getElementById('day4').checked = false;
        return false
	}
	if (document.getElementById('day5').checked == true && document.getElementById('day7').checked == true){//Mon Full
 alert("You cannot sign up for both Half and Full Institue on the same day.4")  // in case they select a day from Half Inst. when they have selected a day from Full 
	  document.getElementById('day5').checked = false;
        return false
	}
}

function checkit2(){ // used for checking day for half day institute
count = 0;

if (document.getElementById('full_day_inst').checked == true){
 alert("You already selected a FULL DAY Institute PACKAGE")  // in case they select Full day Inst and then select Half day price
	  document.getElementById('day6').focus()
        return false
}

if (document.getElementById('day6').checked == true ||document.getElementById('day7').checked == true){
	if (document.getElementById('day6').checked == true)
    {   
    count++;
    } 
    
    if (document.getElementById('day7').checked == true)
    {
     count++;
    } 
}
	else	{
	  alert("You must select a day")  // in case they select a price without a day
	  document.getElementById('day6').focus()
        return false
	}  
       
    document.getElementById('multi2').value=count;
    return;
 }
 
 
function checkit1(){// used for checking days for full day institute
count = 0;

if (document.getElementById('half_day_instit').checked == true){
 alert("You already selected a HALF DAY Institute PACKAGE")  // in case they select Half day Inst and then select Full day price
	  document.getElementById('day6').focus()
        return false
}

if (document.getElementById('day4').checked == true ||document.getElementById('day5').checked == true){
	
	if (document.getElementById('day4').checked == true)
    {   
    count++;
     } 
    
    if (document.getElementById('day5').checked == true)
    {
     count++;
    } 
}	
	else	{
	  alert("You must select a day")  // in case they select a price without a day
	  document.getElementById('day4').focus()
        return false
	}  
       
    document.getElementById('multi1').value=count;
    return;
 }
 


function checkit(){ // used for checking days for individual days at conference
count = 0;
if (document.getElementById('full_conf_pkg').checked == true){
 alert("You already selected a FULL CONFERENCE PACKAGE")  // in case they select a price without a day
	  document.getElementById('day1').focus()
        return false
}

if (document.getElementById('day1').checked == true ||document.getElementById('day2').checked == true||document.getElementById('day3').checked == true)
 {	
	if (document.getElementById('day1').checked == true)
    {   
    count++;
      } 
    
    if (document.getElementById('day2').checked == true)
    {
     count++;
    } 
            
    if (document.getElementById('day3').checked == true)
    {
       count++;       
    } 
 }	
else	{
	  alert("You must select a day")  // in case they select a price without a day
	  document.getElementById('day1').focus()
        return false
	} 
    document.getElementById('multi').value=count;
    return;
 }
 
 
 
 
 function free_lunch(){ // used for locking out lunch for Saturday which is included with full conf pkg

if (document.getElementById('full_conf_pkg').checked == true){
 alert("You already have Saturday lunch included with a FULL CONFERENCE PACKAGE")  	  
	  document.getElementById('day2').focus()
        return false
	}
}
 

function validate(frm) {
    //
    // Check Mandatory fields to see if characters were entered
    //

if (document.getElementById('name').value.length == 0)
    {
        alert("Please enter your Name.")
       document.getElementById('name').focus()
        return false
    }
if (document.getElementById('address').value.length == 0)
    {
        alert("Please enter your Address.")
        document.getElementById('address').focus()
        return false
    } 
if (document.getElementById('city').value.length == 0)
    {
        alert("Please enter your City.")
        document.getElementById('city').focus()
        return false
    } 
if (document.getElementById('state').value.length == 0)
    {
        alert("Please enter State.")
        document.getElementById('state').focus()
        return false
    }

 if (document.getElementById('zip').value.length == 0)
    {
        alert("Please enter Zip Code.")
        document.getElementById('zip').focus()
        return false
    } 
if (document.getElementById('nickname').value.length == 0)
    {
        alert("Please enter a Badge name.")
        document.getElementById('nickname').focus()
        return false
    } 
if (document.getElementById('phone').value.length == 0)
    {
        alert("Please enter a Phone Number.")
        document.getElementById('phone').focus()
        return false
    }  

 
if (frm.txtgrand_total.value == "0")
    {
        alert("There is no total amount. Please click the Grand total button.")
        frm.txtgrand_total.focus()
        return false
    }  

       var i,j;
       for (i=0; i < document.forms[0].elements.length-1; i++)
          switch (String(document.forms[0].elements[i].name).substring(0,3))
          {
             case "chk":
                if (document.forms[0].elements[i].checked)
                   document.forms[0].elements[i].value = "Yes";
                else {
                   document.forms[0].elements[i].checked = true;
                   document.forms[0].elements[i].value = "No";
                }
                break;
          }
     
}
