/**************************************************************************
 *                                                                        *
 *  JAVASCRIPT MENU HIGHLIGHTER v.1.5 (080929)                            *
 * --------------------------------------------                           *
 * ©2005 Media Division (www.MediaDivision.com)                           *
 *                                                                        *
 * Written by Marius Smarandoiu & Armand Niculescu                        *
 *                                                                        *
 * You are free to use, modify and distribute this file, but please keep  *
 * this header and credits                                                *
 *                                                                        *
 * Usage:                                                                 *
 * - the script will apply the .current class to the <a> and its parent   *
 *   <li> that is contained in the element with id="primarynav" and points*
 *   to the current URL                                                   *
 * - works in IE6, Firefox and Opera                                      *
 **************************************************************************/
function extractPageNameH(hrefString)
{
	var arrH = hrefString.split('/');
	//alert("arrH in extract: "+arr);
	return  (arrH.length<2) ? hrefString : arrH[arrH.length-2].toLowerCase() + arrH[arrH.length-1].toLowerCase();               
}

function setActiveMenuH(arrH, crtPageH)
{
	//alert("arrH in setmenu: "+arrH);
	//alert("crtpageH in setmenu: "+crtPageH);
	for (var i=0; i<arrH.length; i++)
	{
		if(extractPageNameH(arrH[i].href) == crtPageH)
		{
				//alert("arrH[i]"+arrH[i].href);
			if (arrH[i].parentNode.tagName != "DIV")
			{
				//alert("arrH[i] parentNode"+arrH[i].parentNode.tagName);
				arrH[i].className = "currentH";
				arrH[i].parentNode.className = "currentH";
			}
		}
	}
}

function setPageH()
{
	hrefStringH = document.location.href ? document.location.href : document.location;
	//alert(hrefString);
	if (document.getElementById("horiz_nav")!=null)
			setActiveMenuH(document.getElementById("horiz_nav").getElementsByTagName("a"), extractPageNameH(hrefStringH));	
}
