function highlight(navid, subnavid) {
	
	if (navid) {
		if(!document.getElementById( 'nav_' + navid )) return false;
		document.getElementById( 'nav_' + navid ).className = 'current';
	}
	if (subnavid) {
		if(!document.getElementById( 'subnav_' + subnavid )) return false;
		document.getElementById( 'subnav_' + subnavid ).className = 'current';
	}
	return
}




function highlight_subnav() {
	 
	// Highlight the right subnav item by comparing the URL with
	// the href of each <a> elt in the <div id="subnav">, or by
	// using the hint if supplied as arguments[0]. The hint
	// specifies a part of the URL, useful for actions with
	// lots of paramters
	
	var this_page = document.location.href;
		
	// Remove anchor if there is one -- anything following #, including #
	this_page = this_page.replace( /\#.*/, '' );
	
	var hint = "";
	if (arguments[0]) {
		hint = arguments[0];
	}
	
	
	// Try both subnav and subnavIndent for our item to highlight
	
	var divs = [ "navbar" ];
	for (var d = 0; d < divs.length; d++) {
	
	
		if (document.getElementById(divs[d])) {
			var subnav_elts = document.getElementById(divs[d]);
			var aTags = subnav_elts.getElementsByTagName("A");
		
		 
			
			var i = 0;
			for (i = 0; i < aTags.length; i++) {
				// Is this a link?
				var elt = aTags[i]
				 
				
					if (elt.href == this_page || (hint && elt.href.indexOf(hint) != -1) ) 
					{
						elt.className = elt.className + " current_subnav";
						break;
					}
					else if (elt.href.indexOf("viewSubCategories") > 0)
					{
						//check for the other url that sub categories can end up at...
						var eltParams = elt.href.substring(elt.href.indexOf("?"), elt.href.length);
						var pageParams = this_page.substring(this_page.indexOf("?"), this_page.length);

						if (this_page.indexOf("viewReports") > 0 && (eltParams == pageParams))
						{
							elt.className = elt.className + " current_subnav";
							break;
						}
					}
					
 			}
		}
	 }
	 
		

}

setTimeout('highlight_subnav();', 1000); 
 