//// registration helper javascript functions - some use xAjax //////
function do_bulk_send() {
	var clean_emails			= document.getElementById('clean_email_string').value;
	var clean_email_body		= document.getElementById('clean_email_body').value;
	var poc_id					= document.getElementById('poc_id').value;

	//alert(clean_emails + "\n\n" +clean_special_message + "\n\n" + poc_id);
	xajax_do_bulk_send(clean_emails,clean_email_body,poc_id);

}

function prep_2_send(){
	var emails = document.getElementById('emails').value.replace(/\n/g,"|||");
	var clean_email_body = document.getElementById('bulk_email_body').value;
	var verify_email_body = document.getElementById('bulk_email_body').value.replace(/\n/g,"<br />");

	// ok, let's take the list of emails, create an array, cycle through the array
	// to create a second array that strips out any duplicate emails

	var emails = document.getElementById('emails').value.replace(/\n/g,"|||");
	var email_stack = emails.split("|||");

	var clean_email_string = "";
	var clean_email_string_verify = "";
	for (n in email_stack) {
		if (email_stack[n] != "" && clean_email_string.indexOf(email_stack[n])== -1) {
			clean_email_string += email_stack[n] + "|||";
			clean_email_string_verify += "&#149; " + email_stack[n] + "<br />";
		}
	}
	clean_email_string_verify += "<br /><div style='border-top:1px solid blue;padding-top:10px;'>" + verify_email_body + "</div>";
	clean_email_string = clean_email_string.substring(0,clean_email_string.length -3);
	document.getElementById('clean_email_string').value = clean_email_string;

	document.getElementById('clean_email_body').value = clean_email_body;

	//document.getElementById('verify_b4_sending').style.display = "";
	document.getElementById('start_up').style.display = "none";
	document.getElementById('verify_b4_sending').style.display = "";
	document.getElementById('vb4s_inner').innerHTML = clean_email_string_verify;

	//alert(clean_email_string);
}

function bulk_emailer(do_what){
	switch (do_what){
	case "open":
		document.getElementById('bulk_emailer').style.display = "";
		break;
	case "close":
		document.getElementById('bulk_emailer').style.display = "none";
		document.getElementById('verify_b4_sending').style.display = 'none';
		document.getElementById('start_up').style.display = '';
		break;
	}

}


function validate_rh_step_4(){
	var num_available_courses	= parseInt(document.getElementById('num_available_courses').value );
	var is_valid				= false;
	for (var i=1 ; i <= num_available_courses ; i++ ){
		if(document.getElementById('available_course_'+i).checked == true ) {
			is_valid = true;
		}
	}
	if (is_valid){
		document.getElementById('step4_form').submit();
	} else {
		alert('Please choose at least one course');
	}	
}

