        // main functions       
    
document.ondragstart = test;
document.onselectstart = test;
document.oncontextmenu = test;
function test(){
return false}    
       
jQuery(document).ready(function(){

jQuery("#vklike a").attr("rel", "noindex nofollow");
jQuery("#twitt a").attr("rel", "noindex nofollow");
jQuery(".yashare-auto-init a").attr("rel", "noindex nofollow");    
    
//jQuery("#mainholder").disableTextSelect();       

jQuery('#twitt').html('<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-lang="ru">Твитнуть</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>'); 
jQuery('#yasharediv').html('<div class="yashare-auto-init" data-yashareType="button" data-yashareQuickServices="vkontakte,facebook,twitter"></div>'); 
                     
    var page = 1;
    var city_text = jQuery('#city').val();
    
            jQuery('#showroom-left').fadeOut("slow"); 
      
            if(city_text!="Москва" && city_text!="москва" && city_text!="Москва " && city_text!="москва"){
                jQuery('#metro-div').fadeOut("slow"); 
                jQuery('#postcode-div').fadeIn("slow");                                                                                       
                jQuery('#flat').attr("checked",false);
                jQuery('#flat').css("display","none");                                
                jQuery('#russianpostprepay').attr("checked","checked");
                jQuery('#cod').attr("checked",false); 
                jQuery('#cod').css("display","none");                                                                                
                jQuery('#nalojka').attr("checked","checked");                                                                                                                                                      
            }
            else{
                jQuery('#postcode-div').fadeOut("slow");
                jQuery('#metro-div').fadeIn("slow");
                jQuery('#russianpostprepay').attr("checked",false);                                                                                                           
                jQuery('#flat').attr("checked","checked");
                jQuery('#nalojka').attr("checked",false);                                                                                                                                                                      
                jQuery('#cod').attr("checked","checked");                 
            }        
 
 var scrWidth = document.documentElement.clientWidth;
 var scrHeight = document.documentElement.clientHeight; 
 var pageupWidth = (scrWidth-960)/2;          
 jQuery("#pageup").css("width", pageupWidth);
 jQuery("#pageup-wrapper").css("width", pageupWidth);
 var pageupMarginTop = scrHeight-33;           
 jQuery("#pageup").css("padding-top", pageupMarginTop);
 
 var freecallMarginLeft = pageupWidth+960+((pageupWidth-162)/2)+8;            
 jQuery("#free-call").css("margin-left", freecallMarginLeft); 
 jQuery("#free-call").css("margin-top", pageupMarginTop);
   
    jQuery("#bs-womens").click(function(){
        jQuery('#boxBestsellers').css("background-position","0 0");             
        pos = 0;
        jQuery('#boxBestsellersContent').animate({opacity:0}, 300, function(){
        jQuery(this).css({"bottom":pos+"px"});
        });
        jQuery('#boxBestsellersContent').animate({opacity:1}, 100, function(){
        jQuery(this).css({visibility:"visible"});
        });           
    }); 

    jQuery("#bs-mens").click(function(){
        jQuery('#boxBestsellers').css("background-position","-704px 0");     
        pos = 1510;
        jQuery('#boxBestsellersContent').animate({opacity:0}, 300, function(){
        jQuery(this).css({"bottom":pos+"px"});
        });
        jQuery('#boxBestsellersContent').animate({opacity:1}, 100, function(){
        jQuery(this).css({visibility:"visible"});
        }); 
    }); 

    jQuery("#bs-kids").click(function(){
        jQuery('#boxBestsellers').css("background-position","-1407px 0");             
        pos = 3020;
        jQuery('#boxBestsellersContent').animate({opacity:0}, 300, function(){
        jQuery(this).css({"bottom":pos+"px"});
        });
        jQuery('#boxBestsellersContent').animate({opacity:1}, 100, function(){
        jQuery(this).css({visibility:"visible"});
        }); 
    });          
    
    jQuery('#news-input').click(function(){ 
        if (jQuery('#news-input').attr("value")=="Ваш e-mail...")  {         
            jQuery('#news-input').attr("value","");
            jQuery('#news-input').css("color","#000000");
        }                                            
    }); 
    
    jQuery("#news-input").blur(function(){
        if (jQuery('#news-input').attr("value")=="")  {
            jQuery('#news-input').attr("value","Ваш e-mail...");
            jQuery('#news-input').css("color","#919296");     
        }                                      
    });
    
    jQuery('#login-jq-input-login').click(function(){ 
        if (jQuery('#login-jq-input-login').attr("value")=="E-mail")  {         
            jQuery('#login-jq-input-login').attr("value","");
            jQuery('#login-jq-input-login').css("color","#000000");
        }                                            
    }); 
    
    jQuery("#news-input").blur(function(){
        if (jQuery('#news-input').attr("value")=="")  {
            jQuery('#news-input').attr("value","Ваш e-mail...");
            jQuery('#news-input').css("color","#919296");     
        }                                      
    });
    
    jQuery('#top-find-keywords').click(function(){ 
        if (jQuery('#top-find-keywords').attr("value")=="найти...")  {         
            jQuery('#top-find-keywords').attr("value","");
            jQuery('#top-find-keywords').css("color","#000000");
        }                                            
    });    
    
    jQuery("#top-find-keywords").blur(function(){
        if (jQuery('#top-find-keywords').attr("value")=="")  {
            jQuery('#top-find-keywords').attr("value","найти...");
            jQuery('#top-find-keywords').css("color","#B9B9B9");     
        }                                      
    });  
    
    jQuery('#login-jq-input-password').click(function(){ 
        if (jQuery('#login-jq-input-password').attr("value")=="Пароль")  {         
            jQuery('#login-jq-input-password').attr("value","");
            jQuery('#login-jq-input-password').css("color","#000000");
        }                                            
    }); 
    
    jQuery("#login-jq-input-password").blur(function(){
        if (jQuery('#login-jq-input-password').attr("value")=="")  {
            jQuery('#login-jq-input-password').attr("value","Пароль");
            jQuery('#login-jq-input-password').css("color","#B9B9B9");     
        }                                      
    });      
    
    jQuery("#showroom-moskow-top").hover(function(){
        jQuery("#showroom-sochi-top").css("background","url(/images/showroom-sochi-1.png) no-repeat");        
        jQuery("#showroom-spb-top").css("background","url(/images/showroom-spb-1.png) no-repeat");        
        jQuery("#showroom-ekaterinburg-top").css("background","url(/images/showroom-ekaterinburg-1.png) no-repeat");        
        jQuery("#showroom-novosibirsk-top").css("background","url(/images/showroom-novosibirsk-1.png) no-repeat");                
        jQuery("#showroom-moskow-top").css("background","url(/images/showroom-moskow-2.png) no-repeat");        
        jQuery('#showroom-sochi-image').slideUp("fast");                        
        jQuery('#showroom-novosibirsk-image').slideUp("fast");                        
        jQuery('#showroom-spb-image').slideUp("fast");                        
        jQuery('#showroom-ekaterinburg-image').slideUp("fast");
        jQuery('#showroom-sochi-top').css("margin-top","0");
        jQuery('#showroom-novosibirsk-top').css("margin-top","-5px");                            
        jQuery('#showroom-spb-top').css("margin-top","-5px");                            
        jQuery('#showroom-ekaterinburg-top').css("margin-top","-5px");                                                                
        jQuery('#showroom-moskow-image').slideDown("fast");                        
    }); 
    
    jQuery("#showroom-sochi-top").hover(function(){ 
        jQuery("#showroom-sochi-top").css("background","url(/images/showroom-sochi-2.png) no-repeat");        
        jQuery("#showroom-spb-top").css("background","url(/images/showroom-spb-1.png) no-repeat");        
        jQuery("#showroom-ekaterinburg-top").css("background","url(/images/showroom-ekaterinburg-1.png) no-repeat");        
        jQuery("#showroom-novosibirsk-top").css("background","url(/images/showroom-novosibirsk-1.png) no-repeat");                
        jQuery("#showroom-moskow-top").css("background","url(/images/showroom-moskow-1.png) no-repeat");         
        jQuery('#showroom-novosibirsk-image').slideUp("fast");                        
        jQuery('#showroom-spb-image').slideUp("fast");                        
        jQuery('#showroom-ekaterinburg-image').slideUp("fast");                               
        jQuery('#showroom-moskow-image').slideUp("fast");
        jQuery('#showroom-ekaterinburg-image').slideUp("fast");
        jQuery('#showroom-sochi-top').css("margin-top","-5px");
        jQuery('#showroom-novosibirsk-top').css("margin-top","0");                            
        jQuery('#showroom-spb-top').css("margin-top","-5px");                            
        jQuery('#showroom-ekaterinburg-top').css("margin-top","-5px");         
        jQuery('#showroom-sochi-image').slideDown("fast");                                                       
    }); 
    
    jQuery("#showroom-novosibirsk-top").hover(function(){
        jQuery("#showroom-sochi-top").css("background","url(/images/showroom-sochi-1.png) no-repeat");        
        jQuery("#showroom-spb-top").css("background","url(/images/showroom-spb-1.png) no-repeat");        
        jQuery("#showroom-ekaterinburg-top").css("background","url(/images/showroom-ekaterinburg-1.png) no-repeat");        
        jQuery("#showroom-novosibirsk-top").css("background","url(/images/showroom-novosibirsk-2.png) no-repeat");                
        jQuery("#showroom-moskow-top").css("background","url(/images/showroom-moskow-1.png) no-repeat");         
        jQuery('#showroom-sochi-image').slideUp("fast");                                                                                      
        jQuery('#showroom-spb-image').slideUp("fast");                        
        jQuery('#showroom-ekaterinburg-image').slideUp("fast");                               
        jQuery('#showroom-moskow-image').slideUp("fast");
        jQuery('#showroom-sochi-top').css("margin-top","-5px");
        jQuery('#showroom-novosibirsk-top').css("margin-top","-5px");                            
        jQuery('#showroom-spb-top').css("margin-top","0");                            
        jQuery('#showroom-ekaterinburg-top').css("margin-top","-5px");
        jQuery('#showroom-novosibirsk-image').slideDown("fast");                  
    }); 
    
    jQuery("#showroom-spb-top").hover(function(){    
        jQuery("#showroom-sochi-top").css("background","url(/images/showroom-sochi-1.png) no-repeat");        
        jQuery("#showroom-spb-top").css("background","url(/images/showroom-spb-2.png) no-repeat");        
        jQuery("#showroom-ekaterinburg-top").css("background","url(/images/showroom-ekaterinburg-1.png) no-repeat");        
        jQuery("#showroom-novosibirsk-top").css("background","url(/images/showroom-novosibirsk-1.png) no-repeat");                
        jQuery("#showroom-moskow-top").css("background","url(/images/showroom-moskow-1.png) no-repeat");         
        jQuery('#showroom-sochi-image').slideUp("fast");                                                                                      
        jQuery('#showroom-moskow-image').slideUp("fast");
        jQuery('#showroom-novosibirsk-image').slideUp("fast");         
        jQuery('#showroom-ekaterinburg-image').slideUp("fast");
        jQuery('#showroom-sochi-top').css("margin-top","-5px");
        jQuery('#showroom-novosibirsk-top').css("margin-top","-5px");                            
        jQuery('#showroom-spb-top').css("margin-top","-5px");                            
        jQuery('#showroom-ekaterinburg-top').css("margin-top","0");
        jQuery('#showroom-spb-image').slideDown("fast");                                                                                  
    }); 
    
    jQuery("#showroom-ekaterinburg-top").hover(function(){
        jQuery("#showroom-sochi-top").css("background","url(/images/showroom-sochi-1.png) no-repeat");        
        jQuery("#showroom-spb-top").css("background","url(/images/showroom-spb-1.png) no-repeat");        
        jQuery("#showroom-ekaterinburg-top").css("background","url(/images/showroom-ekaterinburg-2.png) no-repeat");        
        jQuery("#showroom-novosibirsk-top").css("background","url(/images/showroom-novosibirsk-1.png) no-repeat");                
        jQuery("#showroom-moskow-top").css("background","url(/images/showroom-moskow-1.png) no-repeat");
        jQuery('#showroom-sochi-image').slideUp("fast");                                                                                      
        jQuery('#showroom-moskow-image').slideUp("fast");
        jQuery('#showroom-novosibirsk-image').slideUp("fast");
        jQuery('#showroom-spb-image').slideUp("fast");                   
        jQuery('#showroom-sochi-top').css("margin-top","-5px");
        jQuery('#showroom-novosibirsk-top').css("margin-top","-5px");                            
        jQuery('#showroom-spb-top').css("margin-top","-5px");                            
        jQuery('#showroom-ekaterinburg-top').css("margin-top","-5px");
        jQuery('#showroom-ekaterinburg-image').slideDown("fast");                                                                                        
    }); 
    
    jQuery("#showroom-images-1").mouseover(function(){
        jQuery('#showroom-greybox-1').fadeIn("fast");                                                                                                
    });
    
    jQuery("#showroom-images-1").mouseleave(function(){
        jQuery('#showroom-greybox-1').fadeOut("slow");                                                                                                
    });  
    
    jQuery("#showroom-images-2").mouseover(function(){
        jQuery('#showroom-greybox-2').fadeIn("fast");                                                                                                
    });
    
    jQuery("#showroom-images-2").mouseleave(function(){
        jQuery('#showroom-greybox-2').fadeOut("slow");                                                                                                
    });
    
    jQuery("#showroom-images-3").mouseover(function(){
        jQuery('#showroom-greybox-3').fadeIn("fast");                                                                                                
    });
    
    jQuery("#showroom-images-3").mouseleave(function(){
        jQuery('#showroom-greybox-3').fadeOut("slow");                                                                                                
    });
    
    jQuery("#showroom-images-4").mouseover(function(){
        jQuery('#showroom-greybox-4').fadeIn("fast");                                                                                                
    });
    
    jQuery("#showroom-images-4").mouseleave(function(){
        jQuery('#showroom-greybox-4').fadeOut("slow");                                                                                                
    }); 
    
    jQuery("#showroom-images-5").mouseover(function(){
        jQuery('#showroom-greybox-5').fadeIn("fast");                                                                                                
    });
    
    jQuery("#showroom-images-5").mouseleave(function(){
        jQuery('#showroom-greybox-5').fadeOut("slow");                                                                                                
    });     
    
    jQuery(".bsdiv-left").mouseover(function(){
        if (pos!=0 && pos!=1510 && pos!=3020){
        jQuery('.bs-left').stop().animate({opacity:1}, 300, function(){
        });  
        }
        if (pos!=1359 && pos!=2869 && pos!=4379){            
        jQuery('.bs-right').stop().animate({opacity:1}, 300, function(){
        }); 
        }  
    });
    
    jQuery(".bsdiv-left").mouseleave(function(){     
        jQuery('.bs-left').animate({opacity:0}, 300, function(){
        });
        jQuery('.bs-right').animate({opacity:0}, 300, function(){
        });                    
    });                                       
    
    jQuery(".navmore").click(function(){
        page++;  
        if (jQuery('#nextpage'+page).length){
            jQuery.post(   
            "myajax.php", 
            {page:page},  
            function (data){
                jQuery('#nextpage'+page).html(data);
                jQuery('#nextpage'+page).fadeIn("slow");                                                          
                })
        
                var nav = jQuery('.navigation').html();        
            jQuery.post(   
            "myajax.php", 
            {nav:nav,page:page},  
            function (data){        
                jQuery('.navigation').html(data);
                });
        }
        if (!jQuery('#nextpage'+(page+1)).length){
           jQuery(".navmore").css("display","none");
        }
    }); 
    
 $(window).scroll(function () { 
     
 if (jQuery(window).scrollTop()<=1000){ 
      jQuery("#pageup").css("display", "none").fadeOut("slow"); 
    }     
 if (jQuery(window).scrollTop()>1000){ 
      jQuery("#pageup").css("display", "inline").fadeIn("slow");       
    }    
    
    }); 
    
 jQuery('#pageup').click(function() {
    jQuery.scrollTo("#menu",500);
 });        
        
        jQuery(".filter-checkbox").click(function(){
                if(jQuery(this).children('.filter-categories-checkbox').attr("checked")!="checked"){
                    jQuery('#f9-0').attr("checked",false); 
                    jQuery('#f9-1').attr("checked",false);                                         
                    jQuery('#f9-2').attr("checked",false);                                                                                                     
                    jQuery(this).children('.filter-categories-checkbox').attr("checked","checked"); 
                    jQuery(this).parent("form").submit();                    
                }        
        });

        jQuery(".filter-div-models-checkbox").click(function(){
                if(jQuery(this).children('.filter-models-checkbox').attr("checked")!="checked"){                                                                                                    
                    jQuery(this).children('.filter-models-checkbox').attr("checked","checked"); 
                    jQuery(this).parent("form").submit();                    
                }        
        });
                
        jQuery(".filter-div-models-checkbox-checked").click(function(){
                if(jQuery(this).children('.filter-models-checkbox').attr("checked")=="checked"){
                    jQuery(this).children('.filter-models-checkbox').attr("checked",false); 
                    jQuery(this).parent("form").submit();
                }        
        });
        
        jQuery(".filter-div-models-checkbox").mouseenter(function(){
                var imgFile = jQuery(this).children('img').attr("src");
                var SplitData = imgFile.split("1.pn"); 
                if (SplitData[1]=="g"){
                imgFile = SplitData[0]+"2.png";
                }
                jQuery(this).children('img').attr("src",imgFile);
        });
        
        jQuery(".filter-div-models-checkbox").mouseleave(function(){
                var imgFile = jQuery(this).children('img').attr("src");
                var SplitData = imgFile.split("2.pn"); 
                if (SplitData[1]=="g"){
                imgFile = SplitData[0]+"1.png";
                }
                jQuery(this).children('img').attr("src",imgFile);
        });        
        
        jQuery(".filter-material-checkbox").click(function(){
                if(jQuery(this).children('.filter-materials-checkbox').attr("checked")!="checked"){                                                                                                    
                    jQuery(this).children('.filter-materials-checkbox').attr("checked","checked"); 
                    jQuery(this).parent("form").submit();                    
                }        
        });
                
        jQuery(".filter-material-checkbox-checked").click(function(){
                if(jQuery(this).children('.filter-materials-checkbox').attr("checked")=="checked"){
                    jQuery(this).children('.filter-materials-checkbox').attr("checked",false); 
                    jQuery(this).parent("form").submit();
                }        
        }); 
        
        jQuery(".filter-price-checkbox").click(function(){
                if(jQuery(this).children('.filter-prices-checkbox').attr("checked")!="checked"){                                                                                                    
                    jQuery(this).children('.filter-prices-checkbox').attr("checked","checked"); 
                    jQuery(this).parent("form").submit();                    
                }        
        });
                
        jQuery(".filter-price-checkbox-checked").click(function(){
                if(jQuery(this).children('.filter-prices-checkbox').attr("checked")=="checked"){
                    jQuery(this).children('.filter-prices-checkbox').attr("checked",false); 
                    jQuery(this).parent("form").submit();
                }        
        }); 
        
        jQuery(".filter-color-checkbox").click(function(){
                if(jQuery(this).children('.filter-colors-checkbox').attr("checked")!="checked"){                                                                                                    
                    jQuery(this).children('.filter-colors-checkbox').attr("checked","checked"); 
                    jQuery(this).parent("form").submit();                    
                }        
        });
                
        jQuery(".filter-color-checkbox-checked").click(function(){
                if(jQuery(this).children('.filter-colors-checkbox').attr("checked")=="checked"){
                    jQuery(this).children('.filter-colors-checkbox').attr("checked",false); 
                    jQuery(this).parent("form").submit();
                }        
        });                                      

        jQuery("#add_to_cart").click(function(){          
                jQuery("form .cart_quantity").submit();            
        });
        
        jQuery(".articles-group-name").click(function(){ 
            if (jQuery(this).parent("li").parent("ul").children(".articles-li").css("display")=="none"){                 
                jQuery(this).parent("li").parent("ul").children(".articles-li").fadeIn("fast");
                jQuery(this).css("background-image","url(/images/articles-nav-show.png)");                                                                      
            }
            else{
                jQuery(this).parent("li").parent("ul").children(".articles-li").css("display","none");
                jQuery(this).css("background-image","url(/images/articles-nav-hidden.png)");                                                                                                                  
            }
        });                                                         
                                       
}); 

