// <script type="text/javascript">
<!--  to hide script contents from old browsers

window.onload = display_urhere;

/* 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()
{	var list; var page; var currentHref; var href; var anchorPosition;

	if (!document.getElementById)
	{	
		return true;
	}

	list = document.getElementById("navbar");
	page = list.getElementsByTagName("a");
	currentHref = document.location.href;

	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.backgroundColor = "#fff";
			page[i].style.color = "#4d5a54";
			break;
		}
	}
	
//	display_subnav_urhere();
}

/*
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);
}

/*******************************************************************************
This function sets up an email that cannot be read by spambots.
*******************************************************************************/

function email_us_info()
{	var name0 = "E-mail us"
	var name1 = "info"
	var name2 = "i_buy_nm"
	var name3 = "com"
	var addr = name1 + "@" + name2 + "." + name3
	var full = "mail" + "to:" + addr
	document.write(name0.link(full));
}

function email_your_questions_info()
{	var name0 = "E-mail your questions"
	var name1 = "info"
	var name2 = "i_buy_nm"
	var name3 = "com"
	var addr = name1 + "@" + name2 + "." + name3
	var full = "mail" + "to:" + addr
	document.write(name0.link(full));
}

function email_us_buyers()
{	var name0 = "E-mail us"
	var name1 = "buyers"
	var name2 = "i_buy_nm"
	var name3 = "com"
	var addr = name1 + "@" + name2 + "." + name3
	var full = "mail" + "to:" + addr
	document.write(name0.link(full));
}

function email_us_sellers()
{	var name0 = "E-mail us"
	var name1 = "sellers"
	var name2 = "i_buy_nm"
	var name3 = "com"
	var addr = name1 + "@" + name2 + "." + name3
	var full = "mail" + "to:" + addr
	document.write(name0.link(full));
}

function email_us_investors()
{	var name0 = "E-mail us"
	var name1 = "investors"
	var name2 = "i_buy_nm"
	var name3 = "com"
	var addr = name1 + "@" + name2 + "." + name3
	var full = "mail" + "to:" + addr
	document.write(name0.link(full));
}


/*******************************************************************************
This function changes the background of the portfolio table cells on mouseOver.
Can't remember why I don't do it with Safari.
*******************************************************************************/

function hover_bg(selection, state)
{
	
	var safari = (navigator.userAgent.indexOf('Safari') != -1);	
	if (safari)
		return;
	
	selection.style.backgroundColor = (state == 1) ? '#f0f0f0' : 'transparent';
}


// end hiding contents from old browsers  -->
// </script>