function get_asc_fhsu_course_offerings(semester_id,pgm_id,cids,student_id){
	if(semester_id != ""){
		document.getElementById('course_listing').innerHTML = document.getElementById('course_listing_holder').innerHTML;
		document.getElementById('course_listing').style.display = 'block';
		var pgm_id = document.getElementById('p_pgm_id').value;
		if(cids == "") {
			cids = false;
		}
		if(student_id == "") {
			student_id = false;
		}
		xajax_get_asc_fhsu_course_offerings(semester_id,pgm_id,cids,student_id);
	}
}
function get_asc_course_offerings_OLD_W_SEMESTER_ID(semester_id){
	var pgm_id = document.getElementById('p_pgm_id').value;
	if(semester_id != "") {
		document.getElementById('course_listing').innerHTML = '<span style="font-size:20px;">Searching for Courses ... please wait.</span>';
		document.getElementById('course_listing').style.display = '';
		xajax_get_asc_course_offerings(semester_id,pgm_id);
	}
}
function ss_hide_n_show(value) {
	if (value == 'm'){
		document.getElementById('row_selective_service').style.display = '';
	} else {
		document.getElementById('row_selective_service').style.display = 'none';
	}
}
function rh_validation(form) {

	switch (form.name){
		case "step2_form":
			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email'
			);
			break;
		case "step3_form":
		// get program_id, set required_inputs based on that
			var pgm_id = document.getElementById('p_pgm_id').value;
			var sex = document.getElementById('sex').value;

		if(pgm_id == "9"){
			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'mentor_id',
				'sex'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}

		}
		if( pgm_id == "1" || pgm_id == "2" || pgm_id == "3" || pgm_id == "4" ){
			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'sex',
				'rank',
				'mentor_id'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}
		}

		if( pgm_id == "25" ){
			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'sex',
				'rank',
				'mentor_id',
				'hs_state',
				'hs_name'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}
		}
		if( pgm_id == "23" ){

			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'sex',
				'rank',
				'mentor_id',
				'hs_state',
				'hs_name'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}
		}
		if( pgm_id == "5" || pgm_id == "6" || pgm_id == "7" || pgm_id == "8" || pgm_id == "31" ){

			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'mentor_id',
				'sex'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}
		}

		if( pgm_id == "13" || pgm_id == "14" || pgm_id == "15" || pgm_id == "16" || pgm_id == "17" || pgm_id == "32" || pgm_id == "33" || pgm_id == "34" ){
			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'sex',
				'hs_state_id',
				'hs_name'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}
			ri_length = required_inputs.length;
			if(document.getElementById('hs_state_id').value !=""){
				required_inputs[ri_length] = 'set_hs_name';
			}
		}
		



		if( pgm_id == "1" || pgm_id == "2" || pgm_id == "3" || pgm_id == "4" || pgm_id == "30" ){
			var required_inputs = new Array(
				'first_name',
				'mi',
				'last_name',
				'email',
				'street',
				'city',
				'state_loc_id',
				'zip',
				'country',
				'hs_phone',
				'home_phone',
				'month',
				'day',
				'year',
				'sex',
				'rank',
				'mentor_id'
			);
			var ri_length = required_inputs.length;
			if(sex == "m") {
				required_inputs[ri_length] = 'selective_service';
			}
		}			






		break;
	}

		
	var err_found = false;
	var err_msg = "\n\nto continue, please complete the highlighted entries:\n\n";

	for (i=0;i<required_inputs.length;i++){
		document.getElementById(required_inputs[i]).style.backgroundColor = '';
		document.getElementById(required_inputs[i]).style.borderColor = '';
		document.getElementById(required_inputs[i]).style.borderWidth = '';
	}
	for (i=0;i<required_inputs.length;i++)
	{
		if (document.getElementById(required_inputs[i]).value == "") {
			err_found = true;
			document.getElementById(required_inputs[i]).style.backgroundColor = '#FFDA56';
			document.getElementById(required_inputs[i]).style.borderColor = '#153F6F';
			document.getElementById(required_inputs[i]).style.borderWidth = '1px';
		}
	}

	// now let's check for matching field requirements
	switch (form.name){
	case "step2_form":
		var input1 = document.getElementById('email');
		var input2 = document.getElementById('email_2');
		if(input1.value != "" && (input1.value != input2.value) ) {
			err_found = true;
			err_msg += "** ALSO - please ensure your emails match";
			input1.style.backgroundColor = '#FFDA56';
			input1.style.borderColor = '#153F6F';
			input1.style.borderWidth = '1px';
			input2.style.backgroundColor = '#FFDA56';
			input2.style.borderColor = '#153F6F';
			input2.style.borderWidth = '1px';
		} else {
			if(input1.value != ""){
				input1.style.backgroundColor = '';
				input1.style.borderColor = '';
				input1.style.borderWidth = '';
			}
			input2.style.backgroundColor = '';
			input2.style.borderColor = '';
			input2.style.borderWidth = '';
		}
		break;
	case "step3_form":
		var input1 = document.getElementById('home_phone');
		var input2 = document.getElementById('home_phone_2');
		var input3 = document.getElementById('hs_phone');
		var input4 = document.getElementById('hs_phone_2');
		var input5 = document.getElementById('email');
		var input6 = document.getElementById('email_2');
		if(input1.value != "" && (input1.value != input2.value) ) {
			err_found = true;
			err_input1 = true;
			err_msg += "** ALSO - please ensure your phones match";
			input1.style.backgroundColor = '#FFDA56';
			input1.style.borderColor = '#153F6F';
			input1.style.borderWidth = '1px';
			input2.style.backgroundColor = '#FFDA56';
			input2.style.borderColor = '#153F6F';
			input2.style.borderWidth = '1px';
		} else {
			err_input1 = false;
			if(input1.value != ""){
				input1.style.backgroundColor = '';
				input1.style.borderColor = '';
				input1.style.borderWidth = '';
			}
			input2.style.backgroundColor = '';
			input2.style.borderColor = '';
			input2.style.borderWidth = '';
		}
		if(input3.value != "" && (input3.value != input4.value) ) {
			err_found = true;
			if(!err_input1){
				err_msg += "** ALSO - please ensure your phones match";
			}
			input3.style.backgroundColor = '#FFDA56';
			input3.style.borderColor = '#153F6F';
			input3.style.borderWidth = '1px';
			input4.style.backgroundColor = '#FFDA56';
			input4.style.borderColor = '#153F6F';
			input4.style.borderWidth = '1px';
		} else {
			if(input3.value != ""){
				input3.style.backgroundColor = '';
				input3.style.borderColor = '';
				input3.style.borderWidth = '';
			}
			input4.style.backgroundColor = '';
			input4.style.borderColor = '';
			input4.style.borderWidth = '';
		}
		if(input5.value != "" && (input5.value != input6.value) ) {
			err_found = true;
			err_msg += "\n** ALSO - please ensure your emails match";
			input5.style.backgroundColor = '#FFDA56';
			input5.style.borderColor = '#153F6F';
			input5.style.borderWidth = '1px';
			input6.style.backgroundColor = '#FFDA56';
			input6.style.borderColor = '#153F6F';
			input6.style.borderWidth = '1px';
		} else {
			if(input5.value != ""){
				input5.style.backgroundColor = '';
				input5.style.borderColor = '';
				input5.style.borderWidth = '';
			}
			input6.style.backgroundColor = '';
			input6.style.borderColor = '';
			input6.style.borderWidth = '';
		}
		break;
	
	}

	if (err_found) {
		alert(err_msg);
		return false;
	} else {
		//alert('submit');
		//document.form.name.submit();
		return true;
	}

}
function show_next_button(value,button2show) {
	if (value == "") {
		document.getElementById(button2show).style.display = 'none';
	} else {
		document.getElementById(button2show).style.display = '';
	}
	
}