jQuery(function() {
        jQuery('.itemNewProductsDefault').live('hover', function() {   
                 jQuery(this).children(".itemQuickView").stop().animate({opacity:1}, 400);
                }
        );
    }
);

jQuery(function() {
        jQuery('.itemNewProductsDefault').live('mouseleave', function() {   
                 jQuery(this).children(".itemQuickView").stop().animate({opacity:0}, 100);
                }
        );
    }
);


jQuery(function(big_image) {
        jQuery('.zoom').live('hover', function(big_image) {   
                jQuery("#video-div").css("display","none");
                jQuery("#copyright-div").css("display","none");                                                                                       
                jQuery("#big-image").css("display","block");                    
                var showImage = jQuery(this).children("img").attr("src");
                var showHref = jQuery(this).attr("href");
                jQuery("#big-image").attr("href",showHref);                
                jQuery("#big-image img").attr("src",showImage);
                }
        );
    }
);

jQuery(function() {
        jQuery('#products-info-all-colors-div a').live('hover', function() {
                jQuery("#video-div").css("display","none");
                jQuery("#copyright-div").css("display","none");                                                                                                       
                jQuery("#big-image").css("display","block");            
               var colorImage = jQuery(this).attr("title");
               var colorDescription = jQuery(this).children(".color-description").val();   
               jQuery("#big-image img").attr("src","images/product_images/info_images/"+colorImage);
               jQuery(".color-desc-show").html(colorDescription);          
               }
        );
    }
);  

