function showHide(show,element) {
	var element = document.getElementById(element);
	if (show) {
		element.style.display = '';
	}
	else {
		element.style.display = 'none';
	}
}

function UpdatePhone() 
{
	var txtFirstNum = document.getElementById('phone1');
	var txtSecondNum = document.getElementById('phone2');
	var txtThirdNum = document.getElementById('phone3');
	var txtFullPhone = document.getElementById('phone_day');
	
	var fullPhone = txtFirstNum.value;
	if (txtFirstNum.value.length>0)
	{
		fullPhone += '-';
	}
	
	fullPhone += txtSecondNum.value;
	
	if (txtSecondNum.value.length>0)
	{
		fullPhone += '-';
	}
		
	fullPhone += txtThirdNum.value;
	
	txtFullPhone.value = fullPhone;
}	

function UpdateCell() 
{
	var txtFirstNum = document.getElementById('cell1');
	var txtSecondNum = document.getElementById('cell2');
	var txtThirdNum = document.getElementById('cell3');
	var txtFullCell = document.getElementById('phone_eve');
	
	var fullCell = txtFirstNum.value;
	if (txtFirstNum.value.length>0)
	{
		fullCell += '-';
	}
	
	fullCell += txtSecondNum.value;
	
	if (txtSecondNum.value.length>0)
	{
		fullCell += '-';
	}
		
	fullCell += txtThirdNum.value;
	
	txtFullCell.value = fullCell;
}	

function UpdateHSgradDate() 
{
	var txtFirstVal = document.getElementById('gradmonth');
	var txtSecondVal = document.getElementById('gradyear');
	var txtHSgradDate = document.getElementById('hs_graddate');
	
	var hsGradDate = txtFirstVal.value;
	if (txtFirstVal.value.length>0)
	{
		hsGradDate += ' ';
	}
	
	hsGradDate += txtSecondVal.value;
	
	txtHSgradDate.value = hsGradDate;
}	

function UpdateGEDdate() 
{
	var txtFirstVal = document.getElementById('gedmonth');
	var txtSecondVal = document.getElementById('gedyear');
	var txtGEDdate = document.getElementById('GEDdate');
	
	var fullGEDdate = txtFirstVal.value;
	if (txtFirstVal.value.length>0)
	{
		fullGEDdate += ' ';
	}
	
	fullGEDdate += txtSecondVal.value;
	
	txtGEDdate.value = fullGEDdate;
}	

function UpdateExpGradDate() 
{
	var txtFirstVal = document.getElementById('expected_grad_month');
	var txtSecondVal = document.getElementById('expected_grad_year');
	var txtExpGradDate = document.getElementById('expected_grad_date');
	
	var fullExpDate = txtFirstVal.value;
	if (txtFirstVal.value.length>0)
	{
		fullExpDate += ' ';
	}
	
	fullExpDate += txtSecondVal.value;
	
	txtExpGradDate.value = fullExpDate;
}	

//Auto tabbing script

function autotab(original,destination){
if (original.getAttribute&&original.value.length==original.getAttribute("maxlength"))
destination.focus();
}


function show_help() {
	showHide(true,'help_callout');
}
function hide_help() {
	showHide(false,'help_callout');
}

function show_anotherFriend() {
	showHide(true,'friendForm2');
}
function hide_anotherFriend() {
	showHide(false,'friendForm2');
}