function show_course_levels(value) {
	if (value == "") {
		document.getElementById('get_course_level_id').style.display = 'none';
	} else {
		document.getElementById('get_course_level_id').style.display = '';
	}
	
}


function no_reg_check(status) {
	switch (status){
	case "good":
		document.getElementById('program_choice_adults').style.display = "";
		document.getElementById('no_reg_note').style.display = "none";
		break;
	case "bad":
		document.getElementById('program_choice_adults').style.display = "none";
		document.getElementById('no_reg_note').style.display = "";
		break;
	}
}
function hide_n_seek(section,id){
	var this_id = "";

	switch (section){
	case "step1":
		var id_divs = new Array(
			'hs',
			'adults'
			);
		break;
	}

	for (var i=0; i<id_divs.length;i++ ){
		this_id = 'program_choice_'+id_divs[i];

		if (id !== id_divs[i]){
			document.getElementById(this_id).style.display = 'none';
		} else {
			document.getElementById(this_id).style.display = '';
		}
	}
}


function set_pgm_value(pgm_id2_hide) {
	document.getElementById('program_choice_'+pgm_id2_hide).value = '';
}

function do_check_all() {
	var status = document.getElementById('checked_status').value;
	var total = document.getElementById('num_checkboxes').value;
	var this_sid = "";
	switch(status){
		case "none":
			for(var i = 1; i < total; i++){
				this_sid = "SID_"+i;
				document.getElementById(this_sid).checked = true;
			}
			document.getElementById('checked_status').value = "all";
			document.getElementById('check_all').title = "click here to UNCHECK all students";
			document.getElementById('prefix').innerHTML = "<b>UN</b>"
			break;
		case "all":
			for(var i = 1; i < total; i++){
				this_sid = "SID_"+i;
				document.getElementById(this_sid).checked = false;
			}
			document.getElementById('check_all').title = "click here to CHECK all students";
			document.getElementById('checked_status').value = "none";
			document.getElementById('prefix').innerHTML = ""
			break;
	}
}
function give_status() {
	document.getElementById('email_status').style.display = "";
	document.getElementById('email_status').innerHTML = "<span style=\"font-size:20px;font-weight:bold;color:blue;\"><img src=\"http://www.JROTCCollegeCredit.com/images/rh/rh_email_wait2.gif\" width=\"28\" height=\"28\"  />&nbsp;... preparing and activating your request</span>";
}
function do_reminder_send(semester_id) {
	var total = document.getElementById('num_checkboxes').value;
	var num_checked = 0;
	var ids = "";
			for(var i = 1; i < total; i++){
				this_sid = "SID_"+i;
				//new 7 Jul 08 - for allowing RTG to set an email opt-out value for a student
				// check which of the 3 radio boxes is checked and set ids accordingly
				// if the 'send' radio box is checked then prepend 'send' to ids
				//         ids += "send~"+ ...
				// if the 'stop_email' radio is checked, then prepend 'stop' to ids
				//         ids += "stop~"+ ...
				// if the 'do_nothing' radio is checked then we simply don't modify the ids var

				// then in the send_reminder_email function we explode the ids value
				//      and process accordingly
				if (document.getElementById(this_sid+'_send').checked == true) {
					ids += "|send~"+ document.getElementById(this_sid+'_send').value;
					num_checked++;
				}
				if (document.getElementById(this_sid+'_stop').checked == true) {
					ids += "|stop~"+ document.getElementById(this_sid+'_stop').value;
					num_checked++;
				}
				// note we use " | " at front of each new id to identify each record
				//                      in the send_reminder_emails function
				/*
				if(document.getElementById(this_sid).checked == true) {
					num_checked++;
					ids += "~"+ document.getElementById(this_sid).value;
				}
				*/
			}
	if(num_checked > 0) {
		//alert('ids: '+ids);
		xajax_send_reminder_email(ids,semester_id); // send the email based on sid
		//alert('there were '+num_checked+' checked students');
	} else {
		document.getElementById('email_status').style.display = "none";
		alert('no action selected for students\n------------------------\nselect either to send email\n or stop sending emails');
	}
}

