$(document).ready(function(){
	
	/*$(".menuitem").hover(
		function() {
			$(this).children("a").css("#c4bfb9");
			$(this).children(".navimage").stop(true, true);
			$(this).children(".navimage").animate({ clip: "rect(0px, 160px, 100px, 0px)", top: "-100px" }, "fast");
			$(this).children(".level2").stop(true, true);
			$(this).children(".level2").slideDown("fast");
		},
		function() {
			$(this).children("a").css("#aba49b");
			$(this).children(".navimage").stop(true, true);
			$(this).children(".navimage").animate({ clip: "rect(0px, 160px, 0px, 0px)", top: "0px" }, "fast");
			$(this).children(".level2").stop(true, true);
			$(this).children(".level2").slideUp("fast");
		}
	).click(
		function() {
			$(this).children("a").css("#aba49b");
			$(this).children(".navimage").css({ clip: "rect(0px, 160px, 0px, 0px)", top: "0px" });
			$(this).children(".level2").slideUp(1);
		}
	);

	$(".menuitem").each(function(idx, obj){
		$(obj).children(".navimage").css({ left: (idx * 160) + "px", clip: "rect(0px, 160px, 0px, 0px)" });
	});*/

$(function() {
	$('.menuitem').bind('mouseenter',function(){
		var $elem = $(this);
		$elem.find('.navimage')
			 .stop(true)
			 .animate({ clip: "rect(0px, 159px, 100px, 0px)", top: "-100px" }, "fast")
			 .andSelf()
			 .find('.level2')
			 .stop(true, true)
			 .slideDown("fast")
			 .andSelf();
	}).bind('mouseleave',function(){
		var $elem = $(this);
		$elem.find('.navimage')
			 .stop(true)
			 .animate({ clip: "rect(0px, 159px, 0px, 0px)", top: "0px" }, "fast")
			 .andSelf()
			 .find('.level2')
			 .stop(true, true)
			 .slideUp("fast");
	});

$('.level2 li').bind('mouseenter', function(){
	$('.level3', this).css('margin-top',(0-$(this).height())+'px' );
	$('.level3', this).show();

	//$('a', this).css("background-color", "#756a5f");
	$('a', parent).css("border", "1px solid red");

}).bind('mouseleave', function(){
	//$('a', parent).css("background-color", "#5D5751");
	$('.level3', this).hide();

})

;


//change color menuparent klŠder

$('.level3 li').bind('mouseenter', function(){
	$("a#klader").css("background-color", "#756a5f");

}).bind('mouseleave', function(){
	$("a#klader").css('background-color', '');
})

;



});

$(function() {
	$('.last').bind('mouseenter',function(){
		var $elem = $(this);
		$elem.find('.navimage')
			 .stop(true)
			 .animate({ clip: "rect(0px, 160px, 100px, 0px)", top: "-100px" }, "fast")
			 .andSelf()
			 .find('.level2')
			 .stop(true, true)
			 .slideDown("fast")
			 .andSelf()
	}).bind('mouseleave',function(){
		var $elem = $(this);
		$elem.find('.navimage')
			 .stop(true)
			 .animate({ clip: "rect(0px, 160px, 0px, 0px)", top: "0px" }, "fast")
			 .andSelf()
			 .find('.level2')
			 .stop(true, true)
			 .slideUp("fast");
	});
});

//disable klŠder & produkter menu parent link
$("a#klader").click(function() { return false; });
$("a#produkter").click(function() { return false; });

});



