// ************************************************************
// Survey specific JS functions
// ************************************************************


function confirm_section_submit() {

    if(confirm('Are you sure you would now like to flag this section as complete? You will not be able to edit data once it becomes complete.')) {

        return true;
    }
    return false;
}


// ************************************************************
// Set Applied Total
function set_enrollment_status(flag) {
    
	var app_ft;
	var app_pt;
	var acc_ft;
	var acc_pt;
	var enr_ft;
	var enr_pt;
	var app_total;
	var acc_total;
	var enr_total;

	var total;
	
	if(flag == 1) {
	    
		app_ft = eval('document.forms[0].XI_Prog_app_status_ft.value');
		app_pt = eval('document.forms[0].XI_Prog_app_status_pt.value');

        app_ft = parseInt(app_ft)? parseInt(app_ft) : 0;
        app_pt = parseInt(app_pt)? parseInt(app_pt) : 0;
    		
		app_total = parseInt(app_ft) + parseInt(app_pt);
		
		document.forms[0].XI_Prog_app_ftpt_total.value = app_total;
		document.forms[0].XI_Prog_app_age_total.value = app_total;
		document.forms[0].app_back_total.value = app_total;
		document.forms[0].app_race_total.value = app_total;
		document.forms[0].app_residence_total.value = app_total;
		document.forms[0].app_back_total.value = app_total;
		
	}
	else if(flag == 2) {	
	    
		acc_ft = eval('document.forms[0].XI_Prog_acc_status_ft.value');
		acc_pt = eval('document.forms[0].XI_Prog_acc_status_pt.value');	

        acc_ft = parseInt(acc_ft)? parseInt(acc_ft) : 0;
        acc_pt = parseInt(acc_pt)? parseInt(acc_pt) : 0;
        		
		acc_total = parseInt(acc_ft) + parseInt(acc_pt);
		
		document.forms[0].XI_Prog_acc_ftpt_total.value = acc_total;
		document.forms[0].XI_Prog_acc_age_total.value = acc_total;
		document.forms[0].acc_back_total.value = acc_total;
		document.forms[0].acc_race_total.value = acc_total;
		document.forms[0].acc_residence_total.value = acc_total;
		document.forms[0].acc_back_total.value = acc_total;
	}	
	else if(flag == 3) {	
	    
		enr_ft = eval('document.forms[0].XI_Prog_enr_status_ft.value');
		enr_pt = eval('document.forms[0].XI_Prog_enr_status_pt.value');	

        enr_ft = parseInt(enr_ft)? parseInt(enr_ft) : 0;
        enr_pt = parseInt(enr_pt)? parseInt(enr_pt) : 0;
        		
		acc_total = parseInt(enr_ft) + parseInt(enr_pt);
		
		document.forms[0].XI_Prog_enr_ftpt_total.value = acc_total;
	}	
	
}

//***********************************************************

