function ScreenWorkspace(){  if(window.innerWidth){    x = window.innerWidth;    y = window.innerHeight;  }   else if(document.documentElement && document.documentElement.clientWidth){    x= document.documentElement.clientWidth;    y = document.documentElement.clientHeight;  }   else if(document.body && document.body.clientWidth){    x = document.body.clientWidth;    y = document.body.clientHeight;  };};  function imgResizer(){         if((x>1220)&&($('.cat_nav_header').hasClass('open'))) {        $('.inner_body').css({'margin-left':'217px','padding-bottom':'10px'});        $('.dowloads, table.tech_descr, .float_left, .about_item').css({'margin-left':'217px','padding-bottom':'10px'});        $('.cat_nav').css('display','block');           $('.cat_nav_header').find('.btn_full_cat').html('<span class="bfc_arrow"></span>Каталог');        $('.cat_nav').addClass('olla');            $('a.btn_full_cat').bind('click', function(){            if($('.cat_nav').hasClass('olla')){              $('.cat_nav').removeClass('olla');              $('.inner_body').css({'margin-left':'0px','padding-bottom':'10px'});              $('.dowloads, table.tech_descr, .float_left, .about_item').css({'margin-left':'0px','padding-bottom':'10px'});              $('.cat_nav').css('display','none');                        $('.cat_nav_header').find('.btn_full_cat').html('<span class="bfc_arrow"></span>Каталог');        } else{                $('.cat_nav').addClass('olla');                $('.inner_body').css({'margin-left':'217px','padding-bottom':'10px'});                $('.dowloads, table.tech_descr, .float_left, .about_item').css({'margin-left':'217px','padding-bottom':'10px'});                $('.cat_nav').css('display','block');                   $('.cat_nav_header').find('.btn_full_cat').html('<span class="bfc_arrow"></span>Каталог');                }        });                                 }        else if(x<1220){            $('.inner_body').css({'margin-left':'0px','padding-bottom':'10px'});            $('.dowloads, table.tech_descr, .float_left, .about_item').css({'margin-left':'0px','padding-bottom':'10px'});                        };             };      $(document).ready(function(){        $('.table tr:odd').addClass('odd');        $('.table tr:even').addClass('even');        $('.table th:odd').addClass('odd');        $('a.free_call[href^=#]').click(function() {    var popID = $(this).attr('rel'); //Get Popup Name    var popURL = $(this).attr('href'); //Получить Popup HREF и определить размер    //Запрос и  Переменные от HREF URL    var query= popURL.split('?');    var dim= query[1].split('&');    var popWidth = dim[0].split('=')[1]; //Возвращает первое значение строки запроса    // Добавить кнопку "Закрыть" в наше окно, прописываете прямой путь к картинке    $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('');    $('#form').css('display','block');     $('#headmessage').html('Если вы хотите, что бы наши менеджеры позвонили Вам, укажите <br>Ваше имя и телефон:');    $('#user_name > input').attr('value','');    $('#user_phone > input').attr('value','');    $('#text').val('');    $('.innercallbody').css('height','350px');    //Определяет запас на выравнивание по центру (по вертикали по горизонтали)мы добавим 80px к высоте / ширине, значение полей вокруг содержимого (padding) и ширину границы устанавливаем в CSS    var popMargTop = ($('#' + popID).height() + 80) / 2;    var popMargLeft = ($('#' + popID).width() + 80) / 2;    //Устанавливает величину отступа на Popup    $('#' + popID).css({        'margin-top' : -popMargTop,        'margin-left' : -popMargLeft    });   //Fade in Background    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.    $('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Постепенное исчезание слоя - .css({'filter' : 'alpha(opacity=80)'}) используется для фиксации в IE , фильтр для устранения бага тупого IE    return false;});//Закрыть всплывающие окна и Fade слой$('a.callclose, #fade').live('click', function() { //When clicking on the close or fade layer...    $('#fade , .popup_block').fadeOut(function() {        $('#fade').remove();  //fade them both out    });    return false;});        $(window).resize(function(){        imgResizer();    });       ScreenWorkspace();    imgResizer();        $('.td_overlay').each(function(){        tdHeight = $(this).parent().height() - 35;        $(this).css("height",tdHeight);    })    $('.tabs ul a').click(function() {        $('.tabs ul a').parent().removeClass('active');        $(this).parent().addClass('active');    });     $('.catalog_list td').hover(                                         function() {                        $(this).find('.image_link').css('opacity',0.1);                                               $(this).find('.marker').css('opacity',0.1);                                                $(this).find('.onk').css('display','block');                                                         },            function() {                        $(this).find('.image_link').css('opacity',1);                                                $(this).find('.marker').css('opacity',1);                                                $(this).find('.onk').css('display','none');                                                                                                                         }        );     $('.catalog_list_item td').hover(                                         function() {                        $(this).find('.image_link').children('img').show();                        $(this).find('.marker').show();                                                $(this).find('.markerclose').show();                        $(this).find('.image_link').children('span').css("display","block");                        $(this).find('.image_link').css("text-align","left");             },             function() {                        $(this).find('.image_link').children('span').hide();                        $(this).find('.image_link').children('img').show();                        $(this).find('.image_link').css("text-align","center");                        $(this).find('.marker').show();                                                $(this).find('.markerclose').hide();                }         );                                  $('.tabs ul a').click(function() {        $('.tabs ul a').parent().removeClass('active');        $(this).parent().addClass('active');    });    $('.funy_btns a').click(function() {        if ($(this).hasClass('active'))                $(this).removeClass('active');            else                $(this).addClass('active');        });    jQuery('#mycarousel').jcarousel({    vertical: true,    scroll: 1   // Configuration goes here   });    jQuery('#mycarousel_round').jcarousel({    horizontal: true,    scroll: 1   // Configuration goes here   });     jQuery('#mycarousel1').jcarousel({        vertical: true,        scroll: 1   // Configuration goes here       }); //  $("ul#mycarouselLeft li a.foto").bind("mouseover", function(){ $(this).find('.bg_item').css("display", "none");                                                         var thisId = $(this).attr("id"); $("#thisId").css("display", "none"); previewId = thisId.replace("s", ""); $('.img-content').css("display", "none"); $("#"+previewId).css("display", "block");     return false; }); $(".zoom").css("display", "none"); $("ul#mycarouselLeft li a.foto").bind("mouseout", function(){ $(this).find('.bg_item').css("display", "block");   $(".zoom").css("display", "none"); return false; });// $("ul#mycarouselLeft li a.video").bind("mouseover", function(){//// $(".zoom").css("display", "none");//// $(this).find('.bg_item').css("display", "none");//// var thisId = $(this).attr("id");//// $("#thisId").css("display", "none");//// $("#thisId").find('.bg_item').css("background", "none");//// previewId = thisId.replace("s", "");//// $('.img-content').css("display", "none");//// $("#"+previewId).css("display", "block");   //// return false;//// });// $("ul#mycarouselLeft li a.video").bind("mouseout", function(){//// $(this).find('.bg_item').css("display", "block");//// return false;//// }); $(".img-content, .big_zoom").bind("mouseover", function(){ $(".zoom").css("display", "block");  return false; }); $(".big_item").bind("mouseout", function(){     $(".zoom").css("display", "none");     }); $(".img-content, .big_zoom").bind("mouseover", function(){     $(".zoom").css("display", "block");      return false;     });     $(".big_item").bind("mouseout", function(){         $(".zoom").css("display", "none");         }); $(".min_video a").click(function(){     var thisId = $(this).attr("id");     var videoTitle = $(this).children('img').attr('title')     previewId = thisId.replace("s", "");     $('.show').css("display", "none");     $("#"+previewId).css("display", "block");     $('.video_item h2 span').html(videoTitle)     return false; }); /*$('.change a').bind("click", function(){ if($(this).hasClass("active")) { $(this).removeClass("active");$(this).find(".libra").removeClass('libimage');$(this).children('span').html("К сравнению"); }; else { $(this).addClass("active");$(this).find(".libra").addClass('libimage');$(this).children('span').html("Из сравнения");} });*/$('#accordion h5').click(      function() {        $(this).toggleClass('opened');        $(this).next('div').slideToggle(200);    });    $('#accordion .move_all').click(      function() {        if ($(this).hasClass('open_all')){        $('#accordion h5').addClass('opened');        $('#accordion .faq_answer').slideDown(200);        $(this).removeClass('open_all');        $(this).addClass('close_all');        $(this).children('a').html('Закрыть все');        }        else{               $('#accordion h5').removeClass('opened');        $('#accordion .faq_answer').slideUp(200);        $(this).removeClass('close_all');        $(this).addClass('open_all');        $(this).children('a').html('Открыть все');        }    });$("li.thumbnail> a, li.thumbnail_left> a").bind("mouseover", function(){ $(this).parent().find('.poplist').css("visibility", "visible");  });  $("li.thumbnail>a, li.thumbnail_left> a").bind("mouseout", function(){ $(this).parent().find('.poplist').css("visibility", "hidden");  });  var flText = false;if ($(".about").height() < 27) {$(this).css({'height':'27px','padding-bottom':'0px'});$(this).find('.btabout').hide();}else {$(".about").css({'overflow':'hidden', 'height':'27px', 'padding-bottom':'0px', 'padding-right':'20px'});$(".show_about").click(function() {if(!flText) {$(this).parent().parent().css({'overflow':'none', 'height':'100%',  'font-size':'12px', 'color':'#666', 'padding-right':'20px'});$(this).parent().parent().css({'padding-top': '5px', 'padding-bottom':'7px'});$(this).html('<<');flText = true;}else {$(this).parent().parent().css({'overflow':'hidden', 'height':'27px', 'padding':'0px',  'font-size':'11px', 'color':'#666', 'padding-right':'20px'});$(this).html('>>');flText = false;}});}  /* if ($(".about").hasClass('autlook'){    $(this).parent().parent().parent().css('width','0px');      $('td.firstcol, td.sekcol').css('width','50%');      };    */ $('.table.basket-tl tr').bind('mouseover', function(){    $(this).addClass('bez');  });  var flagText = false;if ($(".hiddenDescription").height() < 67) {$(".hiddenDescription").css({'height':'60px','padding-bottom':'0px'});$(".description").hide();}else {$(".hiddenDescription").css({'overflow':'hidden', 'height':'67px', 'padding-bottom':'0px'});$(".showAllButton span").click(function() {    if($(this).hasClass("open")){        $(this).removeClass("open");        $(".showAllButton span").html("Показать описание");        $(".hiddenDescription").css({'overflow':'hidden', 'height':'67px', 'padding-bottom':'0px'});    }        else{        $(".hiddenDescription").css({'overflow':'visible', 'height':'100%'});        $(".showAllButton span").html("Свернуть").addClass('open');         var position = $(this).position();           $(".item_this").css('background-position',position);    };        // позиционирование бекграунда    elPosition = $(this).parent().position();     if(typeof(elPosition) != "undefined")    {        var ua = $.browser;        if ($.browser.msie  && parseInt($.browser.version, 10) === 7)            shiftPos = 160;        else            shiftPos = 166;                          topPosition = elPosition.top;        topPosition = parseInt(topPosition);        topPosition -= shiftPos;         topPosition  = topPosition < 0 ? 0 : topPosition;                topPosition = topPosition + "px";        $('.content_center .item_this').css({backgroundPosition: "100% " + topPosition});    }        return false;});}  $(".taste >a").bind("mouseover", function(){ $(".taste .star").css('background-position', '0 -29px');  });  $(".taste >a").bind("mouseout", function(){ $(".taste .star").css('background-position', '0 0px');  });  $(".taste >a").bind("mouseout", function(){ $(".taste .climage").css('background-position', '0 -57px');  });$(".taste >a").bind("mouseover", function(){ $(".taste .climage").css('background-position', '0 -57px');  });$(".change>a").bind("mouseover", function(){$(this).find(".libra").css('background-position', '0 -29px');  });  $(".change >a").bind("mouseout", function(){$(this).find(".libra").css('background-position', '0 0px');  });$(".change >a").bind("mouseover", function(){$(this).find(" .libimage").css('background-position', '0 -57px');  });  $(".change >a").bind("mouseout", function(){$(this).find(" .libimage").css('background-position', '0 -57px');  });  $('.showAllButton span').bind("mouseover", function(){ $(this).css({'border-bottom':'none'});  });   $(".showAllButton span").bind("mouseout", function(){$(this).css({'border-bottom':''});  });         $(".jcarousel-item a.foto").bind("mouseover", function(){         $(this).find('.bg_item').css("background", "none");                                                                          var thisId = $(this).attr("id");         $("#thisId").css("display", "none");         previewId = thisId.replace("s", "");         $('.img-content').css("display", "none");         $("#"+previewId).css("display", "block");             return false;         });         $(".jcarousel-item a.foto").bind("mouseout", function(){         $(this).find('.bg_item').css("background", "");             return false;         });         $("a[rel=fancy_goup_1], .left_center .big_item a").fancybox({                'transitionIn'      : 'none',                'transitionOut'     : 'none',                'titlePosition'     : 'over',                'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {                    return '<span id="fancybox-title-over">Фото: ' + (currentIndex + 1) + ' из ' + currentArray.length +  '</span>';                }                });  //Cart Tabs    $('.left_center .big_item ins').hide();    $('.left_center .big_item ins:first').show();    $('.b-tabs-head ul li:first').addClass('active');    $('.b-tabs-head ul li').hover(function(){    $('.b-tabs-head ul li').removeClass('active');    $(this).addClass('active');    var currentTab = $(this).children().attr('href');    $('.left_center .big_item ins').hide();    $(currentTab).show();    return false;    });          function checkContaktForm(){        ok=true;        $('.f-error').css('opacity',0);        $('.f-row-required').removeClass('f-row-required');        p_email=$('#user_email').val();        if (p_email!='')        {        t=p_email.indexOf('@');        if ((p_email.indexOf('.')==-1)||(t==-1)||(t < 1)||        (t > p_email.length - 5) || (p_email.charAt(t - 1)=='.') || (p_email.charAt(t + 1)=='.'))        {        $('.mf-email .f-error div').text('Введён некорректный E-mail');        $('.mf-email .f-error').show();        $('.mf-email .f-error').animate({        opacity: 1        }, 200,function (){        $(this).animate({        opacity: 0        }, 3000,function(){$(this).hide();});        });        $('div .mf-email').addClass('f-row-required');        ok = false;        }        }        else {        $('.mf-email .f-error div').text('Не заполнен E-mail');        $('.mf-email .f-error').show();        $('.mf-email .f-error').animate({        opacity: 1        }, 200,function (){        $(this).animate({        opacity: 0        }, 4000,function(){$(this).hide();});        });        $('div .mf-email').addClass('f-row-required');        ok = false;        }        message=$('#MESSAGE').val();        if (message.length<3)        {        $('.mf-message .f-error').show();        $('.mf-message .f-error').animate({        opacity: 1        }, 200,function (){        $(this).animate({        opacity: 0        }, 4000,function(){$(this).hide();});        });        $('div .mf-message').addClass('f-row-required');        ok = false;        }        captcha_sid = $('.captcha_sid').val();        captcha_word = $('#captcha_word').val();        $.ajax({        async: false,        url: "/_ajax/checkCaphca.php",        data: "captcha_sid="+captcha_sid+"&captcha_word="+captcha_word,        success: function(data){        if (data!='1'){        ok = false;        $('div .mf-captcha').addClass('f-row-required');        $('.mf-captcha .f-error div').text('Введёна неверная капча');        $('.mf-captcha .f-error').show();        $('.mf-captcha .f-error').animate({        opacity: 1        }, 200,function (){        $(this).animate({        opacity: 0        }, 4000,function(){$(this).hide();});        });        }        }        });        if (ok){        user_name = $('#user_name').val();        $.ajax({        url: "/_ajax/contactForm.php",        type: "GET",        data: "user_email="+p_email+"&captcha_word="+captcha_word+"&captcha_sid="+        captcha_sid+"&MESSAGE="+message+"&user_name="+user_name+        "&submit=1",        success: function(data){        $('#feedbackForm').hide();        $('#feedbackForm').html(data);        $('#feedbackForm').show('slow');        getnewCapcha();        }        });        }        return false;        }; $("ul.cat_nav> li").mouseenter(function(e) {         	var t = (document.documentElement.scrollTop || document.body.scrollTop) -             document.documentElement.clientTop;              var mousey = e.pageY -40;             var tipHeight = $(this).find('ul').height();             var topVisY =$(this).height();		    var tipVisY = $(window).height() - (mousey-t + tipHeight);		            if (tipVisY < 0) {              	             	$(this).find('ul').css({  top:- tipHeight + topVisY - 5, left: 0 });            };                            if (tipHeight<20) {                 $(this).find('ul').css({  marginTop: 0, left: 0 });                 };                                             });    $("ul.cat_nav >li").hover(function(){         $(this).addClass("act");                $(this).find("ul").css('display','block');        }, function() {         $(this).removeClass("act");         $(this).find("ul").css('display','none');               });        });
