// <script type="text/javascript">
<!--  to hide script contents from old browsers

var delete_flag;

$(document).ready(function()
{
	$(".table-horizontal").tablesorter(
	{
		textExtraction: 'simple'
	});
	
	display_urhere();	
	//startList();
	
});

/*******************************************************************************
This function works with the CSS to implement the drop down navigation bar.
*******************************************************************************/
startList = function() 
{
	if (document.all && document.getElementById) 
	{
		navRoot = document.getElementById("dmenu");
		for (i=0; i < navRoot.childNodes.length; i++) 
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "li") 
			{
				node.onmouseover = function() 
				{
					this.className += " over";
				}
				node.onmouseout = function() 
				{
					this.className = this.className.replace(" over", "");
				}
			}
		}
	}
}

/*******************************************************************************
 This function alters the style of the navigation bar to indicate urhere.
I added code from the original to shorten the href string so that it does
not include any bookmarks (....#bookmark). Otherwise, the strings would not
match and the urhere formatting would not be applied.
******************************************************************************/

function display_urhere()
{	if (!document.getElementById)
	{	
		return true;
	}

	var list = document.getElementById("navbar");
	if (list == null)
		return;
		
	//var page = list.getElementsByTagName("a");
	var page = getElementsByClass("topmenutitle");
	var currentHref = document.location.href;

	var anchorPosition = currentHref.indexOf("#");
	if (anchorPosition >= 0)
	{	currentHref = currentHref.substring(0, anchorPosition);
	}

	currentHref = getSimpleHref(currentHref);

	for (var i = 0; i < page.length; i++)
	{	
		href = getSimpleHref(page[i].href)	
	
		if (href == currentHref)
		{	
			page[i].style.background = "#fff url(images/on_bg.gif) repeat-x top left";
			page[i].style.color = "#000";
			page[i].style.borderBottom = "none";
			break;
		}
	}
	
	//display_sidebar_urhere("sidebar-content");
}

/**************************************************************************************************
This function was added because Mac Safari does not include the directory structure
before the href, so there was never a match. This function strips the beginning directory structure
away and just leaves the end part--such as about_us.htm
**************************************************************************************************/

function getSimpleHref(s)
{	var length;
	var anchorPosition = 0;	

	while (anchorPosition >= 0)
	{	anchorPosition = s.indexOf('/');
		length = s.length;

		if (anchorPosition >= 0)
		{	s = s.substring(anchorPosition + 1, length);
		}		
	}
	
	return(s);
}


function set_delete_flag(x)
{
	delete_flag = x;
	return(true);
}

function confirm_delete(form)
{
	if (delete_flag == 1)
		return confirm('Are you sure you want to delete this member?');
}

// end hiding contents from old browsers  -->
// </script>