(function($){window.pix={fn:{}};$.fn.equalizeHeight=function(){var maxHeight=0;return this.each(function(){if($(this).height()>maxHeight){maxHeight=$(this).height();}}).css("min-height",maxHeight);};dsg.fn.initDropMenu=function(box){var selectTimer;var iWidth=($(box).find('dl').outerWidth())-2;var $dd=$(box).find('dd').bind('expand',function(){$(this).prev().children("span.expander").addClass("expanded");$(this).slideDown(150);}).bind('collapse',function(){$(this).prev().children("span.expander").removeClass("expanded");$(this).slideUp(150);}).prev().append('<span class="expander"></span>').click(function(){var $elt=$(this).next();if(!$elt.is(':visible')){$elt.trigger('expand');}else{$elt.trigger('collapse');}}).parent().hover(function(){window.clearTimeout(selectTimer);},function(){selectTimer=window.setTimeout(function(){$dd.trigger('collapse');},500);}).find('dd').css({width:iWidth+"px"}).hide();};$.fn.topSellers=function(){var jTopSellers=$(this),jTopSellersNav=jTopSellers.find(".top-sellers-nav li"),jTopSellersContent=jTopSellers.find(".top-sellers-products");jTopSellersNav.children("a").each(function(){$(this).click(function(e){e.preventDefault();jLink=$(this);jRel=jLink.attr("rel");jTopSellersContent.append('<div class="loader">Chargement</div>');$.ajax({url:jRel,dataType:"html",success:function(data){jTopSellersNav.removeClass("active");jLink.parent().addClass("active");jTopSellersContent.html(data);}});});});};$(function(){var jCarousel=$('.box-carousel > .box-content'),jItems=jCarousel.find('li');if(jItems.length>1){jCarousel.carousel({pagination:true,autoSlide:true,firstSlideInterval:2000,autoSlideInterval:5000,nextBtn:"",prevBtn:""});};$j('.box-home').each(function(e){if($j(this).is('.odd')){$j('.box-home').slice(e,e+2).equalizeHeight();}});$('.vertical-top-sellers').topSellers();});dsg.fn.initSelectHome=function(){var jSelect=$j('.sidebar select');jSelect.skinselect().each(function(){$(this).change(function(){$(this).parents('form').submit();});});};})(jQuery);