function show_services_dd(action){
	switch (action) {
		case "hide":
			document.getElementById('services_dd').style.display = "none";
			document.getElementById('military_installation').focus();
			break;
		case "show":
			document.getElementById('services_dd').style.display = "";
			document.getElementById('the_services').focus();
			break;
	}
}

function update_services_input(value){
	document.getElementById('service').value = value;
	show_services_dd('hide');
}


function show_pocs_dd(action){
	switch (action) {
		case "hide":
			document.getElementById('pocs_dd').style.display = "none";
			document.getElementById('course_offering_id').focus();
			break;
		case "show":
			document.getElementById('pocs_dd').style.display = "";
			document.getElementById('the_pocs').focus();
			break;
	}
}

function update_pocs_input(value){
	var id = value.slice(0,36);//first 36 of value
	var poc_name = value.slice(37); // everything after char 37
	document.getElementById('poc_id').value = id;
	document.getElementById('poc_name').value = poc_name;
	show_pocs_dd('hide');
}


function really_delete(id_coid,student,course,report_type,value){
	if(!confirm("--------------------------------------------------------------------------------------------------------\n\n\nAre you sure you want to delete the entry for:\n\n\t> STUDENT:  "+student+"\n\t> COURSE:   "+course+" ("+id_coid+")\n\n - If you DO want to DELETE, Click [ OK ] to FINALIZE this delete request\n\n - If you DO NOT want to delete, Click [ Cancel ] to return to reports page         \n\n\n\n--------------------------------------------------------------------------------------------------------\n")){

		return(false);

	} else {
		//document.getElementById('reports_display').innerHTML = "<div style=\"margin-top:10px;text-align:center;padding:15px;\"><img src='images/wait_ffd_bar.gif' /><br />Processing ...</div>";
		// call generate report function, but pass registration id ... in
		// that function, it checks for registration id - if it gets one, then it deletes registration first, then display the resultant report...pretty nifty use of the function!
		//alert('delete reg id: '+id_coid+'');
		document.getElementById('delete_status').style.display = '';
		document.getElementById('semester').focus();
		xajax_generate_report(value,report_type,id_coid);
	}
}


