var longRef = "document.forms.form";

function displayOrHideFormSection(formSection)
{
	if (document.getElementById(formSection).style.display == 'block')
	{
		hideFormSection(formSection);
	}
	else
	{
		displayFormSection(formSection);
	}
}
	
function displayOrHideFormRow(formRow)
{
	var curDate = new Date();
	var currentTimestamp = curDate.getTime();
	if ( (currentTimestamp - lastTimestamp) > 400)
	{
		if ((document.getElementById(formRow).style.display == 'table-row')||(document.getElementById(formRow).style.display == ''))
		{
			hideFormRow(formRow);
		}
		else
		{
			displayFormRow(formRow);
		}
		lastTimestamp = currentTimestamp;
	}
}

function changeRow(nameRow, bioRow)
{
	if (document.getElementById(nameRow).style.display == 'block')
	{
		hideFormRow(nameRow);
		displayFormRow(bioRow);
	}
	if (document.getElementById(nameRow).style.display == 'none')
	{
		hideFormRow(bioRow);
		displayFormRow(nameRow);
	}
}


function displayFormSection(formSection)
{
	document.getElementById(formSection).style.display = 'block';
}

function displayFormRow(formRow)
{   
    // set to default for browser.
    // Mozilla will interpret this as 'table-row'
    // IE will interpret this as block 
    // (IE does not support 'table-row' as a display value)
	document.getElementById(formRow).style.display = '';
	document.getElementById(formRow).style.border = '0px solid red';
}

function hideFormSection(formSection)
{
	document.getElementById(formSection).style.display = 'none';
}
	
function hideFormRow(formRow)
{
	document.getElementById(formRow).style.display = 'none';
}

function displayOrHideBorderRow(formCell)
{
	if (document.getElementById(formCell).style.borderBottomWidth == '0px')
	{
		displayBorderRow(formCell);
	}
	else
	{
		hideBorderRow(formCell);
	}
}

function displayBorderRow(formCell)
{
	document.getElementById(formCell).style.borderBottomWidth='1px';
	document.getElementById(formCell).style.borderBottomStyle='dotted';
	document.getElementById(formCell).style.borderBottomColor='#D6D6D6';
}

function hideBorderRow(formCell)
{
	document.getElementById(formCell).style.borderBottomWidth='0px';
}

var searchStr = 'Search This Site';

function cleanSASearch() 
{
	document.search.query.onfocus = function() {if (this.value == searchStr) this.value = ''};
	document.search.query.onblur = function() {if (this.value == '') this.value = searchStr};
}

var searchStr = 'Search This Site';
	
addEvent(window, "load", cleanSearch, false);
addEvent(window, "load", function() {enableDropdown('utilities')}, false);
addEvent(window, "load", function() {enableDropdown('nav')}, false);

function changeImage(formSection, img_id)
{
	if (document.getElementById(formSection).style.display == 'block')
	{
		
	    document.getElementById(img_id).src = '../images/btn.collapse.bio.gif';
	}
	else
	{
	    document.getElementById(img_id).src = '../images/btn.expand.bio.gif';
	}
}


function changeText(formSection, img_id)
{
	if (document.getElementById(formSection).style.display == 'block')
	{
		
	    document.getElementById(img_id).src = '../images/btn.collapse.gif';
	}
	else
	{
	    document.getElementById(img_id).src = '../images/btn.expand.gif';
	}
}


function changeRsvpBtn(formSection, img_id)
{
	if (document.getElementById(formSection).style.display == 'block')
	{
		
	    document.getElementById(img_id).src = '../images/btn.rsvp.gray.gif';
	}
	else
	{
	    document.getElementById(img_id).src = '../images/btn.rsvp.orange.gif';
	}
}