jQuery(function($){$(".scrollable").scrollable({circular:true}).autoscroll().navigator();});var inCart=false;if(window.location.toString().search('/product_compare/')!=-1){var win=window.opener;}
else{var win=window;}
if(window.location.toString().search('/checkout/cart/')!=-1){inCart=true;}
function setLocation(url){if(!inCart&&(url.search('checkout/cart/add')!=-1)){sendcart(url,'url');}else{window.location.href=url;}}
function sendcart(url,type){showLoading();if(type=='form'){url=($('product_addtocart_form').action).replace('checkout','j2tajaxcheckout/index/cart');var myAjax=new Ajax.Request(url,{method:'post',postBody:$('product_addtocart_form').serialize(),parameters:Form.serialize("product_addtocart_form"),onException:function(xhr,e)
{alert('Exception : '+e);},onComplete:function(xhr)
{$('j2t-temp-div').innerHTML=xhr.responseText;var return_message=$('j2t-temp-div').down('.j2t_ajax_message').innerHTML;var middle_text='<div class="j2t-cart-bts">'+$('j2t-temp-div').down('.back-ajax-add').innerHTML+'</div>';middle_text+='<a class="j2t-close-link" href="javascript:void(0);" onclick="hideJ2tOverlay();">X</a><div id="j2t-cart-cadeaux">'+$('j2t-temp-div').down('.j2t-cart-cadeaux').innerHTML+'</div>';$('j2t_ajax_confirm').innerHTML='<div id="j2t_ajax_confirm_wrapper">'+return_message+middle_text+'</div>';var link_cart_txt=$('j2t-temp-div').down('.cart_content').innerHTML;$$('.top-link-cart').each(function(el){el.innerHTML=link_cart_txt;});var mini_cart_txt=$('j2t-temp-div').down('.cart_side_ajax').innerHTML;$$('.mini-cart').each(function(el){el.replace(mini_cart_txt);});$$('.block-cart').each(function(el){el.replace(mini_cart_txt);});replaceDelUrls();if(ajax_cart_show_popup){showConfirm();}else{hideJ2tOverlay();}}});}else if(type=='url'){url=url.replace('checkout','j2tajaxcheckout/index/cart');var myAjax=new Ajax.Request(url,{method:'post',postBody:'',onException:function(xhr,e)
{alert('Exception : '+e);},onComplete:function(xhr)
{$('j2t-temp-div').innerHTML=xhr.responseText;var return_message=$('j2t-temp-div').down('.j2t_ajax_message').innerHTML;var middle_text='<div class="j2t-cart-bts">'+$('j2t-temp-div').down('.back-ajax-add').innerHTML+'</div>';middle_text+='<a class="j2t-close-link" href="javascript:void(0);" onclick="hideJ2tOverlay();">X</a><div id="j2t-cart-cadeaux">'+$('j2t-temp-div').down('.j2t-cart-cadeaux').innerHTML+'</div>';var content_ajax=return_message+middle_text;$('j2t_ajax_confirm').innerHTML='<div id="j2t_ajax_confirm_wrapper">'+content_ajax+'</div>';var link_cart_txt=$('j2t-temp-div').down('.cart_content').innerHTML;$$('.top-link-cart').each(function(el){el.innerHTML=link_cart_txt;});var mini_cart_txt=$('j2t-temp-div').down('.cart_side_ajax').innerHTML;$$('.mini-cart').each(function(el){el.replace(mini_cart_txt);});$$('.block-cart').each(function(el){el.replace(mini_cart_txt);});replaceDelUrls();if(ajax_cart_show_popup){showConfirm();}else{hideJ2tOverlay();}}});}}
function replaceDelUrls(){}
function replaceAddUrls(){$$('a').each(function(link){if(link.href.search('checkout/cart/add')!=-1){link.href='javascript:setLocation(\''+link.href+'\'); void(0);';}});}
function cartdelete(url){showLoading();url=url.replace('checkout','j2tajaxcheckout/index/cartdelete');var myAjax=new Ajax.Request(url,{method:'post',postBody:'',onException:function(xhr,e)
{alert('Exception : '+e);},onComplete:function(xhr)
{$('j2t-temp-div').innerHTML=xhr.responseText;var cart_content=$('j2t-temp-div').down('.cart_content').innerHTML;$$('.top-link-cart').each(function(el){el.innerHTML=cart_content;});var process_reload_cart=false;var full_cart_content=$('j2t-temp-div').down('.j2t_full_cart_content').innerHTML;$$('.cart').each(function(el){el.replace(full_cart_content);process_reload_cart=true;});if(!process_reload_cart){$$('.checkout-cart-index .col-main').each(function(el){el.replace(full_cart_content);});}
var cart_side='';if($('j2t-temp-div').down('.cart_side_ajax')){cart_side=$('j2t-temp-div').down('.cart_side_ajax').innerHTML;}
$$('.mini-cart').each(function(el){el.replace(cart_side);});$$('.block-cart').each(function(el){el.replace(cart_side);});replaceDelUrls();hideJ2tOverlay();}});}
function showJ2tOverlay(){new Effect.Appear($('j2t-overlay'),{duration:0.5,to:0.8});}
function hideJ2tOverlay(){$('j2t-overlay').hide();$('j2t_ajax_progress').hide();$('j2t_ajax_confirm').hide();}
function j2tCenterWindow(element){if($(element)!=null){var el=$(element);var elDims=el.getDimensions();var browserName=navigator.appName;if(browserName==="Microsoft Internet Explorer"){if(document.documentElement.clientWidth==0){var y=(document.viewport.getScrollOffsets().top+(document.body.clientHeight-elDims.height)/2);var x=(document.viewport.getScrollOffsets().left+(document.body.clientWidth-elDims.width)/2);}
else{var y=(document.viewport.getScrollOffsets().top+(document.documentElement.clientHeight-elDims.height)/2);var x=(document.viewport.getScrollOffsets().left+(document.documentElement.clientWidth-elDims.width)/2);}}
else{var y=Math.round(document.viewport.getScrollOffsets().top+((window.innerHeight-$(element).getHeight()))/2);var x=Math.round(document.viewport.getScrollOffsets().left+((window.innerWidth-$(element).getWidth()))/2);}
var styles={position:'absolute',top:y+'px',left:x+'px'};el.setStyle(styles);}}
function showLoading(){showJ2tOverlay();var progress_box=$('j2t_ajax_progress');progress_box.show();progress_box.style.width=loadingW+'px';progress_box.style.height=loadingH+'px';$('j2t_ajax_progress').innerHTML=$('j2t-loading-data').innerHTML;progress_box.style.position='absolute';j2tCenterWindow(progress_box);}
function showConfirm(){showJ2tOverlay();$('j2t_ajax_progress').hide();var confirm_box=$('j2t_ajax_confirm');confirm_box.show();confirm_box.style.width=confirmW+'px';confirm_box.style.height=confirmH+'px';if($('j2t_ajax_confirm_wrapper')&&$('j2t-upsell-product-table')){confirm_box.style.height=$('j2t_ajax_confirm_wrapper').getHeight()+'px';decorateTable('j2t-upsell-product-table');}
$('j2t_ajax_confirm_wrapper').replace('<div id="j2t_ajax_confirm_wrapper">'+$('j2t_ajax_confirm_wrapper').innerHTML);confirm_box.style.position='absolute';j2tCenterWindow(confirm_box);}
function showNewsletter(){var adressemail=jQuery('#newsletter').val();jQuery('#newsletterpopup').val(adressemail);showJ2tOverlay();var newsblock=$('j2t_ajax_confirm');newsblock.show();newsblock.style.width=loadingW+'px';newsblock.style.height=loadingH+'px';newsblock.style.position='absolute';j2tCenterWindow(newsblock);}
function showConditionDeVente(){showJ2tOverlay();var cdvblock=$('j2t_ajax_confirm');cdvblock.show();cdvblock.style.width=loadingW+'px';cdvblock.style.height=loadingH+'px';$('j2t_ajax_confirm').innerHTML=$('j2t_ajax_cdv').innerHTML;cdvblock.style.position='absolute';j2tCenterWindow(cdvblock);}
document.observe("dom:loaded",function(){replaceDelUrls();replaceAddUrls();Event.observe($('j2t-overlay'),'click',hideJ2tOverlay);var cartInt=setInterval(function(){if(typeof productAddToCartForm!='undefined'){if($('j2t-overlay')){Event.observe($('j2t-overlay'),'click',hideJ2tOverlay);}
productAddToCartForm.submit=function(url){if(this.validator&&this.validator.validate()){sendcart('','form');clearInterval(cartInt);}
return false;}}else{clearInterval(cartInt);}},500);});;jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});;(function($){$(document).ready(function(){});function format(str){for(var i=1;i<arguments.length;i++){str=str.replace('%'+(i-1),arguments[i])}
return str}
function CloudZoom(jWin,opts){var sImg=$('img',jWin);var img1;var img2;var zoomDiv=null;var $mouseTrap=null;var lens=null;var $tint=null;var softFocus=null;var $ie6Fix=null;var zoomImage;var controlTimer=0;var cw,ch;var destU=0;var destV=0;var currV=0;var currU=0;var filesLoaded=0;var mx,my;var ctx=this,zw;setTimeout(function(){if($mouseTrap===null){var w=jWin.width();jWin.parent().append(format('<div style="width:%0px;position:absolute;top:75%;left:%1px;text-align:center" class="cloud-zoom-loading" >Loading...</div>',w/3,(w/2)-(w/6))).find(':last').css('opacity',0.5)}},200);var ie6FixRemove=function(){if($ie6Fix!==null){$ie6Fix.remove();$ie6Fix=null}};this.removeBits=function(){if(lens){lens.remove();lens=null}
if($tint){$tint.remove();$tint=null}
if(softFocus){softFocus.remove();softFocus=null}
ie6FixRemove();$('.cloud-zoom-loading',jWin.parent()).remove()};this.destroy=function(){jWin.data('zoom',null);if($mouseTrap){$mouseTrap.unbind();$mouseTrap.remove();$mouseTrap=null}
if(zoomDiv){zoomDiv.remove();zoomDiv=null}
this.removeBits()};this.fadedOut=function(){if(zoomDiv){zoomDiv.remove();zoomDiv=null}
this.removeBits()};this.controlLoop=function(){if(lens){var x=(mx-sImg.offset().left-(cw*0.5))>>0;var y=(my-sImg.offset().top-(ch*0.5))>>0;if(x<0){x=0}else if(x>(sImg.outerWidth()-cw)){x=(sImg.outerWidth()-cw)}
if(y<0){y=0}else if(y>(sImg.outerHeight()-ch)){y=(sImg.outerHeight()-ch)}
lens.css({left:x,top:y});lens.css('background-position',(-x)+'px '+(-y)+'px');destU=(((x)/sImg.outerWidth())*zoomImage.width)>>0;destV=(((y)/sImg.outerHeight())*zoomImage.height)>>0;currU+=(destU-currU)/opts.smoothMove;currV+=(destV-currV)/opts.smoothMove;zoomDiv.css('background-position',(-(currU>>0)+'px ')
+(-(currV>>0)+'px'))}
controlTimer=setTimeout(function(){ctx.controlLoop()},30)};this.init2=function(img,id){filesLoaded++;if(id===1){zoomImage=img}
if(filesLoaded===2){this.init()}};this.init=function(){$('.cloud-zoom-loading',jWin.parent()).remove();$mouseTrap=jWin.parent().append(format("<div class='mousetrap' style='background-image:url(\".\");z-index:999;position:absolute;width:%0px;height:%1px;left:%2px;top:%3px;\'></div>",sImg.outerWidth(),sImg.outerHeight(),0,0)).find(':last');$mouseTrap.bind('mousemove',this,function(event){mx=event.pageX;my=event.pageY});$mouseTrap.bind('mouseleave',this,function(event){clearTimeout(controlTimer);if(lens){lens.fadeOut(299)}
if($tint){$tint.fadeOut(299)}
if(softFocus){softFocus.fadeOut(299)}
zoomDiv.fadeOut(300,function(){ctx.fadedOut()});return false});$mouseTrap.bind('mouseenter',this,function(event){if(opts.minWidth!=null&&zoomImage.width<opts.minWidth)
return;if(opts.minHeight!=null&&zoomImage.height<opts.minHeight)
return;mx=event.pageX;my=event.pageY;zw=event.data;if(zoomDiv){zoomDiv.stop(true,false);zoomDiv.remove()}
var xPos=opts.adjustX,yPos=opts.adjustY;var siw=sImg.outerWidth();var sih=sImg.outerHeight();var w=opts.zoomWidth;var h=opts.zoomHeight;if(opts.zoomWidth=='auto'){w=siw}
if(opts.zoomHeight=='auto'){h=sih}
var appendTo=jWin.parent();switch(opts.position){case'top':yPos-=h;break;case'right':xPos+=siw;break;case'bottom':yPos+=sih;break;case'left':xPos-=w;break;case'inside':w=siw;h=sih;break;default:appendTo=$('#'+opts.position);if(!appendTo.length){appendTo=jWin;xPos+=siw;yPos+=sih}else{w=appendTo.innerWidth();h=appendTo.innerHeight()}}
zoomDiv=appendTo.append(format('<div id="cloud-zoom-big" class="cloud-zoom-big" style="display:none;position:absolute;left:%0px;top:%1px;width:%2px;height:%3px;background-image:url(\'%4\');z-index:99;"></div>',xPos,yPos,w,h,zoomImage.src)).find(':last');if(sImg.attr('title')&&opts.showTitle){zoomDiv.append(format('<div class="cloud-zoom-title">%0</div>',sImg.attr('title'))).find(':last').css('opacity',opts.titleOpacity)}
if($.browser.msie&&$.browser.version<7){$ie6Fix=$('<iframe frameborder="0" src="#"></iframe>').css({position:"absolute",left:xPos,top:yPos,zIndex:99,width:w,height:h}).insertBefore(zoomDiv)}
zoomDiv.fadeIn(500);if(lens){lens.remove();lens=null}
cw=(sImg.outerWidth()/zoomImage.width)*parseInt(zoomDiv.css("width"));ch=(sImg.outerHeight()/zoomImage.height)*parseInt(zoomDiv.css("height"));lens=jWin.append(format("<div class = 'cloud-zoom-lens' style='display:none;z-index:98;position:absolute;width:%0px;height:%1px;'></div>",cw,ch)).find(':last');$mouseTrap.css('cursor',lens.css('cursor'));var noTrans=false;if(opts.tint){lens.css('background','url("'
+sImg.attr('src')+'")');$tint=jWin.append(format('<div style="display:none;position:absolute; left:0px; top:0px; width:%0px; height:%1px; background-color:%2;" />',sImg.outerWidth(),sImg.outerHeight(),opts.tint)).find(':last');$tint.css('opacity',opts.tintOpacity);noTrans=true;$tint.fadeIn(500)}
if(opts.softFocus){lens.css('background','url("'
+sImg.attr('src')+'")');softFocus=jWin.append(format('<div style="position:absolute;display:none;top:2px; left:2px; width:%0px; height:%1px;" />',sImg.outerWidth()-2,sImg.outerHeight()-2,opts.tint)).find(':last');softFocus.css('background','url("'
+sImg.attr('src')+'")');softFocus.css('opacity',0.5);noTrans=true;softFocus.fadeIn(500)}
if(!noTrans){lens.css('opacity',opts.lensOpacity)}
if(opts.position!=='inside'){lens.fadeIn(500)}
zw.controlLoop();return})};img1=new Image();$(img1).load(function(){ctx.init2(this,0)});img1.src=sImg.attr('src');img2=new Image();$(img2).load(function(){ctx.init2(this,1)});img2.src=jWin.attr('href')}
$.fn.CloudZoom=function(options){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}
this.each(function(){var relOpts,opts;eval('var a = {'+$(this).attr('rel')+'}');relOpts=a;if($(this).is('.cloud-zoom')){$(this).css({'position':'relative','display':'block'});$('img',$(this)).css({'display':'block'});if($(this).parent().attr('id')!='wrap'){$(this).wrap('<div id="wrap" style="top:0px;z-index:100;position:relative;"></div>')}
opts=$.extend({},$.fn.CloudZoom.defaults,options);opts=$.extend({},opts,relOpts);$(this).data('zoom',new CloudZoom($(this),opts))}else if($(this).is('.cloud-zoom-gallery')){opts=$.extend({},relOpts,options);$(this).data('relOpts',opts);$(this).bind('click',$(this),function(event){var data=event.data.data('relOpts');$('#'+data.useZoom).data('zoom').destroy();$('#'+data.useZoom).attr('href',event.data.attr('href'));$('#'+data.useZoom+' img').attr('src',event.data.data('relOpts').smallImage);$('#'
+event.data.data('relOpts').useZoom).CloudZoom();return false})}});return this};$.fn.CloudZoom.defaults={zoomWidth:'auto',zoomHeight:'auto',position:'right',tint:false,tintOpacity:0.5,lensOpacity:0.5,softFocus:false,smoothMove:3,showTitle:true,titleOpacity:0.5,adjustX:0,adjustY:0,minWidth:null,minHeight:null}})(jQuery);;
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 */
(function($){var $div=$('<div style="background-position: 3px 5px">');$.support.backgroundPosition=$div.css('backgroundPosition')==="3px 5px"?true:false;$.support.backgroundPositionXY=$div.css('backgroundPositionX')==="3px"?true:false;$div=null;var xy=["X","Y"];function parseBgPos(bgPos){var parts=bgPos.split(/\s/),values={"X":parts[0],"Y":parts[1]};return values;}
if(!$.support.backgroundPosition&&$.support.backgroundPositionXY){$.cssHooks.backgroundPosition={get:function(elem,computed,extra){return $.map(xy,function(l,i){return $.css(elem,"backgroundPosition"+l);}).join(" ");},set:function(elem,value){$.each(xy,function(i,l){var values=parseBgPos(value);elem.style["backgroundPosition"+l]=values[l];});}};}
if($.support.backgroundPosition&&!$.support.backgroundPositionXY){$.each(xy,function(i,l){$.cssHooks["backgroundPosition"+l]={get:function(elem,computed,extra){var values=parseBgPos($.css(elem,"backgroundPosition"));return values[l];},set:function(elem,value){var values=parseBgPos($.css(elem,"backgroundPosition")),isX=l==="X";elem.style.backgroundPosition=(isX?value:values["X"])+" "+
(isX?values["Y"]:value);}};$.fx.step["backgroundPosition"+l]=function(fx){$.cssHooks["backgroundPosition"+l].set(fx.elem,fx.now+fx.unit);};});}})(jQuery);;jQuery.noConflict();jQuery(function($){try{$(".block-layered-nav ol:not(#amshopby-price-slider, .currently)").jScrollPane({autoReinitialise:true});}catch(e){}
$(".sorter select").mSelect({eventClick:function(value,html){window.location=value;}});window.fbAsyncInit=function(){FB.XFBML.parse();};var e=document.createElement('script');e.async=true;e.src=document.location.protocol+'//connect.facebook.net/'+lang+'/all.js#xfbml=1';$("head").append(e);$(".block-viewed .block-content").scrollable({circular:true}).autoscroll();$("#nav ul").remove();$(".smenu-1").appendTo(".nav-1");$(".smenu-2").appendTo(".nav-2");$(".smenu-3").appendTo(".nav-3");$(".smenu-4").appendTo(".nav-4");$(".smenu-5").appendTo(".nav-5");$(".smenu-6").appendTo(".nav-6");$(".smenu:not(.smenu-6) .right").each(function(index,element){var maxHeight=0;$(this).find(".col").each(function(idx,el){if($(el).height()>maxHeight)maxHeight=$(el).height();});$(this).find(".col").height(maxHeight-15);if($(this).innerHeight()>$(this).prev().height())$(this).prev().height($(this).innerHeight())});$(".smenu .left img").load(function(){ajustement($(this));});$(".smenu .left img").each(function(index,element){ajustement($(element));});function ajustement(ob){if(ob.height()>=ob.parents(".left").height()){ob.parents(".left").height(ob.height()+42);ob.parents(".left").next().find(".col").height(ob.parents(".left").height()-10);}}
$(".pages .next, .pages .previous").wrapInner("<span />");$(".product-shop .add-to-cart .qty, #shopping-cart-table .qty").keyup(function(){$(this).parents("form").submit()});var qtyChangeTimerID;var less=$("<div class=\"qty-less\" />").click(function(){if(parseInt($(this).next().val())>1){$(this).next().val(parseInt($(this).next().val())-1);clearTimeout(qtyChangeTimerID);qtyChangeTimerID=setTimeout(function(){$(this).parents("form").submit();}.bind(this),600);}});var more=$("<div class=\"qty-more\" />").click(function(){$(this).prev().val(parseInt($(this).prev().val())+1);clearTimeout(qtyChangeTimerID);qtyChangeTimerID=setTimeout(function(){$(this).parents("form").submit();}.bind(this),600);});$(".product-shop .add-to-cart .qty, #shopping-cart-table .qty").before(less).after(more);$("<div class=\"star\" />").insertAfter("#review-form input[type=\"radio\"]").click(function(){if($(this).index()>=$(".star.current").index()){animateStar($(this).prevAll(".star:not(\".selected\")").add(this),54);}else{animateStar($($(this).nextAll(".star").toArray().reverse()),0);}})
function animateStar(ob,pos){var delay=0;ob.each(function(index,element){$(element).removeClass("current");if(index==ob.size()-1){$(element).addClass("current");if(pos>0){$(element).prev().click();}else{$(element).prevAll("input").eq(1).click();}}
$(element).delay(delay).animate({backgroundPositionY:pos},500,"easeOutBounce");delay+=100;});}
$('img[rel="#overlay_video"], span[rel="#overlay_video"]').overlay({mask:'#000',top:"center"});$("#overlay_video").appendTo("body");function formatProductShopPrice(){$(".product-shop .price").html(function(){$(this).text($.trim($(this).text()));if($(this).text().indexOf(",")==-1)return $(this).html();return $(this).text().substring(0,$(this).text().indexOf(","))+$(this).text().charAt($(this).text().length-1)+"<sup>"+$(this).text().substring($(this).text().indexOf(",")+1,$(this).text().length-1)+"</sup>";});}
if($(".catalog-product-view").size()>0){formatProductShopPrice();}
$(".header .links li").eq(1).addClass("mon-compte");$(".cart .crosssell .pourcentage").each(function(index,element){if($(element).prev().find(".old-price .price").size()>0){$(element).insertAfter($(element).prev().find(".old-price .price"));}else{$(element).remove();}});$("#shopping-cart-table tr:not(.produit-propose) td:not(:first-child,:nth-child(2)), #my-orders-table td:not(:first-child,:nth-child(2))").append("<div class=\"border\" />")
$("div.border").each(function(index,element){var top=$(this).parent().position().top+5;var left=$(this).parent().position().left;var height=$(this).parent().height()-12;$(this).css({top:top+"px",left:left+"px",height:height+"px"});});$('.cloud-zoom, .cloud-zoom-gallery').CloudZoom();if($("#product-attribute-specs").size()==0){$(".product-view .product-shop .availability, .product-view .add-to-box, .product-view .product-shop .link-stock-alert").addClass("no-attr");}});var Lpad=function(str,padString,length){str=str.toString();while(str.length<length)
str=padString+str;return str;}
var DecompteChronos=function(){jQuery('.decompte').each(function(){var iDays=0;var iHours=0;var tCurChronos;var this_html;var time_html;if(jQuery(this).html()!="Terminé"){this_html=jQuery(this).html().split('s');time_html=this_html[0];var sCurTimeChronos=new Date();var tCur=time_html.split('j ');if(tCur.length==1){tCurChronos=time_html.split(':');}else{iDays=parseInt(tCur[0]);tCurChronos=tCur[1].split(':');}
if(false)
{iDays=Math.floor(parseInt(tCurChronos[0])/24);iHours=parseInt(tCurChronos[0])%24;}
else
{iHours=tCurChronos[0];}
sCurTimeChronos.setHours(iHours,tCurChronos[1],tCurChronos[2]-1);var Hours=sCurTimeChronos.getHours();var Minutes=sCurTimeChronos.getMinutes();var Seconds=sCurTimeChronos.getSeconds();if((iDays==0)&&(parseInt(Hours)==0)&&(parseInt(Minutes)==0)&&(parseInt(Seconds)==0))
{jQuery(this).html("Terminé");}
else
{if((parseInt(Hours)==23)&&(parseInt(Minutes)==59)&&(parseInt(Seconds)==59))
{iDays--;}
var sFormattedChronos="";if(iDays>0)
sFormattedChronos+=Lpad(iDays,"0",2)+"j ";sFormattedChronos+=Lpad(Hours,"0",2)+":";sFormattedChronos+=Lpad(Minutes,"0",2)+":";sFormattedChronos+=Lpad(Seconds,"0",2)+"s";jQuery(this).html(sFormattedChronos);}}else{jQuery(this).html("Terminé");}});setTimeout("DecompteChronos()",1000);}
jQuery(document).ready(function(){DecompteChronos();});