function get_report(report_type) {
	//document.getElementById('report_selection2').style.display = "";
	//document.getElementById('report_selection2').innerHTML = "";
	document.getElementById('reports_output').innerHTML = "";
	xajax_get_report(report_type);
}

function generate_report(value,report_type,id) {
	if (!id) {id=""}
	document.getElementById('reports_output').style.display = "";
	document.getElementById('reports_output').innerHTML = "<br />Please Wait ... <img src='images/rh/animated_jumping_jacks2.gif' width='40' height='57' border='0' /> Generating Report ...<br />";
	xajax_generate_report(value,report_type,id);
}



function double_check(){
	var e = document.getElementById('e').value;
	var p = document.getElementById('p').value;

	err = false;
	err_msg = "Sorry, to proceed we need:\n";
	err_msg += "============================\n";

	if(!e) {
		err = true;
		err_msg += " - your email address\n\n";
	}
	if(!p) {
		err = true;
		err_msg += " - your secret code\n\n";
	}

	if(err) {
		alert(err_msg);
		return false;
	} else {
		xajax_double_check(e,p)
	}
}


function show_step2_verification_refresh_link() {
document.getElementById('info_display').innerHTML = document.getElementById('fix_entries_innerHTML').innerHTML;
}


function fix_entries() {
document.getElementById('info_verification').style.display='none';
document.getElementById('course_offering_id').style.display = '';
document.getElementById('submit_step2').style.display = '';

show_step2_verification_refresh_link();
}

function clear_session(){
	xajax_clear_session();
}
function set_this_hs_name(value){
	if(value!="not_in_list") {
		document.getElementById('real_hs_name_holder').style.display = "none";
		document.getElementById('hs_name').value = value;
	} else {
		document.getElementById('real_hs_name_holder').style.display = "";
		document.getElementById('hs_name').value = "";
	}
}

function check_for_high_schools(st_loc_id,hs_name){
	if(hs_name == ""){
		//alert(st_loc_id);
		// clear the hs_name field for validation
		document.getElementById('hs_name').value = "";
		document.getElementById('hs_name_title').style.display = 'none';
		document.getElementById('real_hs_name_holder').style.display = 'none';
		document.getElementById('high_school_name_holder').innerHTML = "";
	}
	if(st_loc_id != ""){
		xajax_check_for_high_schools(st_loc_id,hs_name);
	}
}


function check_hs_name(st_loc_id){
	//alert(st_loc_id);

	xajax_check_hs_name(st_loc_id);
}
function get_hs_name(hs_id){
	xajax_get_hs_name(hs_id);
}


function get_hs_list(st_loc_id){
	document.getElementById('hs_dd_holder').style.display = '';
	document.getElementById('hs_other').style.display = 'none';
	xajax_get_hs_list(st_loc_id);
}

function do_login(email,password){
	var err = false;
	var err_msg = "Sorry, to login in you need:\n================================\n\n";

	if (!email) {
		err = true;
		err_msg += " - your email address\n\n";
	}

	if (!password) {
		err = true;
		err_msg += " - your password\n\n";
	}

	if (err) {
		alert(err_msg);
		return false;
	} else {
		document.getElementById('rh_mgr_holder').style.display = '';
		document.getElementById('rh_mgr_holder').innerHTML = 'checking login, please wait';
		setTimeout("document.getElementById('rh_mgr_holder').innerHTML = 'checking login, please wait .'",1000);
		setTimeout("document.getElementById('rh_mgr_holder').innerHTML = 'checking login, please wait ..'",1000);
		setTimeout("document.getElementById('rh_mgr_holder').innerHTML = 'checking login, please wait ...'",1000);

		xajax_do_login(email,password);
	}
}




