<!--
// Function that copies info to registrant contact's fields
function registrant_function()
{
	if(document.form1.registrant_same[0].checked)
	{
		document.form1.registrant_fname.value = document.form1.primary_fname.value;
		document.form1.registrant_lname.value = document.form1.primary_lname.value;
		document.form1.registrant_title.value = document.form1.primary_title.value;
		document.form1.registrant_add1.value = document.form1.primary_add1.value;
		document.form1.registrant_add2.value = document.form1.primary_add2.value;
		document.form1.registrant_city.value = document.form1.primary_city.value;
		document.form1.registrant_state.value = document.form1.primary_state.value;
		document.form1.registrant_zip.value = document.form1.primary_zip.value;
		document.form1.registrant_zip4.value = document.form1.primary_zip4.value;
		document.form1.registrant_country.value = document.form1.primary_country.value;
		document.form1.registrant_phone1.value = document.form1.primary_phone1.value;
		document.form1.registrant_phone2.value = document.form1.primary_phone2.value;
		document.form1.registrant_phone3.value = document.form1.primary_phone3.value;
		document.form1.registrant_ext.value = document.form1.primary_ext.value;
		document.form1.registrant_fax1.value = document.form1.primary_fax1.value;
		document.form1.registrant_fax2.value = document.form1.primary_fax2.value;
		document.form1.registrant_fax3.value = document.form1.primary_fax3.value;
		document.form1.registrant_email.value = document.form1.primary_email.value;
	}
	else if(document.form1.registrant_same[1].checked)
	{
		document.form1.registrant_fname.value = document.form1.secondary_fname.value;
		document.form1.registrant_lname.value = document.form1.secondary_lname.value;
		document.form1.registrant_title.value = document.form1.secondary_title.value;
		document.form1.registrant_add1.value = document.form1.secondary_add1.value;
		document.form1.registrant_add2.value = document.form1.secondary_add2.value;
		document.form1.registrant_city.value = document.form1.secondary_city.value;
		document.form1.registrant_state.value = document.form1.secondary_state.value;
		document.form1.registrant_zip.value = document.form1.secondary_zip.value;
		document.form1.registrant_zip4.value = document.form1.secondary_zip4.value;
		document.form1.registrant_country.value = document.form1.secondary_country.value;
		document.form1.registrant_phone1.value = document.form1.secondary_phone1.value;
		document.form1.registrant_phone2.value = document.form1.secondary_phone2.value;
		document.form1.registrant_phone3.value = document.form1.secondary_phone3.value;
		document.form1.registrant_ext.value = document.form1.secondary_ext.value;
		document.form1.registrant_fax1.value = document.form1.secondary_fax1.value;
		document.form1.registrant_fax2.value = document.form1.secondary_fax2.value;
		document.form1.registrant_fax3.value = document.form1.secondary_fax3.value;
		document.form1.registrant_email.value = document.form1.secondary_email.value;
	}
}

// Function that copies info to billing contact's fields
function billing_function()
{
	if(document.form1.billing_same[0].checked)
	{
		document.form1.billing_fname.value = document.form1.primary_fname.value;
		document.form1.billing_lname.value = document.form1.primary_lname.value;
		document.form1.billing_title.value = document.form1.primary_title.value;
		document.form1.billing_add1.value = document.form1.primary_add1.value;
		document.form1.billing_add2.value = document.form1.primary_add2.value;
		document.form1.billing_city.value = document.form1.primary_city.value;
		document.form1.billing_state.value = document.form1.primary_state.value;
		document.form1.billing_zip.value = document.form1.primary_zip.value;
		document.form1.billing_zip4.value = document.form1.primary_zip4.value;
		document.form1.billing_country.value = document.form1.primary_country.value;
		document.form1.billing_phone1.value = document.form1.primary_phone1.value;
		document.form1.billing_phone2.value = document.form1.primary_phone2.value;
		document.form1.billing_phone3.value = document.form1.primary_phone3.value;
		document.form1.billing_ext.value = document.form1.primary_ext.value;
		document.form1.billing_fax1.value = document.form1.primary_fax1.value;
		document.form1.billing_fax2.value = document.form1.primary_fax2.value;
		document.form1.billing_fax3.value = document.form1.primary_fax3.value;
		document.form1.billing_email.value = document.form1.primary_email.value;
	}
	else if(document.form1.billing_same[1].checked)
	{
		document.form1.billing_fname.value = document.form1.secondary_fname.value;
		document.form1.billing_lname.value = document.form1.secondary_lname.value;
		document.form1.billing_title.value = document.form1.secondary_title.value;
		document.form1.billing_add1.value = document.form1.secondary_add1.value;
		document.form1.billing_add2.value = document.form1.secondary_add2.value;
		document.form1.billing_city.value = document.form1.secondary_city.value;
		document.form1.billing_state.value = document.form1.secondary_state.value;
		document.form1.billing_zip.value = document.form1.secondary_zip.value;
		document.form1.billing_zip4.value = document.form1.secondary_zip4.value;
		document.form1.billing_country.value = document.form1.secondary_country.value;
		document.form1.billing_phone1.value = document.form1.secondary_phone1.value;
		document.form1.billing_phone2.value = document.form1.secondary_phone2.value;
		document.form1.billing_phone3.value = document.form1.secondary_phone3.value;
		document.form1.billing_ext.value = document.form1.secondary_ext.value;
		document.form1.billing_fax1.value = document.form1.secondary_fax1.value;
		document.form1.billing_fax2.value = document.form1.secondary_fax2.value;
		document.form1.billing_fax3.value = document.form1.secondary_fax3.value;
		document.form1.billing_email.value = document.form1.secondary_email.value;
	}
}

