        function miniHeader() {
            if ($(window).scrollTop() > 200) {
                $("#mini_header").fadeIn(200);
            } else {
                $("#mini_header").fadeOut(200);
            }
        }
        function makeHeader() {
            if ($(window).width()>1100) {
                $("#have_tender").css("top", "13px");
                $("#have_tender").css("left", "530px");
            } else {
                $("#have_tender").css("top", "53px");
                $("#have_tender").css("left", "380px");
            }
        }
        function slidePodbor(show) {
            if (!show) {
                $(".slidesPodbor").animate({"height":"68px"}, 200, function () {})
            } else {
                $(".slidesPodbor").animate({"height":"213px"}, 200, function () {})
            }
        }
        $(document).ready(function(){
            $(window).scroll(function(){
                miniHeader();
            });
            $(window).resize(function(){
                makeHeader();
            });
            miniHeader();
            makeHeader();
            $(".slidesPodbor").scrollable({items: ".slidesPodborContainer", circular: true}).autoscroll({ autoplay: true });
            $(".product-label").each(function(){
                var xy = $(this).position().top - $(this).parent("td").position().top + 2;
                $(this).css("margin-top", "-"+xy+"px");
            });
            $(".slidetabs").tabs(".bigPics-items > .bigPics-one", {effect: 'fade',fadeOutSpeed: "slow",rotate: true}).slideshow({autoplay:true, interval: 5000});
            $("ul.catalog-element-tabs").tabs("div.panes > div", {history: true});
            $("ul.catalog-element-tabs-pageinfo").tabs("div.panes > div", {history: true});

            if ($("ul.catalog-element-tabs").length) {
                var api = $("ul.catalog-element-tabs").data("tabs");
                api.onClick(function(index) {});
            }
            $(".enlarger").mouseenter(function(){
                $(this).animate({'width':"+=20px", 'height':"+=20px", 'marginTop':"0", 'marginBottom':"0"},0);
            }).mouseleave(function(){
                $(this).animate({'width':"-=20px", 'height':"-=20px", 'marginTop':"10px", 'marginBottom':"10px"},0);
            });
            $('a.lightbox').lightBox({fixedNavigation:true,keyToClose:"ESCAPE",txtImage:"Фото",txtOf:"из"});
            $(".tab-versions h2").click(function() {
                if ($(this).next("div").next(".versions-one").css("display") == "none") {
                    $(".versions-one").slideUp();
                    $(".versions-one-preview").slideDown();
                }
                $(this).next("div").next(".versions-one").slideToggle(function () {
                    $(this).prev("div").slideToggle();
                });
            });
            $("input[name='form_radio_SIMPLE_QUESTION_448']").change(function(){
                if ($(this).attr("value") == "106") {
                    $(".showOn106").css("display","table-row");
                } else {
                    $(".showOn106").css("display","none");
                }
            });
            $("input[name='form_radio_SIMPLE_QUESTION_449']").change(function(){
                $(".showOn273").css("display","none");
                $(".showOn335").css("display","none");
                if ($(this).attr("value") == "273") {
                    $(".showOn273").css("display","table-row");
                }
                if ($(this).attr("value") == "335") {
                    $(".showOn335").css("display","table-row");
                }
            });
            $(".bycols").each(function(){
                $(this).height($(this).parent().height());
            });

            $(".orderingCall").click(function(e){
                if (e.target.className == "orderingCall") {
                    if ($(this).css("left") == "0px") {
                       $(this).animate({"left":"-350px"},"500"); 
                    } else {
                       $(this).animate({"left":"0px"},"500");
                    }
                }
            });
            $("#ordercall-form-close").click(function(){
                $(".orderingCall").animate({"left":"-350px"},"500"); 
            });
            $("a[href*='.pdf']").click(function(){
                window.location.href = "http://www.powerunit.ru/download.php?file=" + $(this).attr("href");
                return false;
            });
        });
