var currentDomain=document.location.protocol+'//'+document.location.hostname;$(function(){extLinkText='Link kieruje do zewnętrznego serwisu.';$('a[href^="http"]:not([href*="'+currentDomain+'"])').each(function(){linkText=$(this).text().trim();if(linkText<1){linkText=$(this).attr('href');} var aria=linkText+'. '+extLinkText;$(this).attr('aria-label',aria);});$('a[href^="http"]:not([href*="'+currentDomain+'"])').on('click',function(e){e.preventDefault();cofirmText=extLinkText+' Czy chcesz kontynuować?';var check=confirm(cofirmText);if(check==true){var url=$(this).attr('href');window.open(url,'_blank');}});});;$(document).ready(function(){if(!jQuery.jstree){var cookieName='tree_opened_nodes';var licz=0;var allNodes=$('.menu li');var allUlNodes=allNodes.children('ul');var openedLi=new jQuery();var openedUl=new jQuery();if($.browser.msie){var toggleBranch=function(node) {var open=node.hasClass('jstree-closed');allNodes.removeClass('jstree-open').addClass('jstree-closed');if(open){node.removeClass('jstree-closed').addClass('jstree-open');saveOpened(node,true);}else{saveOpened(node,false);} node.parents('li').removeClass('jstree-closed').addClass('jstree-open');};var reopenMenu=function() {var cookie=jQuery.cookie(cookieName);var nodes=$('a[href="'+location.pathname+'"]');if(nodes.length||cookie){var node=nodes.length?$(nodes[0].parentNode):$('#'+cookie);node.removeClass('jstree-closed').addClass('jstree-open');node.parents('li').removeClass('jstree-closed').addClass('jstree-open');}};}else{var toggleBranch=function(node) {var open=node.hasClass('jstree-closed');if(open){openedLi=node.parents('li');openedLi.push(node.get(0));openedUl=openedLi.children('ul');$('.menu .jstree-open').each(function(){var closeMe=$(this);var closeBranch=(openedLi.filter('#'+this.id).length==0);if(closeBranch){closeMe.removeClass('jstree-open').addClass('jstree-closed');closeMe.children('ul').slideUp('fast');}});node.children('ul').slideDown('fast',function(){node.removeClass('jstree-closed').addClass('jstree-open');});saveOpened(node,true);}else{var desc=node.find('li');node.children('ul').slideUp('fast',function(){node.removeClass('jstree-open').addClass('jstree-closed');desc.removeClass('jstree-open').addClass('jstree-closed');desc.children('ul').hide();});openedLi=node.parents('li');openedUl=openedLi.children('ul');saveOpened(node,false);}};var reopenMenu=function() {var cookie=jQuery.cookie(cookieName);var nodes=$('a[href="'+location.pathname+'"]');if(nodes.length||cookie){var node=nodes.length?$(nodes[0].parentNode):$('#'+cookie);var parents=node.parents('li');node.removeClass('jstree-closed').addClass('jstree-open');parents.removeClass('jstree-closed').addClass('jstree-open');openedLi=parents;openedLi.push('node');openedUl=openedLi.children('ul');}};} var saveOpened=function(node,isOpened) {var name=isOpened?node.attr('id'):'';jQuery.cookie(cookieName,name,{path:'/'});};var toggleSubmenu=function(e) {var $this=$(this);var li=$this.parent();var ins=li.children('ins');toggleBranch(li);e.preventDefault();};$('.menu-category-directory a.category, .menu-category-directory ins').click(toggleSubmenu);ile=$('#Container').find(".js_do_otwarcia").length;if(ile>0){$.each($(".js_do_otwarcia"),function(){licz++;otwieramy=$(this).attr('open_node');if(ile==licz){$("#menuelement_"+otwieramy+"").css('font-weight','bold');}else{$("#menuelement_"+otwieramy+"").css('font-weight','normal');}});} reopenMenu();}});