if(!window.sdg){sdg={};}sdg.productCarousel=function(b){b=$sd.extend({carouselSelector:"",wide:false,emphasised:false,lightBox:false,lightBoxURL:"",itemsVisible:1,scroll:1},b||{});
var a=function(){var e=[];var d=$sd("#picknmix_belt_content ul li").size();for(var c=1;
c<=d;c++){e[c-1]=b.carouselSelector+" ."+c;}return e;};$sd(b.carouselSelector+" .carousel").jCarouselLite({speed:800,btnNext:"#carouselPickNMix .next",btnPrev:"#carouselPickNMix .prev",btnGo:a()});
};var missNextIfAuto=false;(function(d){$sd.fn.jCarouselLite=function(e){e=$sd.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:false,visible:1,start:0,scroll:1,pagePlacement:null,pageContainerClass:null,pageItemsContainer:null,pageItems:null,pageItemSelectedClass:null,pageItemsClass:null,beforeStart:null,afterEnd:null,afterBuild:null},e||{});
cl=this.each(function(){var n=false,l=e.vertical?"top":"left",g=e.vertical?"height":"width";
var f=d(this),p=d("ul",f),i=d("li",p),t=i.size(),s=e.visible;var r=d("li",p),o=r.size(),w=e.start;
f.css("visibility","visible");var u=e.vertical?"none":"left";r.css({overflow:"hidden"}).css("float",u);
p.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});
f.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var k=e.vertical?a(r):c(r);
var q=(k*o);var m=(k*s)-1;p.css(g,q+"px").css(l,-(w*k));r.filter(":last").addClass("last");
if(e.btnPrev){d(e.btnPrev).click(function(){missNextIfAuto=true;return j(w-e.scroll,false);
});}if(e.btnNext){d(e.btnNext).click(function(){missNextIfAuto=true;return j(w+e.scroll,false);
});}if(e.btnGo){d(e.btnGo).each(function(v){var x=v+1;d("#picknmix_belt_content ."+x).click(function(){stepTo=(x*e.visible)-e.visible;
return j(e.circular?e.visible+stepTo:stepTo,false);});});}function h(){return r.slice(w).slice(0,s);
}function j(x,v){if(!n&&((v==true&&!missNextIfAuto)||v==false)){if(x<0||x>=o){return false;
}else{w=x;$sd("#currVal").val(x+1);}n=true;p.animate(l=="left"?{left:-(w*k)}:{top:-(w*k)},e.speed,e.easing,function(){if(e.afterEnd){e.afterEnd.call(this,h(),(w/e.visible)+1);
}n=false;});if(!e.circular){d(e.btnPrev+","+e.btnNext).removeClass("disabled");d((w-e.scroll<0&&e.btnPrev)||(w+e.scroll>o-s&&e.btnNext)||[]).addClass("disabled");
}}if(v){missNextIfAuto=false;}return false;}});return cl;};function b(e,f){return parseInt($sd.css(e[0],f))||0;
}function c(e){return parseInt(e.css("width"))+parseInt(e.css("padding-left"))+parseInt(e.css("padding-right"))+parseInt(e.css("margin-left"))+parseInt(e.css("margin-right"));
}function a(e){return parseInt(e.css("height"))+parseInt(e.css("padding-top"))+parseInt(e.css("padding-bottom"))+parseInt(e.css("margin-top"))+parseInt(e.css("margin-bottom"));
}})(jQuery);