jQuery(function() {
        jQuery('#products-info-all-colors-div a').live('mouseleave', function() {                                              
               var originalImage = jQuery(".products-info-all-colors-checked").attr("title");
               var colorOriginalDescription = jQuery(".products-info-all-colors-checked").children(".color-description").val();                  
               jQuery("#big-image img").attr("src","images/product_images/info_images/"+originalImage);
               jQuery(".color-desc-show").html(colorOriginalDescription);                         
               }
        );
    }
);

jQuery(function() {
        jQuery('.attributes-radio').live('click', function() { 
                    if (jQuery('#products-info-atributes').children('a').hasClass("attributes-radio-checked")){
                        jQuery('#products-info-atributes').children('a').removeClass("attributes-radio-checked");
                        jQuery('#products-info-atributes').children('a').addClass("attributes-radio");
                    }  

                    jQuery(this).children('input').attr("checked","checked");
                    jQuery(this).removeClass("attributes-radio");                         
                    jQuery(this).addClass("attributes-radio-checked"); 
                    
               var attrDescription = jQuery(this).attr("title");   
               jQuery(".attr-desc-show").html(attrDescription);                        
                 
               }
        );
    }
);

jQuery(function() {
        jQuery('.attributes-radio').live('hover', function() {        
               var attrDescription = jQuery(this).attr("title");   
               jQuery(".attr-desc-show").html(attrDescription);                                     
               }
        );
    }
);


    var bi_bglink = jQuery('#big-image').attr("href");                           
    var zoombox_width = 485;
    var zoombox_height = 424; 
    
jQuery(function() {
        jQuery('#big-image').live('hover', function(e) {
               jQuery('#zoombox').fadeIn("fast");                                         
               bi_bglink = jQuery('#big-image').attr("href");                           
               jQuery('#zoombox').css("background-image","url("+bi_bglink+")");
               jQuery('#zoombox').css("background-position", "0 0");                              
            }
        );
    }
);

jQuery(function() {
        jQuery('#big-image').live('mouseleave', function(e) {
               jQuery('#zoombox').fadeOut("fast");                                                                       
            }
        );
    }
);

jQuery(function() {
        jQuery('#big-image').live('mousemove', function(e) {  
               var bi_left = jQuery('#big-image').offset().left;
               var bi_top = jQuery('#big-image').offset().top;               
               var bi_bgleft = e.pageX - bi_left;
               var bi_bgtop = e.pageY - bi_top;               

               var imgUrl = "http://na-nogi.ru/"+bi_bglink;
               var imag = new Image();
               imag.src = imgUrl;
               var imgWidth = imag.width;
               var imgHeight = imag.height; 
               
               var zbleft = (imgWidth*(bi_bgleft/387))-(zoombox_width*(bi_bgleft/387));
               var zbtop = (imgHeight*(bi_bgtop/387))-(zoombox_height*(bi_bgtop/387));               
              
               jQuery('#zoombox').css("background-position", "-"+zbleft+"px -"+zbtop+"px");                           
                              
            }
        );
    }
);


jQuery(function() {
        jQuery("a.zoom").fancybox({
        "zoomOpacity"            : true,
        "zoomSpeedIn"            : 300,
        "zoomSpeedOut"            : 300
        });   
    }
);

