function navActive() {
    // nav2 aktivieren:
	var lis = document.getElementsByTagName('li');
	for(var i = 0; tag = lis[i]; ++i) {
		if(tag.className.indexOf('WebYepMenuItem') > -1) {
			if(lis[i].firstChild && lis[i].firstChild.href && lis[i].firstChild.href == window.location.href) {
				nav2active(lis[i]);
				nav1active(lis[i].parentNode.parentNode)
			}
		}
		
		if(tag.className == 'navi1link') {
			if(lis[i].firstChild && lis[i].firstChild.href && lis[i].firstChild.href == window.location.href) {
				nav1active(lis[i]);
			}
		}				
	}	
}


function nav2active(theElement) {	
	theElement.style.backgroundColor = "#329610";	
}

function nav1active(theElement) {
	theElement.style.backgroundImage = "url(images/menu_auswahl.jpg)";
	//alert(theElement.childNodes.length);
	if(theElement.childNodes.length-2 > -1 && typeof(theElement.childNodes[theElement.childNodes.length-2].style) != "undefined" && theElement.childNodes.length > 1) {
		theElement.childNodes[theElement.childNodes.length-2].style.color = "#fff";
	}
	theElement.childNodes[0].style.color = "#fff";
}


$(document).ready(function(){
	$(".navi1link").hover(
		function() {
			$(this).addClass("highlight");
			$(this).children("a").addClass("highlight");
			$(this).children("ul").css("display","block");
			$(this).children("img").attr("src","images/shop_icon_aktiv.jpg");
		},
		function() {
			$(this).removeClass("highlight");
			$(this).children("a").removeClass("highlight");			
			$(this).children("ul").css("display","none");
			$(this).children("img#cart").attr("src","images/shop_icon_inaktiv.jpg");
		}
	);
	
	$("li.WebYepMenuItem").hover(
		function() {
			$(this).addClass("highlight");
		},
		function() {
			$(this).removeClass("highlight");
		}
	);
	
/*	$(".navi1link").click(function() {
			window.location.href = $(this).children("a").attr("href");
		}
	);*/
	
	$("li.WebYepMenuItem").click(function() {
			window.location.href = $(this).children("a").attr("href");
		}
	);
	
	$("a[rel]").fancybox({			
		'overlayOpacity' : '0.8',
		'overlayColor' : '#000',			
		'hideOnContentClick' : true,
		'titleShow' : false
	});		

});
