/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function highlight(e){ }
//highlight current page
function highlightCurrentPage(){}

jQuery(function(){

	var browser=navigator.appName;// to get browser name

	var ulx = document.getElementById('left_markermenu');//get the "ul" menu
	var currentPath = this.location.pathname.replace("/","").replace("/","");

	if((currentPath == 'Select' && isFoodGuideJs()) || currentPath == ''){
		currentPath = 'Search';
	}
        if(currentPath == 'latestfeedback'){
		currentPath = '/latest/feedback';
	}
	if(ulx != null)
	{
		var count = ulx.childNodes.length
		var li_name = 'LI';

		for(i in ulx.childNodes){//looping through the li elements inside the ul
			var li_element = ulx.childNodes[i];
			/* the following code takes the first child of the li element
				(which is the "a" tag with the link) and sets its style
				so that it is highlighted.
			note. done in two ways to support FireFox, IE
			*/
			if (browser=="Microsoft Internet Explorer"){
				if(li_element != '3'){
					var liChild = li_element.firstChild;
					if(liChild){
						var liChildHref = liChild.href;
						if(liChildHref.indexOf(currentPath) != -1){
							var a_element = li_element.firstChild;
							a_element.style.color = "#800000";
							a_element.style.height = "auto";
							a_element.style.backgroundColor = "#F8F8F8";
							a_element.style.textDecoration = "none";
							a_element.style.fontWeight = "bold";
							a_element.style.backgroundImage = "url(/img/layout/dot_orange.gif)";
						}
					}
				}

			}else{

				if(li_element.localName == li_name || li_element.localName == li_name.toLowerCase()){
					if(li_element.firstChild.getAttribute("href").indexOf(currentPath) != -1){
						var a_element = li_element.firstChild;
						a_element.setAttribute("style","BACKGROUND-POSITION: 6px 50%;FONT-WEIGHT: bold;BACKGROUND-IMAGE: url(/img/layout/dot_orange.gif);COLOR: #800000;HEIGHT: auto;BACKGROUND-COLOR: #F8F8F8;TEXT-DECORATION: none");
					}
				}
			}
		}
	}
});

