// functions.js - misc functions used on irell

// function that sets the containing <ul>'s class to either 'toggleOn' or 'toggleOff'
function toggleSideList( node )
{
	pNode = node;
	
	// find the parent <ul>
	while( pNode.tagName.toUpperCase() != "UL" )
	{
		pNode = pNode.parentNode;
		
		if ( pNode == null )
			return;
	}
	
	toggleSign = false;
	
	// see if we have a child <span> with a class of "toggleSign"
	for( i=0; i < node.childNodes.length; i++ )
		if( node.childNodes[i].className == 'toggleSign' )
			toggleSign = node.childNodes[i];
	
	// change the class of the <ul>
	if( pNode.className == 'toggleOn' )
	{
		pNode.className = 'toggleOff';
		
		if( toggleSign )
			toggleSign.innerHTML = '<img height="9" width="9" src="i/expand.gif" />';
	}
	else
	{
		pNode.className = 'toggleOn';
		
		if( toggleSign )
			toggleSign.innerHTML = '<img height="9" width="9" src="i/contract.gif" />';
	}
}


function homeSiteSearch()
{	
	var searchBox = document.getElementById('searchtext');
	var searchForm = document.getElementById('siteSearchForm')

	if( searchBox && searchForm && searchBox.value && searchBox.value != '' )
	{
		searchForm.submit();
		return false;
	}
}

function homeAttorneySearch()
{
	var searchBox = document.getElementById('fullname');
	var searchForm = document.getElementById('attorneySearchForm')

	if( searchBox && searchForm && searchBox.value && searchBox.value != '' )
	{
		searchForm.submit();
		return false;
	}
}