function get_2008_course_dates(co_id){

	document.getElementById('course_dates_2008_select').innerHTML = 'Select course dates:';
	document.getElementById('course_dates_2008_dd').innerHTML = "&nbsp;&nbsp;&nbsp;getting course dates, please wait ....";
	document.getElementById('submit_step2').style.display = 'none';

	xajax_get_2008_course_dates(co_id);
}

function show_step3_button(value){
	if (value == "not_selected") {
		document.getElementById('submit_step2').style.display = 'none';
	} else {
		document.getElementById('submit_step2').style.display = '';
	}
}

function verify_match(value,id) {
	var match_id = id.substr(0,id.length-1);
	//alert('value: '+value+' ... id: '+id+' ... '+match_id+'');

	if(value != document.getElementById(match_id).value) {
		document.getElementById(id).value = '';
		document.getElementById(match_id).focus();
		document.getElementById(match_id).select();
		alert ('Please check again, '+document.getElementById(match_id).value+' doesn\'t match '+value+'...\n');
	}
}

function check_step2(main_inputs,additional_inputs,course_offering_id){
	var err=0;
	var err_msg = "To continue, we need your help:\n\n========================\n\n";
	//alert(main_inputs);
	var main_inputs_values = "";
	var main_inputs_pieces = main_inputs.split("|");
	var this_id_main_alert = "";
	for (n in main_inputs_pieces) {
		var this_id_main = main_inputs_pieces[n];
		this_id_main_alert = this_id_main.replace(/_/g," "); // so we can check for id2 below and display proper verbiage
		// if the last char is a '2', then rename to "second xxx"
		if (this_id_main.slice(-1) == "2" ) {
			this_id_main_alert = "second "+this_id_main.slice(0,-1);
		}
		//alert(this_id_main);
			if (!document.getElementById(''+this_id_main+'').value) {
				err = 1;
				err_msg += " - We need the "+this_id_main_alert+"\n\n";
			} else {
				main_inputs_values += this_id_main+"~"+document.getElementById(''+this_id_main+'').value+"|";
				// store id~value pair separated by "|" - explode in ajax php function for verification

			}
	}
	if (additional_inputs) {
		//alert(additional_inputs);
		var additional_inputs_values = "";
		var additional_inputs_pieces = additional_inputs.split("|");
		var this_id_add_alert = "";
		for (n in additional_inputs_pieces) {
			var this_id_add = additional_inputs_pieces[n];
			this_id_add_alert = this_id_add.replace(/_/g," "); // so we can check for id2 below and display proper verbiage
			/*
			// if the last char is a '2', then rename to "second xxx"
			if (this_id_add.slice(-1) == "2" ) {
				this_id_add_alert = "second "+this_id_add.slice(0,-1);
			}
			*/
		//alert(this_id_add+': value: '+document.getElementById(''+this_id_add+'').value);
				if (!document.getElementById(''+this_id_add+'').value) {
					err = true;
					err_msg += " - We need the "+this_id_add_alert+"\n\n";
				} else {
				additional_inputs_values += this_id_add+"~"+document.getElementById(''+this_id_add+'').value+"|";
				// store id~value pair separated by "|" - explode in ajax php function for verification

			}
		}
	}
	if (err) {
		alert(err_msg);
	} else {
		document.getElementById('submit_step2').style.display = 'none';
		document.getElementById('info_verification').style.display = '';
		document.getElementById('course_offering_id').style.display = 'none';
		xajax_verify_step2_info(main_inputs_values,additional_inputs_values,course_offering_id);
		//document.getElementById('step2').submit();
		//alert('we\'re clean!');
	}
}