// Function that enables/disables distance types
function distance_function()
{
	var delivery = document.getElementsByName('delivery[]');
	var distance_type = document.getElementsByName('distance_type[]');
	if(delivery[1].checked)
	{
		distance_type[0].disabled = false;
		distance_type[1].disabled = false;
	}
	else
	{
		distance_type[0].disabled = true;
		distance_type[1].disabled = true;
	}
}

// Function that checks all state boxes
function check_states()
{
	var states = document.getElementsByName('states[]');
	if(document.form1.all_states.checked == true)
	{
		for(i = 0; i <	states.length; i++)
		{
			states[i].checked = true;
		}
	}
	else
	{
		for(i = 0; i <	states.length; i++)
		{
			states[i].checked = false;
		}
	}
}

// Function that checks to see if all_states should be checked
function check_all_states()
{
	var states = document.getElementsByName('states[]');
	i = 0;
	for(i = 0; i < states.length; i++)
	{
		if(states[i].checked == false)
		{
			document.form1.all_states.checked = false;
			document.form1.online.disabled = false;
			break;
		}
	}
	if(i == states.length)
	{
		document.form1.all_states.checked = true;
		document.form1.online.disabled = true;
	}
}

// Function that checks all engineering boxes
function check_eng()
{
	var eng_courses = document.getElementsByName('eng_courses[]');
	if(document.form1.all_eng.checked == true)
	{
		for(i = 0; i <	eng_courses.length; i++)
		{
			eng_courses[i].checked = true;
		}
	}
	else
	{
		for(i = 0; i <	eng_courses.length; i++)
		{
			eng_courses[i].checked = false;
		}
	}
}

// Function that checks/unchecks the check all engineering box
function check_all_eng()
{
	var eng_courses = document.getElementsByName('eng_courses[]');
	i = 0;
	for(i = 0; i < eng_courses.length; i++)
	{
		if(eng_courses[i].checked == false)
		{
			document.form1.all_eng.checked = false;
			break;
		}
	}
	if(i == eng_courses.length)
	{
		document.form1.all_eng.checked = true;
	}
}

// Function that checks all surveying boxes
function check_surv()
{
	var surv_courses = document.getElementsByName('surv_courses[]');
	if(document.form1.all_surv.checked == true)
	{
		for(i = 0; i <	surv_courses.length; i++)
		{
			surv_courses[i].checked = true;
		}
	}
	else
	{
		for(i = 0; i <	surv_courses.length; i++)
		{
			surv_courses[i].checked = false;
		}
	}
}

// Function that checks/unchecks the check all surveying box
function check_all_surv()
{
	var surv_courses = document.getElementsByName('surv_courses[]');
	i = 0;
	for(i = 0; i < surv_courses.length; i++)
	{
		if(surv_courses[i].checked == false)
		{
			document.form1.all_surv.checked = false;
			break;
		}
	}
	if(i == surv_courses.length)
	{
		document.form1.all_surv.checked = true;
	}
}

// Function that tabs to next field when a field is filled
function autotab(current,to){
    if (current.getAttribute && current.value.length==current.getAttribute("maxlength"))
	 {
        to.focus() 
    }
}

// Function to be run onLoad in contacts page
function contact_function()
{
	registrant_function();
	billing_function();
}

// Function that toggles an element's visbility
function show_hide(obj)
{
	var el = document.getElementById(obj);
	if(el.style.display == '') el.style.display = 'none';
	else el.style.display = '';
}

// Function that shows an element
function show(obj)
{
	var el = document.getElementById(obj);
	if(el.style.display == 'none') el.style.display = '';
}

// Function that hides an element
function hide(obj)
{
	var el = document.getElementById(obj);
	if(el.style.display == '' || el.style.display == 'block') el.style.display = 'none';
}
-->