jQuery(function() {
jQuery('a.tooltip').tooltip({
    track: true,
    delay: 0,
    showURL: false,
    fade: 200
});
});
    
    function update_top_cart(){
            
                var upd_cart = 1;
                jQuery.post(   
                "myajax.php", 
                {upd_cart:upd_cart},  
            function (data){
                jQuery('#cart-info').html(data);    
            });
            
    };


   function cart_info(){
      jQuery('#divShoppingCart').fadeIn("fast");
      jQuery('#divShoppingCart #divShoppingCart').fadeIn("fast");       
      var ourWidth = document.documentElement.clientWidth;
      var ourHeight = document.documentElement.clientHeight;
      var cartWidth = jQuery("#divShoppingCart").width();      
      var cartHeight = jQuery(".boxcontent").height()+70;
   if (ourHeight>cartHeight && cartHeight!=0){
      var marginTop = jQuery(window).scrollTop()+(ourHeight - cartHeight)/2;
      }
   else{
      var marginTop = jQuery(window).scrollTop();          
      }
      var marginLeft = (ourWidth - cartWidth)/2; 
     
      jQuery('#divShoppingCart').css("margin-top",marginTop+"px");
      jQuery('#divShoppingCart').css("margin-left",marginLeft+"px");                                              
      jQuery("#hidimg").css("visibility","visible");    
      jQuery("#hidimg").fadeTo("slow",0.5);      
           
      };
      
    function cart_close(){
      
      jQuery('#divShoppingCart').css("display","none");       
      jQuery("#hidimg").css("visibility","hidden");    
      jQuery("#hidimg").fadeTo("slow",0.5);
           
      };
      
      function cart_checkout() {
          
          jQuery.get(   
            "checkout_confirmation.php?ajax=1", function (data){
                jQuery('#divShoppingCart').css("display","none");       
                jQuery('#checkout_alternative_js').html(data);
                jQuery('#checkout_alternative_js').fadeIn("fast");
                var ourWidth2 = document.documentElement.clientWidth;
                var ourHeight2 = document.documentElement.clientHeight;
                var cartWidth2 = jQuery("#checkout_alternative_js .page").width();      
                var cartHeight2 = jQuery("#checkout_alternative_js .page").height()+100;
            if (ourHeight2>cartHeight2 && cartHeight2!=0){
                var marginTop = jQuery(window).scrollTop()+(ourHeight2 - cartHeight2)/2;
            }
            else{
                var marginTop = jQuery(window).scrollTop();          
            }
                var marginLeft = (ourWidth2 - cartWidth2)/2; 
     
      jQuery('#checkout_alternative_js').css("margin-top",marginTop+"px");
      jQuery('#checkout_alternative_js').css("margin-left",marginLeft+"px");                
                });
          
      };
      
      function fastreg_button() {
          
            jQuery('label[for="email"]').html('E-Mail:');
            jQuery('#email_address').css("border-color","#BEBEBE");              
            jQuery('label[for="firstname"]').html('Имя:');
            jQuery('#firstname').css("border-color","#BEBEBE");              
            jQuery('label[for="telephone"]').html('Телефон получателя:');
            jQuery('#telephone').css("border-color","#BEBEBE");           
   
         var action = jQuery('input[name="action"]').attr("value");
         var comments = jQuery('textarea[name="comments"]').attr("value");
         var firstname = jQuery('input[name="firstname"]').attr("value");
         var lastname = jQuery('input[name="lastname"]').attr("value");
         var secondname = jQuery('input[name="secondname"]').attr("value");         
         var email_address = jQuery('input[name="email_address"]').attr("value");
         var newsletter = jQuery('input[name="newsletter"]').attr("value");
         var street_address = jQuery('input[name="street_address"]').attr("value");
         var postcode = jQuery('input[name="postcode"]').attr("value");
         var city = jQuery('input[name="city"]').attr("value");
         var state = jQuery('select[name="state"]').attr("value");
         var country = jQuery('select[name="country"]').attr("value");
         var telephone = jQuery('input[name="telephone"]').attr("value");        
         var shipping = jQuery('input[name="shipping"][checked="checked"]').attr("value");        
         var payment = jQuery('input[name="payment"][checked="checked"]').attr("value");        

  if (email_address!="" && telephone!="обязательно к заполнению" && firstname!=""){

         street_address = "Улица: " + jQuery('#street_address_1').attr("value") +
         " || Дом: " + jQuery('#street_address_2').attr("value") + " || Корпус: " + jQuery('#street_address_3').attr("value") +
         " || Подъезд: " + jQuery('#street_address_4').attr("value") + " || Этаж: " + jQuery('#street_address_5').attr("value") +
         " || Квартира: " + jQuery('#street_address_6').attr("value");
         
         comments = comments + " || Удобный день доставки: " + 
         jQuery('#month').attr("value") + " || Удобное время доставки: с " + jQuery('#time1').attr("value") +
         " до " + jQuery('#time2').attr("value") + " || Дополнительная станция метро: " + jQuery('#suburb2').attr("value") +
         " || Дополнительный телефон: " + jQuery('#telephone2').attr("value");
         
         var email_text =  jQuery('#email_address').val();
                
                jQuery.post(   
                "myajax.php", 
                {email_text:email_text},  
            function (data){
                if (data==1){
                      
            var edit_form = true;
            var edit_form_city =  jQuery('#city').val();
            var edit_form_state =  jQuery('#state').val();
            var edit_form_suburb =  jQuery('#suburb').val();
            var edit_form_street_address =  street_address;
            var edit_form_postcode =  jQuery('#postcode').val();
            var edit_form_telephone =  jQuery('#telephone').val();
            var edit_form_comments =  comments;
            var edit_form_firstname =  jQuery('#firstname').val();
            var edit_form_lastname =  jQuery('#lastname').val();
            var edit_form_secondname = jQuery('#secondname').val();         
                         
            var email4another = email_text;

            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_city:edit_form_city,edit_form_state:edit_form_state,
                edit_form_suburb:edit_form_suburb,edit_form_street_address:edit_form_street_address,
                edit_form_postcode:edit_form_postcode,edit_form_telephone:edit_form_telephone,
                edit_form_comments:edit_form_comments,edit_form_firstname:edit_form_firstname,
                edit_form_lastname:edit_form_lastname,edit_form_secondname:edit_form_secondname,email4another:email4another},  
            function (data){
                          jQuery.post(   
                          "checkout_confirmation.php?ajax=1", 
                          {},  
                          function (data){        
                          jQuery('#checkout_alternative_js').html(data);
                          });                
            });                 
                    
                } 
                else{
                    jQuery.post(   
                    "checkout_alternative.php?ajax=1", 
                    {action:action,comments:comments,firstname:firstname,lastname:lastname,secondname:secondname,
                    email_address:email_address,newsletter:newsletter,street_address:street_address,
                    postcode:postcode,city:city,state:state,country:country,telephone:telephone,shipping:shipping,payment:payment},  
                    function (data){        
                        jQuery('#checkout_alternative_js').html(data);
                        });                                                                                             
                }       
            });
         
      }
      else if (email_address=="" || telephone=="обязательно к заполнению" || firstname==""){
          if (email_address==""){
            jQuery('label[for="email"]').html('E-Mail: <span style="color:#ff0000;">необходимо указать e-mail адрес</span');
            jQuery('#email_address').css("border-color","#ff0000");              
          }
          if (firstname==""){
            jQuery('label[for="firstname"]').html('Имя: <span style="color:#ff0000;">укажите имя</span');
            jQuery('#firstname').css("border-color","#ff0000");              
          }          
          if (telephone=="обязательно к заполнению"){
            jQuery('label[for="telephone"]').html('Телефон получателя: <span style="color:#ff0000;">укажите Ваш номер телефона</span');
            jQuery('#telephone').css("border-color","#ff0000");              
          }   
      }        
    
      };
      
            function checkout_conf() {
            
            comments2_blur();
                 
          jQuery.post(   
            "checkout_process.php?ajax=1", 
            {},  
            function (data){        
                jQuery('#checkout_alternative_js').html(data);
                
                var ourWidth = document.documentElement.clientWidth;
                var ourHeight = document.documentElement.clientHeight;
                var cartWidth = jQuery("#divShoppingCart").width();      
                var cartHeight = jQuery("#checkout_alternative_js .page").height();
            if (ourHeight>cartHeight && cartHeight!=0){
                var marginTop = jQuery(window).scrollTop()+(ourHeight - cartHeight)/2;
            }
            else{
                var marginTop = jQuery(window).scrollTop();          
            }
                var marginLeft = (ourWidth - cartWidth)/2; 
     
                jQuery('#checkout_alternative_js').css("margin-top",marginTop+"px");
                jQuery('#checkout_alternative_js').css("margin-left",marginLeft+"px");                                                             
            });      
            
            };
            
            function sucess_close() {
            
                jQuery('#checkout_alternative_js').css("display","none");       
                jQuery("#hidimg").css("visibility","hidden");    
                jQuery("#hidimg").fadeTo("slow",0.5);
                update_top_cart();
                
            };
            
            function checkout_close() {
            
                jQuery('#checkout_alternative_js').css("display","none");       
                jQuery("#hidimg").css("visibility","hidden");    
                jQuery("#hidimg").fadeTo("slow",0.5);
                update_top_cart();
                
            };
            
            function back_to_cart() {
            
                jQuery('#checkout_alternative_js').css("display","none");

                var ourWidth2 = document.documentElement.clientWidth;
                var ourHeight2 = document.documentElement.clientHeight;
                var cartWidth2 = jQuery("#divShoppingCart").width();      
                var cartHeight2 = jQuery("#divShoppingCart").height();
            if (ourHeight2>cartHeight2 && cartHeight2!=0){
                var marginTop = jQuery(window).scrollTop()+(ourHeight2 - cartHeight2)/2;
            }
            else{
                var marginTop = jQuery(window).scrollTop();          
            }
                var marginLeft = (ourWidth2 - cartWidth2)/2; 
     
                jQuery('#divShoppingCart').css("margin-top",marginTop+"px");
                jQuery('#divShoppingCart').css("margin-left",marginLeft+"px");                       
                jQuery('#divShoppingCart').fadeIn("fast");
                jQuery('#divShoppingCart #divShoppingCart').fadeIn("fast"); 
                
            };
            
            function state_div_show() {
                if (jQuery('#state').css('display')=='none'){
                jQuery('#state').slideDown("fast");          
                }
                else{
                jQuery('#state').slideUp(50);                              
                }      
            };                        
            
            function change_reg_fields(mode) {
                var city_text = jQuery('#city').val();

                if (mode!=1){
                jQuery.post(   
                "myajax.php", 
                {city_text:city_text},  
            function (data){
                var SplitData = data.split(">>"); 
                var data1 = SplitData[0];
                var data2 = SplitData[1];
                var data3 = SplitData[2]; 
                if (data1!="" && data1!=" "){
                jQuery('#city-what-1 a').html(data1);
                jQuery('#city-what-1').css("display","block");
                }
                else{
                jQuery('#city-what-1').css("display","none");                    
                }                 
                if (data2!="" && data2!=" "){
                jQuery('#city-what-2 a').html(data2);
                jQuery('#city-what-2').css("display","block");
                }
                else{
                jQuery('#city-what-2').css("display","none");                    
                }                
                if (data3!="" && data3!=" "){
                jQuery('#city-what-3 a').html(data3);
                jQuery('#city-what-3').css("display","block");
                } 
                else{
                jQuery('#city-what-3').css("display","none");                    
                }                                              
            });
                }
                
            if(city_text!="Москва" && city_text!="москва" && city_text!="Москва " && city_text!="москва"){
                jQuery('#postcode-div').slideDown("slow");
                jQuery('#metro-div').slideUp("slow"); 
                jQuery('#metro-another').slideUp("slow");                              
                jQuery('#state-div-show').slideDown("slow");
                jQuery('.state-div-fieldset').slideDown("slow");                
                jQuery('#suburb2').slideUp("slow");
                jQuery('#adate').slideUp("slow");  
                jQuery('#shinfo-div').slideDown("slow");                                                                                                                                                                                                                                                                                               
                jQuery('#flat').attr("checked",false);                
                jQuery('#russianpostprepay').attr("checked","checked");
                jQuery('#cod').attr("checked",false);                                 
                jQuery('#nalojka').attr("checked","checked"); 
            }
            else{               
                jQuery('#postcode-div').slideUp("slow");
                jQuery('#metro-div').slideDown("slow");
                jQuery('#metro-another').slideDown("slow");
                jQuery('#state-div-show').slideUp("slow");
                jQuery('.state-div-fieldset').slideUp("slow");                                
                jQuery('#state').slideUp("slow"); 
                jQuery('#adate').slideDown("slow");
                jQuery('#shinfo-div').slideUp("slow");                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                jQuery('#russianpostprepay').attr("checked",false);                                                                                                           
                jQuery('#flat').attr("checked","checked");
                jQuery('#nalojka').attr("checked",false);                                                                                                                                                                      
                jQuery('#cod').attr("checked","checked");                 
            }
            };
            
            function change_email_fields() {

            var email_text =  jQuery('#email_address').val();
                
                jQuery.post(   
                "myajax.php", 
                {email_text:email_text},  
            function (data){
                if (data==1){
                    jQuery('#adate').slideUp("slow"); 
                    jQuery('#email-verification').slideDown("slow");
                    jQuery('#select-auth').slideDown("slow"); 
                    jQuery('#tape-auth').slideDown("slow"); 
                    jQuery('#shinfo_close').slideDown("slow");                   
                } 
                else{
                    jQuery('#adate').slideDown("slow"); 
                    jQuery('#email-verification').slideUp("slow");
                    jQuery('#select-auth').slideUp("slow");
                    jQuery('#tape-auth').slideUp("slow");  
                    jQuery('#shinfo_close').slideUp("slow");                                                                                                                                  
                }       
            });
                
            }
            
            function tape_auth() {
              
            var tape_auth_text =  jQuery('#tape-auth').val();
            var select_auth_text =  jQuery('#select-auth').val();
            var email_text2 =  jQuery('#email_address').val();
           
                jQuery.post(   
                "myajax.php", 
                {tape_auth_text:tape_auth_text,select_auth_text:select_auth_text,email_text2:email_text2},  
            function (data){
                if (data==1){
                    alert("Вы успешно авторизованы");
                    cart_checkout();
                }
            });                
            } 
            
            function adress_edit() {
            
                jQuery('#ordersAddress2hid').fadeOut("slow");
                jQuery('#ordersAddress2hid2').fadeOut("slow");                                                                                                                                                                                                            
                jQuery('#adress-edit').fadeIn("slow");                                                                                                              
                
            } 
            
            function cart_sredstva() {
                    if (jQuery('.cart-under').css("height")!="255px"){
                jQuery('.cart-under').css("background-color","#fff");                
                jQuery('.cart-under').css("height","255px");                  
                    }     
                    else{
                jQuery('.cart-under').css("background","none");                
                jQuery('.cart-under').css("height","27px");                         
                    }         
            }
            
            function fastreg_city(n) {
                jQuery('#city').val(jQuery('#fastreg-city-'+n).html());   
                jQuery('#city-what-1').css("display","none");                    
                jQuery('#city-what-2').css("display","none");                    
                jQuery('#city-what-3').css("display","none");
                change_reg_fields(1);                                                                 
            }
                                 
            function fastreg_blur() {
                jQuery('#city-what-1').css("display","none");                    
                jQuery('#city-what-2').css("display","none");                    
                jQuery('#city-what-3').css("display","none");
            }
            
            function show_metro2 () {
                if (jQuery('#suburb2').css("display")=="none"){
                jQuery('#suburb2').slideDown("fast");             
                }
                else{
                jQuery('#suburb2').slideUp(50);                                 
                }                       
            }
            
            function show_phone2 () {
                if (jQuery('#telephone2').css("display")=="none"){
                jQuery('#telephone2').slideDown("fast");             
                }
                else{
                jQuery('#telephone2').slideUp(50);                                 
                }                       
            }            
                
            function phone_text () {
                
        if (jQuery('#telephone').attr("value")=="обязательно к заполнению")  {         
            jQuery('#telephone').attr("value","");
            jQuery('#telephone').css("cssText","color: #707073 !important;");
        }                                                
        else if (jQuery('#telephone').attr("value")=="")  {
            jQuery('#telephone').attr("value","обязательно к заполнению");
            jQuery('#telephone').css("cssText","color: #AFAFAF !important;");     
        }                                      
                
            }
            
            function shinfo_close(){
                jQuery('#email-verification').slideUp(50);
                jQuery('#select-auth').slideUp(50);             
                jQuery('#tape-auth').slideUp(50); 
                jQuery('#adate').slideDown("slow");                               
                jQuery('#shinfo_close').slideUp(50);                                                                            
            }
            
           
            function city_blur(cn){
             if (cn!=1){
                jQuery('#city-what-1').css("display","none");                    
                jQuery('#city-what-2').css("display","none");                    
                jQuery('#city-what-3').css("display","none");                
             }
                var edit_form = true;
                var edit_form_city =  jQuery('#city').val();
            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_city:edit_form_city},  
            function (data){
                });                 
            } 
            
            
            function suburb_blur(){
                var edit_form = true;
                var edit_form_suburb =  jQuery('#suburb').val();

            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_suburb:edit_form_suburb},  
            function (data){
                });            
            }   
            
            function street_address_blur(){           
                var edit_form = true;
                var edit_form_street_address =  jQuery('#street_address_1').val();
            
            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_street_address:edit_form_street_address},  
            function (data){
                });            
            }   
            
            function telephone_blur(){           
            var edit_form = true;
            var edit_form_telephone =  jQuery('#telephone').val();

            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_telephone:edit_form_telephone},  
            function (data){
            });            
            }               
            
            function state_blur(){           
            var edit_form = true;
            var edit_form_state =  jQuery('#state').val();

            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_state:edit_form_state},  
            function (data){
            });            
            }   
            
            function postcode_blur(){           
            var edit_form = true;
            var edit_form_postcode =  jQuery('#postcode').val();

            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_postcode:edit_form_postcode},  
            function (data){
            });            
            }   
            
            function comments2_blur(){           
            var edit_form = true;
            var edit_form_comments =  jQuery('#comments2').val();

         edit_form_comments = edit_form_comments + " || Удобный день доставки: " +
         jQuery('#month').attr("value") + " || Удобное время доставки: с " + jQuery('#time1').attr("value") +
         " до " + jQuery('#time2').attr("value") + " || Дополнительная станция метро: " + jQuery('#suburb2').attr("value") +
         " || Дополнительный телефон: " + jQuery('#telephone2').attr("value");            
            
            jQuery.post(   
                "myajax.php", 
                {edit_form:edit_form,edit_form_comments:edit_form_comments},  
            function (data){
            });            
            }   

            
            function load_reg_fields() {
                var city_text = jQuery('#city').val();
                
            if(city_text!="Москва" && city_text!="москва" && city_text!="Москва " && city_text!="москва"){
                jQuery('#postcode-div').css("display","block");
                jQuery('#metro-div').css("display","none"); 
                jQuery('#metro-another').css("display","none");                              
                jQuery('#state-div-show').css("display","block");
                jQuery('.state-div-fieldset').css("display","block");                
                jQuery('#suburb2').css("display","none");
                jQuery('#adate').css("display","none");  
                jQuery('#shinfo-div').css("display","block");                                                                                                                                                                                                                                                                                               
                jQuery('#flat').attr("checked",false);                
                jQuery('#russianpostprepay').attr("checked","checked");
                jQuery('#cod').attr("checked",false);                                 
                jQuery('#nalojka').attr("checked","checked"); 
            }
            else{               
                jQuery('#postcode-div').slideUp("slow");
                jQuery('#metro-div').slideDown("slow");
                jQuery('#metro-another').slideDown("slow");
                jQuery('#state-div-show').slideUp("slow");
                jQuery('.state-div-fieldset').slideUp("slow");                                
                jQuery('#state').slideUp("slow"); 
                jQuery('#adate').slideDown("slow");
                jQuery('#shinfo-div').slideUp("slow");                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                jQuery('#russianpostprepay').attr("checked",false);                                                                                                           
                jQuery('#flat').attr("checked","checked");
                jQuery('#nalojka').attr("checked",false);                                                                                                                                                                      
                jQuery('#cod').attr("checked","checked");                 
            }
            }
            
            function cart_add_close() {
                jQuery("#hidimg").css("visibility","hidden");    
                jQuery("#hidimg").fadeTo("slow",0);                     
                jQuery('#cart_add').css("display","none");
            }
            
            function cart_add_tocart(){
                jQuery('#cart_add').css("display","none");
                jQuery('#quick-view-form').css("display","none");                                    
                jQuery('#divShoppingCart').fadeIn("fast");
                jQuery('#divShoppingCart #divShoppingCart').fadeIn("fast");       
                var ourWidth = document.documentElement.clientWidth;
                var ourHeight = document.documentElement.clientHeight;
                var cartWidth = jQuery("#divShoppingCart").width(); 
                var cartHeight = jQuery("#divShoppingCart").height();                      
            if (ourHeight>cartHeight && cartHeight!=0){
                var marginTop = jQuery(window).scrollTop()+(ourHeight - cartHeight)/2;
            }
            else{
                var marginTop = jQuery(window).scrollTop();          
            }                
                var marginLeft = (ourWidth - cartWidth)/2;   
                jQuery('#divShoppingCart').css("margin-top",marginTop+"px");
                jQuery('#divShoppingCart').css("margin-left",marginLeft+"px");                                                   
           
           }
           
           function cart_add_checkout() {
          
          jQuery.get(   
            "checkout_confirmation.php?ajax=1", function (data){
                jQuery('#cart_add').css("display","none");                
                jQuery('#quick-view-form').css("display","none");                    
                jQuery('#checkout_alternative_js').html(data);
                jQuery('#checkout_alternative_js').fadeIn("fast");
                var ourWidth2 = document.documentElement.clientWidth;
                var ourHeight2 = document.documentElement.clientHeight;
                var cartWidth2 = jQuery("#checkout_alternative_js .page").width();      
                var cartHeight2 = jQuery("#checkout_alternative_js .page").height()+100;
            if (ourHeight2>cartHeight2 && cartHeight2!=0){
                var marginTop = jQuery(window).scrollTop()+(ourHeight2 - cartHeight2)/2;
            }
            else{
                var marginTop = jQuery(window).scrollTop();          
            }
                var marginLeft = (ourWidth2 - cartWidth2)/2; 
     
      jQuery('#checkout_alternative_js').css("margin-top",marginTop+"px");
      jQuery('#checkout_alternative_js').css("margin-left",marginLeft+"px");               
                });
          
          }    
          
      function quick_view(product_link) {
          jQuery.get(   
            product_link+"?ajax=1", function (data){
                
                jQuery('#quick-view-form').html(data);                
                jQuery('#quick-view-form').css("display","block");       
                jQuery('#quick-view-form').fadeIn("fast");
                var ourWidth2 = document.documentElement.clientWidth;
                var ourHeight2 = document.documentElement.clientHeight;
                var cartWidth2 = 749;      
                var cartHeight2 = 439;
                var marginTop = (ourHeight2 - cartHeight2)/2;
                var marginLeft = (ourWidth2 - cartWidth2)/2; 
     
      jQuery('#quick-view-form').css("margin-top",marginTop+"px");
      jQuery('#quick-view-form').css("margin-left",marginLeft+"px");            
                });
          
      }
      
      function qv_tocart(product_id){
        jQuery.noConflict();
        
        var forma = jQuery('.cart_quantity input');
        var data = 'q=includes/modules/ajax/ajaxCart.php&';
        var tmp;
        
        forma.each(function(n,element){
            if (element.type == "radio" || element.type == "checkbox") {
                if (element.checked){                              
                    tmp = element.name + "=" + element.value + "&";
                    }
                else{
                    tmp = "";                                   
                }
            } else {
                tmp = "";               
            }
            data = data + tmp;
        });
        data = data + "action=add_product&products_qty=1&products_id="+product_id;
        
        jQuery.ajax({
                    url : "index_ajax.php",
                    dataType : "html",
                    data : data,
                    type : "GET",
                    success : function(msg) {                                             

           // add message
            var upd_cart2 = 1;
            jQuery.post(   
            "myajax.php", 
            {upd_cart2:upd_cart2},  
            function (data){
                var SplitData = data.split(">>"); 
                var cart_count = SplitData[0];
                var cart_total = SplitData[1];
                jQuery('#cart_add_incart span').html(cart_count);
                jQuery('#cart_add_summ span').html(cart_total);        
            });           
      var ourHeight = document.documentElement.clientHeight;
      var ourWidth = document.documentElement.clientWidth;
      var cartaddHeight = 142;
      var cartaddWidth = 344;

      var marginTop = (ourHeight - cartaddHeight)/2;
      var marginLeft = (ourWidth - cartaddWidth)/2;
     
                                         
           // add message
                        
           // update top cart             
            var upd_cart = 1;
            jQuery.post(   
            "myajax.php", 
            {upd_cart:upd_cart},  
            function (data){
                jQuery('#cart-info').html(data);    
            });
           // update top cart
                                                                      
                        jQuery("#divShoppingCart").html(msg);
                        if (jQuery('#divShoppingCart').css("display")=="block"){
                        jQuery('#divShoppingCart #divShoppingCart').css("display","block");                              
                        }
      //qvclose();
      jQuery('#cart_add').css("margin-top",marginTop+"px");
      jQuery('#cart_add').css("margin-left",marginLeft+"px");
      jQuery("#hidimg").css("visibility","visible");    
      jQuery("#hidimg").fadeTo("slow",0.5);                     
      jQuery('#cart_add').css("display","block");                        
                                                   
                    }
        });
      }
      
      function qvclose(){
                jQuery('#quick-view-form').css("display","none");                 
      } 
      
