
function template_adjustHeaderLinks()
{
	var activeLink = null;
	var children = document.getElementById("top_links").childNodes;
	for( var i in children)
	{
		if( children[i].tagName == 'A' )
		{
			var linkFile = children[i].href.replace(/(.*)\/([^\/]+)$/gi,"$2" );
			linkFile = linkFile.toLowerCase();
			if( 
				( !activeLink && linkFile == "index.htm" && document.location.href.toLowerCase().indexOf(".htm") == -1)
				|| ( !activeLink && document.location.href.toLowerCase().indexOf( linkFile ) != -1 ) )
			{
				// change the classname
				activeLink = children[i];
				children[i].className = "active";
				children[i].href="javascript:;";
				children[i].onmousedown="blur()";
			}
			else
			{
				//change the background image
				children[i].overimg = "url('../img/template/top_buttons_active_background.gif')";
				children[i].outimg = children[i].style.backgroundImage;

				children[i].onmouseenter = function()
				{
					this.style.backgroundImage = this.overimg;
				}
				children[i].onmouseover = function()
				{
					this.style.backgroundImage = this.overimg;
				}
				children[i].onmouseleave = function()
				{
					this.style.backgroundImage = this.outimg;
				}
				children[i].onmouseout = function()
				{
					this.style.backgroundImage = this.outimg;
				}
			}
		}
	}
}