        $(document).ready(function() {
            $(".wm_tab").hide();
            $(".wm_tab_2").hide();
            
            $(".wm_menu li a").click(function() {
                $(".wm_tab").hide();
                $("#"+$(this).attr("rel")).show();
                $.cookie("wm_tab",$(this).attr("rel"));
                $(this).closest("ul").find("a").removeClass("active").removeClass("pactive");
                $(this).addClass("active");
                $(this).closest("li").prev("li").find("a").addClass("pactive");
                return false;
            });
            
            $(".wm_menu_2 li a").click(function() {
                $(".wm_tab_2").hide();
                $("#"+$(this).attr("rel")).show();
                
                $(this).closest("ul").find("b").hide();
                $(this).closest("ul").find("a").show();
                var b = $(this).closest("li").find("b");
                
                if(b.length == 0) {
                    var text = $(this).closest("li").find("a").text();
                    $(this).closest("li").append("<b>" + text + "</b>");
                } 
                
                $(this).closest("li").find("a").hide();
                $(this).closest("li").find("b").show();
                
                return false;
            });
            $(".wm_menu_2 li a").eq(0).click();
            
            if($.cookie("wm_tab"))
            {
            	var pozadovana = $(".wm_menu li a[rel="+$.cookie("wm_tab")+"]");
            	
            	if(pozadovana.length > 0) {
            		pozadovana.click();
            		return
            	}
            }
            
            $(".wm_menu li a").eq(0).click();
            $(".wm_menu li a.wm_act").eq(0).click();
                
            
            
            
        });

