// JavaScript Document for College Online Application Templates

// Function Show(id)
// Display a currently hidden table where ID Element is referred by parameter 'id'

function show(id)
{
	if (document.getElementById(id).style.display == 'none')
	{
		document.getElementById(id).style.display = '';
	}
}


// Function Show(id)
// Hide a table where ID Element is referred by parameter 'id'

function hide(id)
{
	document.getElementById(id).style.display = 'none';
}

// Function otherEducationList
// Hide and show tables based on selection from dropdown list
// Used by non-College and non-HS applicants to determine last school attended as a student
// and education level acheived.

function otherEducationList(listValue)
{
	if (listValue.selectedIndex == 0)
	{
		hide('otherCollInfo');
		hide('otherHSInfo');
	}
	
	else if (listValue.selectedIndex == 1)
	{
		hide('otherCollInfo');
		show('otherHSInfo');
	}
	
		else
	{ 
		show('otherCollInfo');
		hide('otherHSInfo');
	}
} 

// Function emergencyContactList
// Hide and show tables based on selection from dropdown list
// If "Mother" selected, show table to collect "Father" information
// If "Father" selected, show table to collect "Mother" information
// If "Guardian" selected, hide Father and Mother tables
// If "Other" selected, get specific relationship. If College or HS Applicant, show Father and Mother information.

function emergencyContactList(listValue)
{
	if (listValue.selectedIndex == 0)
	{
		hide('otherInfo');
		hide('motherInfo');
		hide('fatherInfo');
	}
	
	else if (listValue.selectedIndex == 1)
	{
		hide('otherInfo');
		hide('motherInfo');
		show('fatherInfo');
	}
	
	else if (listValue.selectedIndex == 2)
	{
		hide('otherInfo');
		show('motherInfo');
		hide('fatherInfo');
	}
	
	else if (listValue.selectedIndex == 3)
	{
		hide('otherInfo');
		hide('motherInfo');
		hide('fatherInfo');
	}
	
	else
	{ 
		show('otherInfo');
		show('motherInfo');
		show('fatherInfo');
	}
} 