function doAddProduct2(product_id) {
        jQuery.noConflict();
        
        var forma = jQuery('.cart_quantity input');
        var data = 'q=includes/modules/ajax/ajaxCart.php&';
        var tmp;
        
        forma.each(function(n,element){
            if (element.type == "radio" || element.type == "checkbox") {
                if (element.checked){                              
                    tmp = element.name + "=" + element.value + "&";
                    }
                else{
                    tmp = "";                                   
                }
            } else {
                //tmp = element.name + "=" + element.value + "&";
                tmp = "";               
            }
            data = data + tmp;
        });
        data = data + "action=add_product&products_qty=1&products_id="+product_id;
        
        jQuery.ajax({
                    url : "index_ajax.php",
                    dataType : "html",
                    data : data,
                    type : "GET",
                    success : function(msg) {
                        
           // add message
            var upd_cart2 = 1;
            jQuery.post(   
            "myajax.php", 
            {upd_cart2:upd_cart2},  
            function (data){
                var SplitData = data.split(">>"); 
                var cart_count = SplitData[0];
                var cart_total = SplitData[1];
                jQuery('#cart_add_incart span').html(cart_count);
                jQuery('#cart_add_summ span').html(cart_total);        
            });           
     
                                         
           // add message                        
                        
           // update top cart             
            var upd_cart = 1;
            jQuery.post(   
            "myajax.php", 
            {upd_cart:upd_cart},  
            function (data){
                jQuery('#cart-info').html(data);    
            });
           // update top cart
                                                                      
                        jQuery("#divShoppingCart").html(msg);
                        if (jQuery('#divShoppingCart').css("display")=="block"){
                        jQuery('#divShoppingCart #divShoppingCart').css("display","block");                              
                        } 
                                  
                    }
        });
    }      
      
      
      var pos = 0;         
      
      function bs_left(){
        if (pos>0 && pos!=1510 && pos!=3020){        
            pos = pos - 151;
            }
        jQuery('#boxBestsellersContent').stop().animate({bottom:pos+"px"},{queue:false, duration:400}); 
      } 
    
      function bs_right(){
        if (pos<4379 && pos!=1359 && pos!=2869){        
            pos = pos + 151;
            }
        jQuery('#boxBestsellersContent').stop().animate({bottom:pos+"px"},{queue:false, duration:400}); 
      } 

      function techpage_scroll1(){
        jQuery('#techpage-bottom-box-top').css("background-image",'url("/images/techpage-zakladka-1.png")');                    
        jQuery('#techpage-bottom-box-middle-wrapper').stop().animate({right:0+"px"},{queue:false, duration:400}); 
        jQuery('#techpage-bottom-box-middle-wrapper').animate({height:455+"px"},{queue:false, duration:400});  
      }
            
      function techpage_scroll2(){
        jQuery('#techpage-bottom-box-top').css("background-image",'url("/images/techpage-zakladka-2.png")');          
        jQuery('#techpage-bottom-box-middle-wrapper').stop().animate({right:737+"px"},{queue:false, duration:400}); 
        jQuery('#techpage-bottom-box-middle-wrapper').animate({height:350+"px"},{queue:false, duration:400});  
      } 

      var showright = 0;
      
      function showroom_left(){
        if (showright!=0){
        showright = showright - 326;
        jQuery('#showroom-images-wrapper').stop().animate({right:showright+"px"},{queue:false, duration:300});           
        }
        if (showright==0){
        jQuery('#showroom-left').fadeOut("slow");                        
        }
        if (showright<652){          
        jQuery('#showroom-right').fadeIn("slow");            
        }        
      }
      
      function showroom_right(){
        if (showright<652){          
        showright = showright + 326;          
        jQuery('#showroom-images-wrapper').stop().animate({right:showright+"px"},{queue:false, duration:300});           
        }
        if (showright==652){
        jQuery('#showroom-right').fadeOut("slow");            
        }
        if (showright>0){
        jQuery('#showroom-left').fadeIn("slow");
        }              
      }
      
      var filterpos = 0;

      function f10_left(){
        if (filterpos>0){        
            filterpos = filterpos - 74;
            jQuery('#f10 form').stop().animate({right:filterpos+"px"},{queue:false, duration:200});             
            }
        if (filterpos==0){        
            jQuery('#f10-left a').fadeOut("slow");
            }
        if (filterpos<296){        
            jQuery('#f10-right a').fadeIn("slow");
            }            
      }
      
      function f10_right(){
        if (filterpos<296){        
            filterpos = filterpos + 74;
            jQuery('#f10 form').stop().animate({right:filterpos+"px"},{queue:false, duration:200});             
            }
        if (filterpos>0){        
            jQuery('#f10-left a').fadeIn("slow");
            }
        if (filterpos==296){        
            jQuery('#f10-right a').fadeOut("slow");
            }                 
      }                 
      
     /* 
      function product_video(){
                jQuery('#product_video').css("display","block");       
                jQuery('#product_video').fadeIn("fast");
                jQuery("#hidimg").css("visibility","visible");    
                jQuery("#hidimg").fadeTo("slow",0.5);                
                var ourWidth3 = document.documentElement.clientWidth;
                var ourHeight3 = document.documentElement.clientHeight;
                var cartWidth3 = 480;      
                var cartHeight3 = 360;
                var marginTop = (ourHeight3 - cartHeight3)/2;
                var marginLeft = (ourWidth3 - cartWidth3)/2; 
     
            jQuery('#product_video').css("margin-top",marginTop+"px");
            jQuery('#product_video').css("margin-left",marginLeft+"px");
      }   */         

      function sizehelp(){
            var ourHeight = document.documentElement.clientHeight;
            var ourWidth = document.documentElement.clientWidth;
            var sizehelpHeight = 1720;
            var sizehelpWidth = 888;

            var marginTop = (ourHeight - sizehelpHeight)/2;
            if (marginTop<0){
                marginTop = 0;
            }   
        
            marginTop = marginTop + jQuery(window).scrollTop();
                 
            var marginLeft = (ourWidth - sizehelpWidth)/2;
     
            jQuery('#sizehelp').css("margin-top",marginTop+"px");
            jQuery('#sizehelp').css("margin-left",marginLeft+"px");                
            jQuery("#hidimg").css("visibility","visible");    
            jQuery("#hidimg").fadeTo("slow",0.5);                     
            jQuery('#sizehelp').fadeIn("fast"); 
      }
      
      function sizehelp_close(){
            jQuery('#sizehelp').css("display","none");       
            jQuery("#hidimg").css("visibility","hidden");    
            jQuery("#hidimg").fadeTo("slow",0.5);          
      }      
           
      function product_video() {
                jQuery("#big-image").css("display","none");
                jQuery("#video-div").css("display","block");
                var product_video_url = jQuery("#product_video_block").val();                       
                if (!jQuery("#video-div").html()){
                    //jQuery("#video-div").html('<iframe id="product_video_block" width="387" height="387" src="'+product_video_url+'" frameborder="0" allowfullscreen></iframe>');                    
                    jQuery("#video-div").html('<object width="387" height="387"><param name="movie" value="http://www.youtube.com/v/'+product_video_url+'?version=3&amp;hl=ru_RU&amp;rel=0"></param><param name="wmode" value="opaque" /><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+product_video_url+'?version=3&amp;hl=ru_RU&amp;rel=0" type="application/x-shockwave-flash" width="387" height="387" allowscriptaccess="always" allowfullscreen="true" wmode="opaque"></embed></object>');                                  
                }
                jQuery("#copyright-div").css("display","block");                                                                       
      }
      
      var pos2 = 0;   
      
      function blv_left() {
          if (pos2!=0){
            pos2 += 110;
            jQuery('#boxLastViewed-wrapper').stop().animate({left:pos2+"px"},{queue:false, duration:400});             
          }
          if (pos2==0){
                jQuery('#boxLastViewed-left').fadeOut("slow");              
          }
      }     
      
      function blv_right() {
          var boxLastViewed_count = jQuery('#boxLastViewed-count').val();                       
          var boxLastViewed_end = ((boxLastViewed_count * 110)*(-1))+440;
          if (pos2!=boxLastViewed_end){              
          pos2 -= 110;
          jQuery('#boxLastViewed-wrapper').stop().animate({left:pos2+"px"},{queue:false, duration:400});    
          }
          if (pos2==boxLastViewed_end){
                jQuery('#boxLastViewed-right').fadeOut("slow");              
          }          
          if (pos2!=0){
                jQuery('#boxLastViewed-left').fadeIn("slow");              
          }          
      }
      
      jQuery(function() {
        jQuery('#boxLastViewed').mouseover(function() {   
          var boxLastViewed_count = jQuery('#boxLastViewed-count').val();                       
          var boxLastViewed_end = ((boxLastViewed_count * 110)*(-1))+440;
          var lvleft = jQuery('#boxLastViewed-wrapper').css("left");
          if (lvleft!="0px"){
                jQuery('#boxLastViewed-left').fadeIn("slow");
          }
          if (lvleft!=boxLastViewed_end+"px"){
                jQuery('#boxLastViewed-right').fadeIn("slow");
          }
                }
            );
            
        jQuery('#boxLastViewed').mouseleave(function() {   
                jQuery('#boxLastViewed-left').fadeOut("slow");
                jQuery('#boxLastViewed-right').fadeOut("slow");
                });            
        });      
        
      var pos3 = 0;      
        
      function bft_left() {
          if (pos3!=0){
            pos3 += 110;
            jQuery('#boxFeatured-wrapper').stop().animate({left:pos3+"px"},{queue:false, duration:400});             
          }
          if (pos3==0){
                jQuery('#boxFeatured-left').fadeOut("slow");              
          }
      }     
      
      function bft_right() {
          var boxFeatured_count = jQuery('#boxFeatured-count').val();                       
          var boxFeatured_end = ((boxFeatured_count * 110)*(-1))+440;
          if (pos3!=boxFeatured_end){              
          pos3 -= 110;
          jQuery('#boxFeatured-wrapper').stop().animate({left:pos3+"px"},{queue:false, duration:400});    
          }
          if (pos3==boxFeatured_end){
                jQuery('#boxFeatured-right').fadeOut("slow");              
          }          
          if (pos3!=0){
                jQuery('#boxFeatured-left').fadeIn("slow");              
          }          
      }
      
      jQuery(function() {
        jQuery('#boxFeatured').mouseover(function() {   
          var boxFeatured_count = jQuery('#boxFeatured-count').val();                       
          var boxFeatured_end = ((boxFeatured_count * 110)*(-1))+440;
          var lvleft = jQuery('#boxFeatured-wrapper').css("left");
          if (lvleft!="0px"){
                jQuery('#boxFeatured-left').fadeIn("slow");
          }
          if (lvleft!=boxFeatured_end+"px"){
                jQuery('#boxFeatured-right').fadeIn("slow");
          }
                }
            );
            
        jQuery('#boxFeatured').mouseleave(function() {   
                jQuery('#boxFeatured-left').fadeOut("slow");
                jQuery('#boxFeatured-right').fadeOut("slow");
                });            
        }); 
        
        function gotolastviewed(){
            jQuery("#boxLastViewed").css("display","block");
            jQuery("#boxFeatured").css("display","none");                                                      
        }        
        
        function gotofeatured(){
            jQuery("#boxLastViewed").css("display","none");
            jQuery("#boxFeatured").css("display","block");           
        }   
        
        function quick_buy (){
            if (jQuery("#quick-buy-button-input").css("display")=="none"){
            jQuery("#quick-buy-button a").fadeOut("fast");
            jQuery("#quick-buy-button-what").css("display","none");            
            jQuery("#quick-buy-button-input").fadeIn("fast");                
            jQuery('#quick-buy-button-input').animate({width:170}, 300, function(){
            });                          
            jQuery('#quick-buy-button').animate({width:181}, 500, function(){
                jQuery("#quick-buy-button-right").css("background-position","0 -23px");              
            });
            }
            else{
                var qbm_phone = jQuery("#quick-buy-button-input").val();
                var qbm_link = jQuery(".products-info-all-colors-checked").attr("href");
                if (qbm_phone != "ВАШ НОМЕР ТЕЛЕФОНА"){
                jQuery.post(   
                    "myajax.php", 
                    {qbm_phone:qbm_phone,qbm_link:qbm_link},  
                    function (data){
                        alert("Ваш заказ принят. В течение часа с Вами свяжется наш менеджер, и согласует детали доставки.")
                    });
                }
                else{
                    alert("Введите номер телефона");                    
                }
            jQuery('#quick-buy-button-input').attr("value","ВАШ НОМЕР ТЕЛЕФОНА");
            jQuery('#quick-buy-button-input').css("color","#9C9C9C"); 
                   
            jQuery('#quick-buy-button').animate({width:98}, 500, function(){
                jQuery("#quick-buy-button-right").css("background-position","0 0");              
            });
            jQuery('#quick-buy-button-input').animate({width:0}, 300, function(){
            });            
            jQuery("#quick-buy-button-input").fadeOut("fast");                
            jQuery("#quick-buy-button a").fadeIn("fast");                          
            jQuery("#quick-buy-button-what").fadeIn("slow");
            }             
        } 
        
        function quick_buy_input_click (){
        if (jQuery('#quick-buy-button-input').attr("value")=="ВАШ НОМЕР ТЕЛЕФОНА")  {         
            jQuery('#quick-buy-button-input').attr("value","");
            jQuery('#quick-buy-button-input').css("color","#000000");
        }                                            
        } 
    
        function quick_buy_input_blur (){
        if (jQuery('#quick-buy-button-input').attr("value")=="")  {
            jQuery('#quick-buy-button-input').attr("value","ВАШ НОМЕР ТЕЛЕФОНА");
            jQuery('#quick-buy-button-input').css("color","#9C9C9C"); 
                   
            jQuery('#quick-buy-button').animate({width:98}, 500, function(){
                jQuery("#quick-buy-button-right").css("background-position","0 0");              
            });
            jQuery('#quick-buy-button-input').animate({width:0}, 300, function(){
            });            
            jQuery("#quick-buy-button-input").fadeOut("fast");                
            jQuery("#quick-buy-button a").fadeIn("fast");                          
            jQuery("#quick-buy-button-what").fadeIn("slow");                                                       
        }                                      
        } 
        
        function order_status (){
            var ourHeight = document.documentElement.clientHeight;
            var ourWidth = document.documentElement.clientWidth;
            var order_statusHeight = 134;
            var order_statusWidth = 239;

            var marginTop = (ourHeight - order_statusHeight)/2;
            var marginLeft = (ourWidth - order_statusWidth)/2;
     
            jQuery('#order-status').css("margin-top",marginTop+"px");
            jQuery('#order-status').css("margin-left",marginLeft+"px");
            jQuery("#hidimg").css("visibility","visible");    
            jQuery("#hidimg").fadeTo("slow",0.5);                     
            jQuery('#order-status').css("display","block");                                                       
        } 
        
        function order_status_close (){ 
            jQuery('#order-status').fadeOut("fast");  
            jQuery("#hidimg").fadeOut("slow");                                                                                           
            jQuery("#hidimg").css("visibility","hidden");    
        }
        
        function order_status_button (){ 
            var orders_id = jQuery('#order-status-input').val();
            
            jQuery.post(   
            "myajax.php", 
            {orders_id:orders_id},  
            function (data){
                alert(data);
            });                 
        }                               
        
        function login_js (){
            var ourHeight = document.documentElement.clientHeight;
            var ourWidth = document.documentElement.clientWidth;
            var login_jsHeight = 174;
            var login_jsWidth = 239;

            var marginTop = (ourHeight - login_jsHeight)/2;
            var marginLeft = (ourWidth - login_jsWidth)/2;
     
            jQuery('#login-jq').css("margin-top",marginTop+"px");
            jQuery('#login-jq').css("margin-left",marginLeft+"px");
            jQuery("#hidimg").css("visibility","visible");    
            jQuery("#hidimg").fadeTo("slow",0.5);                     
            jQuery('#login-jq').css("display","block");                                                       
        }        
        
        function login_jq_close (){ 
            jQuery('#login-jq').fadeOut("fast");  
            jQuery("#hidimg").fadeOut("slow");                                                                                           
            jQuery("#hidimg").css("visibility","hidden");    
        }        
        
        function login_jq_button (){
            var email_address = jQuery("#login-jq-input-login").val();
            var password = jQuery("#login-jq-input-password").val();
            var x = 36;
            var y = 14;
            
            jQuery.post(   
            "login.php?action=process", 
            {email_address:email_address,password:password,x:x,y:y},  
            function (data){
            }); 
            jQuery('#login-jq').fadeOut("fast");  
            jQuery("#hidimg").fadeOut("slow");                                                                                           
            jQuery("#hidimg").css("visibility","hidden");
            window.setInterval("reload_page()",1000);
        }            

        function reload_page (){
            var thispage = location.href;        
            window.location.href = thispage;
        }
        
        function free_call_button(){
            var ourHeight = document.documentElement.clientHeight;
            var ourWidth = document.documentElement.clientWidth;
            var free_callHeight = 250;
            var free_callWidth = 300;

            var marginTop = (ourHeight - free_callHeight)/2;
            var marginLeft = (ourWidth - free_callWidth)/2;

            jQuery('#free-call').fadeOut("slow");                             
     
            jQuery('#free-call-inner').css("margin-top",marginTop+"px");
            jQuery('#free-call-inner').css("margin-left",marginLeft+"px");
            jQuery("#hidimg").css("visibility","visible");    
            jQuery("#hidimg").fadeTo("slow",0.5);                     
            jQuery('#free-call-inner').css("display","block");     
        }
        
        function free_call_close(){
            jQuery('#free-call').fadeOut("slow");                             
        }
        
        function free_call_close2(){
        if (jQuery('#techpage').css("display")=="none"){
            jQuery("#hidimg").css("visibility","hidden");    
            jQuery("#hidimg").fadeTo("slow",0);    
        }                                 
            jQuery('#free-call-inner').css("display","none");             
            jQuery('#free-call').fadeIn("slow");                             
        }                 
        
        function techpage_close(){         
            jQuery("#hidimg").css("visibility","hidden");    
            jQuery("#hidimg").fadeTo("slow",0);                     
            jQuery('#techpage').fadeOut("fast");                             
        } 
        
        function techpage_show(){ 
            
          jQuery.get(   
            "techpage.html", function (data){
                    jQuery('#techpage').html(data);                
                });            
            
            var ourHeight = document.documentElement.clientHeight;
            var ourWidth = document.documentElement.clientWidth;
            var techpageHeight = 770;
            var techpageWidth = 778;

            var marginTop = (ourHeight - techpageHeight)/2;
            if (marginTop<0){
                marginTop = 0;
            }   
        
            marginTop = marginTop + jQuery(window).scrollTop();
                 
            var marginLeft = (ourWidth - techpageWidth)/2;
     
            jQuery('#techpage').css("margin-top",marginTop+"px");
            jQuery('#techpage').css("margin-left",marginLeft+"px");                
            jQuery("#hidimg").css("visibility","visible");    
            jQuery("#hidimg").fadeTo("slow",0.5);                     
            jQuery('#techpage').fadeIn("fast");                             
        }                
