/*
$(document).ready(function(){
    var loc = window.location.toString().split("/")
    loc = loc[loc.length - 1]
	//alert(loc);
    var submenuitem = $(".menuright a[href=\""+loc+"\"]");
	
	if (submenuitem.length == 1)
	{
		//submenuitem.addClass("selected");
		submenuitem.css("color", "white");
		
		var parentItemLocation = submenuitem.attr("rel");
		//alert('parentItemlocation' + parentItemLocation);
		//$(".menuleft a[href=\""+parentItemLocation+"\"]").addClass("selected");
        $(".menuleft a[href=\""+parentItemLocation+"\"]").css("color", "white");
		
	}
	else
	{
	    //$(".menuleft a[href=\""+loc+"\"]").addClass("selected");
		$(".menuleft a[href=\""+loc+"\"]").css("color", "white");
	}
	
	
});
*/


$(document).ready(function(){
    $(" #navLeft > ul ").css({display: "none"}); // Opera Fix
    $("#navLeft li").hover(
      function(){
          $(this).addClass("hovered");
          $(this).find('ul:first').css({visibility: "visible", display: "none"}).show("150").addClass("nothovered");
      }, 
      function(){
          $(this).find('ul:first').css({visibility: "hidden"});
          $(this).removeClass("hovered");
          $(this).removeClass("nothovered");
      }
    );

    $(" #navTop > ul ").css({display: "none"}); // Opera Fix
    $("#navTop li").hover(
      function(){
          $(this).addClass("hovered");
          $(this).find('ul:first').css({visibility: "visible", display: "none"}).show("150").addClass("nothovered");
      }, 
      function(){
          $(this).find('ul:first').css({visibility: "hidden"});
          $(this).removeClass("hovered");
          $(this).removeClass("nothovered");
      }
    );

    var loc = window.location.toString().split("/")
    loc = loc[loc.length - 1];
	if ((loc.indexOf("#") == (loc.length - 1)) && (loc.length > 1))
    {
		 loc = loc.substr(0, loc.length - 1);
	} 
	
	//alert(loc);
    $("#navLeft li a[href=\""+loc+"\"]").addClass("selected");  // put class selected on specific a elements
    $("#navLeft li a[href=\""+loc+"\"]").parent().addClass("selected"); // put class selected on specific li-element to allow setting of list-style-image
	
    $("#navTop li a[href=\""+loc+"\"]").addClass("selected");
    $("#navTop li a[href=\""+loc+"\"]").parent().addClass("selected"); // put class selected on specific li-element to allow setting of list-style-image
	
	
});


