 /* TipTip -> code.drewwilson.com/entry/tiptip-jquery-plugin */(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"300px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="min-width:300px; min-width:300px; width:300px;"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);$(document).ready(    function(){        setMenuPatch();        changeCornersForActive();        investEvents();        ofertaPrevent();        $("#ajaxSearch_input").autoclear();        $("#ajaxSearch_input_head").autoclear();        $("#not-from").datepicker({ maxDate: new Date() });        $("#from").datepicker({ maxDate: new Date() });        $("#not-to").datepicker({ maxDate: new Date() });        $("#to").datepicker({ maxDate: new Date() });        addNote();        contactEvents();        rozwinRegulamin();        clearDataGridBorder();        contentTabsActions();//        pickDate();        kalkulator();        wycenyStart();        wycenyPaginacja();        fadeNotForm();//        checkCustomDate();        wyroznijKrok();        dystrybutorzyMenu();        $(".invest-click").tipTip({            defaultPosition: "top",            edgeOffset: 15        });        if ( $.browser.msie ) {          $('body').addClass( 'ie'+parseInt($.browser.version, 10) );        }    });$page = 0;$max = 100;/* Polish initialisation for the jQuery UI date picker plugin. *//* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */jQuery(function($){	$.datepicker.regional['pl'] = {		closeText: 'Zamknij',		prevText: '&#x3c;Poprzedni',		nextText: 'Następny&#x3e;',		currentText: 'Dziś',		monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',		'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],		monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',		'Lip','Sie','Wrz','Pa','Lis','Gru'],		dayNames: ['Niedziela','Poniedzialek','Wtorek','Środa','Czwartek','Piątek','Sobota'],		dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],		dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],		weekHeader: 'Tydz',		dateFormat: 'yy-mm-dd',		firstDay: 1,		isRTL: false,		showMonthAfterYear: false,		yearSuffix: ''};	$.datepicker.setDefaults($.datepicker.regional['pl']);}); function fadeNotForm() {//    $('#period').change(function(){//        $('#not-form').fadeTo('slow', 0.25);//        $('#not-form-period').fadeTo('slow', 1);//    });//     $('#not-from').change(function(){//        $('#not-form-period').fadeTo('slow', 0.25);//        $('#not-form').fadeTo('slow', 1);//     });//     $('#not-to').change(function(){//        $('#not-form-period').fadeTo('slow', 0.25);//        $('#not-form').fadeTo('slow', 1);//     });     $('#period').change(function(){        $('#not-form').animate({opacity:0.25},1000).addClass('semihidden');        $('#not-form-period').animate({opacity:1.00},1000, function(){	   $(this).removeAttr('filter');        }).removeClass('semihidden');    });     $('#not-from').change(function(){        $('#not-form-period').animate({opacity:0.25},1000).addClass('semihidden');        $('#not-form').animate({opacity:1.00},1000, function(){	   $(this).removeAttr('filter');        }).removeClass('semihidden');     });     $('#not-to').change(function(){        $('#not-form-period').animate({opacity:0.25},1000).addClass('semihidden');        $('#not-form').animate({opacity:1.00},1000, function(){	   $(this).removeAttr('filter');        }).removeClass('semihidden');     }); }function getFlashMovie(movieName) {    var isIE = navigator.appName.indexOf("Microsoft") != -1;    return (isIE) ? window[movieName] : document[movieName];}function setActiveElementOnMap(item){         switch(item) {         case "zachodniopomorskie-102" :            no = 1;            break;         case "pomorskie-88" :            no = 2;            break;         case "warminsko-mazurskie-100" :            no = 3;            break;         case "podlaskie-89" :            no = 4;            break;         case "lubuskie-95" :            no = 5;            break;         case "wielkopolskie-101" :            no = 6;            break;         case "kujawsko-pomorskie-97" :            no = 7;            break;         case "mazowieckie-92" :            no = 8;            break;         case "dolnoslaskie-98" :            no = 9;            break;         case "lodzkie-94" :            no = 10;            break;         case "lubelskie-96" :            no = 11;            break;         case "opolskie-91" :            no = 12;            break;         case "slaskie-87" :            no = 13;            break;         case "swietokrzyskie-86" :            no = 14;            break;         case "malopolskie-93" :            no = 15;            break;         case "podkarpackie-99" :            no = 16;            break;        }     getFlashMovie("mapa2").methodName(no);}function contactEvents(){    $(".contact-list-element").click(        function(){            clickedItem = $(this).attr("idx");            $(".contact-element:visible").hide();//.slideToggle();            $("#" + clickedItem).show();//.slideToggle();            setActiveElementOnMap(clickedItem);            return false;        }    );}function callJs(txt){    switch(txt){         case 1 :            no = "zachodniopomorskie-102";            break;         case 2 :            no = "pomorskie-88";            break;         case 3 :            no = "warminsko-mazurskie-100";            break;         case 4 :            no = "podlaskie-89";            break;         case 5 :            no = "lubuskie-95";            break;         case 6 :            no = "wielkopolskie-101";            break;         case 7 :            no = "kujawsko-pomorskie-97";            break;         case 8 :            no = "mazowieckie-92";            break;         case 9 :            no = "dolnoslaskie-98";            break;         case 10 :            no = "lodzkie-94";            break;         case 11 :            no = "lubelskie-96";            break;         case 12 :            no = "opolskie-91";            break;         case 13 :            no = "slaskie-87";            break;         case 14 :            no = "swietokrzyskie-86";            break;         case 15 :            no = "malopolskie-93";            break;         case 16 :            no = "podkarpackie-99";            break;     }    //alert(no);    //$(".contact-list-element[idx*='" + no + "']").click();    $(".contact-element:visible").hide();//.slideToggle();    $("#" + no).show();//.slideToggle();}function addNote() {    if($("body").hasClass("oferta")){        $("#note-desc").show();        $("#note-desc").click(            function(event) {                event.preventDefault();                if($("#full-note-desc").hasClass('displayed'))                {                     $("#full-note-desc").slideToggle().removeClass('displayed');                     $("#show-full-note").animate({                      "opacity": "toggle"                    }, "slow");                }                else {                     $("#full-note-desc").slideToggle().addClass('displayed');                     $("#show-full-note").animate({                      "opacity": "toggle"                    }, "slow");                }            }        );    }}function setMenuPatch() {    if($("#fnameli").length){        $($("#fnameli").html()).insertBefore("ul li.left-menu-element.first.level1");        $("#fnameli").remove();        $("ul li.left-menu-element.first.level1:nth-child(2)").removeClass("first");    }    //$("ul li.left-menu-element.first.level1").removeClass("first");}function changeCornersForActive() {    if($(".left-menu-element.last").hasClass("active")){        $(".menucorner.bl").addClass("active");        $(".menucorner.br").addClass("active");    }    if($(".left-menu-element.first").hasClass("active")){        $(".menucorner.tl").addClass("active");        $(".menucorner.tr").addClass("active");    }}function investEvents() {    $(".invest-title").toggle(        function(){            $(this).addClass("down");            $(this).parent().find(".invest-content").slideDown();        },        function(){            $(this).removeClass("down");            $(this).parent().find(".invest-content").slideUp();        }    );}function ofertaPrevent() {    $("#main-menu-oferta").toggle(        function() {            $("#oferta-menu").slideDown();            return false;        },        function() {            $("#oferta-menu").slideUp();            return false;        }    );}function rozwinRegulamin() {    $("#regulamin").toggle(        function() {            $("#formularz-kontaktowy").slideDown();            return false;        },        function() {            $("#formularz-kontaktowy").slideUp();            return false;        }    );}function clearDataGridBorder() {    $('.datagrid tr td:last-child').css('border-right','0');    $('.datagrid tr th:last-child').css('border-right','0');    $('.datagrid tr:last-child td').css('border-bottom','0');}function contentTabsActions() {    $si = 0;    $(".content-tab-navi").click(        function() {            if ($si == 0) {                var no = Math.round($(".content-tab-navi").index(this) + 1);                $si = 1;                $(".content-tab-navi").removeClass("active");                $(this).addClass("active");                $(".content-tab:visible").removeClass("active").fadeOut('100');                $tmpheight = $(".content-tab:nth-child(" + no + ")").height();                $("#subcontent-tabcontent").animate( {height: $tmpheight}, 500 , function () {                    $(".content-tab:nth-child(" + no + ")").addClass("active").fadeIn('100', function () {                        $si = 0;                    });                });            }        }    );    $(".content-tab-navi:nth-child(1)").click();}function checkFreeDays($datetocheck) {    $tmp = Date.parse($datetocheck);    var $d = new Date();    $d.setTime($tmp);    if ($d.getDay() == "0") {        $d.setTime($d.getTime()+86400);    }    if ($d.getDay() == "6") {        $d.setTime($d.getTime()-86400);    }        return $d.getFullYear()+"-"+((($d.getMonth()+1)<10)? "0" + ($d.getMonth()+1) : ($d.getMonth()+1))+"-"+(($d.getDate()<10)? "0" + $d.getDate() : $d.getDate());}function pickDate() {    $('#period').change(function() {        var $fromtime = new Date();        var $today = new Date();//         switch($(this).val()){//         case '1' ://            $fromtime.setDate($today.getDate()-30);//            break;//         case '3' ://            $fromtime.setDate($today.getDate()-90);//            break;//         case '6' ://            $fromtime.setDate($today.getDate()-182);//            break;//         case '12' ://            $fromtime.setDate($today.getDate()-365);//            break;//         case 'all' ://           $fromtime.setFullYear(2001,0,14);//            break;//        }        if($(this).val()!=='all') {            $fromtime.setMonth($today.getMonth()-$(this).val());        }        $('#not-to').val($today.getFullYear()+"-"+((($today.getMonth()+1)<10)? "0" + ($today.getMonth()+1) : ($today.getMonth()+1))+"-"+(($today.getDate()<10)? "0" + $today.getDate() : $today.getDate()));        if(!$.browser.msie) { $('#not-to').change(function() {$(this).val(checkFreeDays($(this).val()));}); }        $('#not-from').val($fromtime.getFullYear()+"-"+((($fromtime.getMonth()+1)<10)? "0" + ($fromtime.getMonth()+1) : ($fromtime.getMonth()+1))+"-"+(($fromtime.getDate()<10)? "0" + $fromtime.getDate() : $fromtime.getDate()));        if(!$.browser.msie) { $('#not-from').change(function() {$(this).val(checkFreeDays($(this).val()));}); }                if ($(this).val()=='all') {            $('#not-from').val($('#begin').val());        }    });        if(!$.browser.msie) {     $('#not-to').change(function() {$(this).val(checkFreeDays($(this).val()));});     $('#not-from').change(function() {$(this).val(checkFreeDays($(this).val()));});     $('#from').change(function() {$(this).val(checkFreeDays($(this).val()));});     $('#to').change(function() {$(this).val(checkFreeDays($(this).val()));});    }}function kalkulator() {$('#symulator-pso-submit').click(function(event) {        event.preventDefault();       var $err = 0;       var $err_msg = "";       $('#symulator-pso input').each(function() {           if($(this).attr('id') == 'amount8' && $(this).val() != "" && ($(this).val() > 70 || $(this).val() < 1)) {               $err = 1;               $err_msg += '<p class=\"alert\">Liczba lat w których odprowadzana jest składka do PSO powinna mieścić się w przedziale 1-70lat</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount9' && $(this).val() != "" && ($(this).val() > 3000 || $(this).val() < 100)) {               $err = 1;               $err_msg += '<p class=\"alert\">Wysokość pierwszej składki powinna mieścić się w przedziale 100-3000zł</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount10' && $(this).val() != "" && ($(this).val() > 3000 || $(this).val() < 50)) {               $err = 1;               $err_msg += '<p class=\"alert\">Wysokość miesięcznych wpłat powinna mieścić się w przedziale 50-3000zł</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount11' && $(this).val() != "" && ($(this).val() > 100 || $(this).val() < 0)) {               $err = 1;               $err_msg += '<p class=\"alert\">Wysokośc opłaty manipulacyjnej powinna mieścić się w przedziale 0-100%</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount12' && $(this).val() != "" && ($(this).val() > 100 || $(this).val() < 0)) {               $err = 1;               $err_msg += '<p class=\"alert\">Zakładany roczny wzrost wartości jednostki uczestnictwa powinien mieścić się w przedziale 0-100%</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if ($(this).val() == "") {               $('#label-'+$(this).attr('id')).css('color','#FF0000');               $err = 1;           } else {               $('#label-'+$(this).attr('id')).removeAttr('style');           }       });        $.post("kalkulator.php", $("#symulator-pso").serialize(), function(data){           $('#obliczenia').html(data);         });       if ($err == 0) {           $('#obliczenia').show();           $('#obliczenia-err').hide().html('<p class=\"alert\">Wystąpił błąd. Prosze uzupełnić wszystkie pola.</p>');       } else {           $('#obliczenia').hide();           $('#obliczenia-err').html('<p class=\"alert\">Wystąpił błąd. Prosze uzupełnić wszystkie pola.</p>' + $err_msg).show();       }     });     $('#symulator-ppe-submit').click(function(event) {        event.preventDefault();       var $err = 0;       var $err_msg = "";       $('#symulator-ppe input').each(function() {           if($(this).attr('id') == 'amount1' && $(this).val() != "" && ($(this).val() > 30000 || $(this).val() < 1500)) {               $err = 1;               $err_msg += '<p class=\"alert\">Wysokość miesięcznych zarobków powinna mieścić się w przedziale 1500-30000zł</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount2' && $(this).val() != "" && ($(this).val() > 7 || $(this).val() < 0)) {               $err = 1;               $err_msg += '<p class=\"alert\">Wysokość składki podstawowej powinna mieścić się w przedziale 0-7%</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount3' && $(this).val() != "" && ($(this).val() > 3000 || $(this).val() < 0)) {               $err = 1;               $err_msg += '<p class=\"alert\">Wysokość składki dodatkowej powinna mieścić się w przedziale 0-3000zł</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount4' && $(this).val() != "" && ($(this).val() > 70 || $(this).val() < 1)) {               $err = 1;               $err_msg += '<p class=\"alert\">Liczba lat w których odprowadzana jest składka do PPE powinna mieścić się w przedziale 1-70lat</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount5' && $(this).val() != "" && ($(this).val() > 30 || $(this).val() < 0.5)) {               $err = 1;               $err_msg += '<p class=\"alert\">Zakładany roczny wzrost wartości jednostki uczestnictwa powinien mieścić się w przedziale 0.5-30%</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount6' && $(this).val() != "" && ($(this).val() > 30 || $(this).val() < 0)) {               $err = 1;               $err_msg += '<p class=\"alert\">Roczna waloryzacja wynagrodzenia powina mieścić się w przedziale 0-30%</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if($(this).attr('id') == 'amount7' && $(this).val() != "" && ($(this).val() > 50 || $(this).val() < 1)) {               $err = 1;               $err_msg += '<p class=\"alert\">Ilość lat w jakich ma być wypłacane miesięczne świadczenie z PPE powinno mieścić się w przedziale 1-50lat</p>';               $('#label-'+$(this).attr('id')).css('color','#FF0000');           } else if ($(this).val() == "") {               $('#label-'+$(this).attr('id')).css('color','#FF0000');               $err = 1;           } else {               $('#label-'+$(this).attr('id')).removeAttr('style');           }       });        $.post("kalkulator.php", $("#symulator-ppe").serialize(), function(data){           $('#obliczenia').html(data);         });       if ($err == 0) {           $('#obliczenia').show();           $('#obliczenia-err').hide().html('<p class=\"alert\">Wystąpił błąd. Prosze uzupełnić wszystkie pola.</p>');       } else {           $('#obliczenia').hide();           $('#obliczenia-err').html('<p class=\"alert\">Wystąpił błąd. Prosze uzupełnić wszystkie pola.</p>' + $err_msg).show();       }     });    $('#obliczenia-submit').click(function(event) {       event.preventDefault();       var $err = 0;       $('#oplaty-form input').each(function() {           if ($(this).val() == "") {               $('#label-'+$(this).attr('id')).css('color','#FF0000');               $err = 1;           } else {               $('#label-'+$(this).attr('id')).removeAttr('style');           }       });       $.post("kalkulator.php", $("#oplaty-form").serialize(), function(data){           $('#obliczenia').html(data);         });       if ($err == 0) {           $('#obliczenia').show();           $('#obliczenia-err').hide();       } else {           $('#obliczenia').hide();           $('#obliczenia-err').show();       }       $tmpheight = $(".content-tab.active").height();       $("#subcontent-tabcontent").animate( {height: $tmpheight}, 500);    });    $('#obliczenia-stopa-submit').click(function(event) {       event.preventDefault();        var $err = 0;       $('#stopa-form input').each(function() {           if ($(this).val() == "") {               $('#label-'+$(this).attr('id')).css('color','#FF0000');               $err = 1;           } else {               $('#label-'+$(this).attr('id')).removeAttr('style');           }       });       $.post("kalkulator.php", $("#stopa-form").serialize(), function(data){           $('#obliczenia-stopa').html(data);         });       if ($err == 0) {           $('#obliczenia-stopa').show();           $('#obliczenia-stopa-err').hide();       } else {           $('#obliczenia-stopa').hide();           $('#obliczenia-stopa-err').show();       }       $tmpheight = $(".content-tab.active").height();       $("#subcontent-tabcontent").animate( {height: $tmpheight}, 500);    });}function wycenyStart() {    wycenyLoad();}function wycenyPaginacja() {    $('.wycnav').click(function(event){        event.preventDefault();        if ($(this).attr('id') == 'prev' && $page > 0) {            $page--;            wycenyLoad();        }                if ($(this).attr('id') == 'next' && $page < $max) {            $page++;            wycenyLoad();        }    });}function wycenyLoad() {    $("#wycenycontent").load("snippets/notowania_ajaxdata.php", { 'start': $('#not-from').val(), 'stop': $('#not-to').val(), 'page': $page, 'type': $('.targetfio').attr('id')  }, function(){        $("#subcontent-tabcontent").animate( {height: $(".content-tab:nth-child(1)").height()}, 500);    });}function checkCustomDate() {    $("#period").change(function(){        $("#is_custom").val("no");        $('#print-link').attr('href',$('#print-link').attr('url_source')+'&is_custom=no');    });    $("#not-to").change(function(){        $("#is_custom").val("yes");        $('#print-link').attr('href',$('#print-link').attr('url_source')+'&is_custom=yes');    });    $("#not-from").change(function(){        $("#is_custom").val("yes");        $('#print-link').attr('href',$('#print-link').attr('url_source')+'&is_custom=yes');    });} function wyroznijKrok() {     var url = $.url();     if(url.attr('fragment') != "") {         $('#' + url.attr('fragment')).addClass('blokspecjalny');     } } function dystrybutorzyMenu() {    $('a[rel="rozwijalne"]').click(function(event){        event.preventDefault();        if($(this).next().is('ul:hidden')) {            $(this).next().show();        } else {            $(this).next().hide();        }    }); }// JQuery URL Parser plugin - https://github.com/allmarkedup/jQuery-URL-Parser// Written by Mark Perkins, mark@allmarkedup.com// License: http://unlicense.org/ (i.e. do what you want with it!);(function($, undefined) {    var tag2attr = {        a       : 'href',        img     : 'src',        form    : 'action',        base    : 'href',        script  : 'src',        iframe  : 'src',        link    : 'href'    },	key = ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"], // keys available to query	aliases = { "anchor" : "fragment" }, // aliases for backwards compatability	parser = {		strict  : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs		loose   :  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs	},	querystring_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g, // supports both ampersand and semicolon-delimted query string key/value pairs	fragment_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g; // supports both ampersand and semicolon-delimted fragment key/value pairs	function parseUri( url, strictMode )	{		var str = decodeURI( url ),		    res   = parser[ strictMode || false ? "strict" : "loose" ].exec( str ),		    uri = { attr : {}, param : {}, seg : {} },		    i   = 14;		while ( i-- )		{			uri.attr[ key[i] ] = res[i] || "";		}		// build query and fragment parameters		uri.param['query'] = {};		uri.param['fragment'] = {};		uri.attr['query'].replace( querystring_parser, function ( $0, $1, $2 ){			if ($1)			{				uri.param['query'][$1] = $2;			}		});		uri.attr['fragment'].replace( fragment_parser, function ( $0, $1, $2 ){			if ($1)			{				uri.param['fragment'][$1] = $2;			}		});		// split path and fragement into segments        uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');        uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');        // compile a 'base' domain attribute        uri.attr['base'] = uri.attr.host ? uri.attr.protocol+"://"+uri.attr.host + (uri.attr.port ? ":"+uri.attr.port : '') : '';		return uri;	};	function getAttrName( elm )	{		var tn = elm.tagName;		if ( tn !== undefined ) return tag2attr[tn.toLowerCase()];		return tn;	}	$.fn.url = function( strictMode )	{	    var url = '';	    if ( this.length )	    {	        url = $(this).attr( getAttrName(this[0]) ) || '';	    }        return $.url( url, strictMode );	};	$.url = function( url, strictMode )	{	    if ( arguments.length === 1 && url === true )        {            strictMode = true;            url = undefined;        }        strictMode = strictMode || false;        url = url || window.location.toString();        return {            data : parseUri(url, strictMode),            // get various attributes from the URI            attr : function( attr )            {                attr = aliases[attr] || attr;                return attr !== undefined ? this.data.attr[attr] : this.data.attr;            },            // return query string parameters            param : function( param )            {                return param !== undefined ? this.data.param.query[param] : this.data.param.query;            },            // return fragment parameters            fparam : function( param )            {                return param !== undefined ? this.data.param.fragment[param] : this.data.param.fragment;            },            // return path segments            segment : function( seg )            {                if ( seg === undefined )                {                    return this.data.seg.path;                }                else                {                    seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end                    return this.data.seg.path[seg];                }            },            // return fragment segments            fsegment : function( seg )            {                if ( seg === undefined )                {                    return this.data.seg.fragment;                }                else                {                    seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end                    return this.data.seg.fragment[seg];                }            }        };	};})(jQuery);
