(function(b){var a=function(j,p){var h=b.extend({},b.fn.nivoSlider.defaults,p);var m={currentSlide:0,currentImage:"",totalSlides:0,randAnim:"",running:false,paused:false,stop:false};var d=b(j);d.data("nivo:vars",m);d.css("position","relative");d.addClass("nivoSlider");var e=d.children();e.each(function(){var t=b(this);var s="";if(!t.is("img")){if(t.is("a")){t.addClass("nivo-imageLink");s=t}t=t.find("img:first")}var r=t.width();if(r==0){r=t.attr("width")}var q=t.height();if(q==0){q=t.attr("height")}if(r>d.width()){d.width(r)}if(q>d.height()){d.height(q)}if(s!=""){s.css("display","none")}t.css("display","none");m.totalSlides++});if(h.startSlide>0){if(h.startSlide>=m.totalSlides){h.startSlide=m.totalSlides-1}m.currentSlide=h.startSlide}if(b(e[m.currentSlide]).is("img")){m.currentImage=b(e[m.currentSlide])}else{m.currentImage=b(e[m.currentSlide]).find("img:first")}if(b(e[m.currentSlide]).is("a")){b(e[m.currentSlide]).css("display","block")}d.css("background",'url("'+m.currentImage.attr("src")+'") no-repeat');d.append(b('<div class="nivo-caption"></div>').css({display:"none",opacity:h.captionOpacity}));var n=function(q){var s=b(".nivo-caption",d);if(m.currentImage.attr("title")!=""&&m.currentImage.attr("title")!=undefined){var r=m.currentImage.attr("title");if(r.substr(0,1)=="#"){r=b(r).html()}if(s.css("display")=="block"){s.find("p").fadeOut(q.animSpeed,function(){b(this).html(r);b(this).fadeIn(q.animSpeed)})}else{s.find("p").html(r)}s.fadeIn(q.animSpeed)}else{s.fadeOut(q.animSpeed)}};n(h);var c=0;if(!h.manualAdvance&&e.length>1){c=setInterval(function(){o(d,e,h,false)},h.pauseTime)}if(h.directionNav){d.append('<div class="nivoInfos"></div>');if(h.directionNavHide){b(".nivoInfos",d).hide();d.hover(function(){var q=(m.currentImage.attr("id")).split("-");if(q[0]=="featured"){b(".nivoInfos",d).show().animate({width:600,height:300,display:"block",top:0,left:0,opacity:100},300);var r=q[1];b.post(url+"&product_id="+r,function(t){if(t){var u=jQuery.parseJSON(t);var s='<div id="slide-'+u.product_id+'" class="slideData">';s+='<h4 class="infos">'+u.name+"</h4>";if(u.special){s+='<div class="sliderPrices">';s+='<span class="slider_price" style=" text-decoration:line-through; color:#d00">'+u.price+"</span><br />";s+='<span class="slider_special">'+u.special+"</span>"}else{s+='<div class="sliderPrices"><span class="slider_price">'+u.price+"</span>"}s+='</div><a href="'+u.href+'" class="buttonInfo">INFO</a>';s+='<a onclick="addToCart('+u.product_id+');" class="button">'+u.btnAdd+"</a>";s+="</div>";b(".nivoInfos").html(s)}})}},function(){b(".nivoInfos",d).animate({width:"0px",height:"0px",display:"none",opacity:"0"},300).hide();b(".slideData").remove()})}}if(h.controlNav){var k=b("");d.append(k);b(".navx a:eq("+m.currentSlide+")").addClass("aktive");b("#img-"+m.currentSlide).addClass("aktive");b(".navx a").live("click",function(){if(m.running){return false}if(b(this).hasClass("active")){return false}clearInterval(c);c="";d.css("background",'url("'+m.currentImage.attr("src")+'") no-repeat');m.currentSlide=b(this).attr("rel")-1;o(d,e,h,"control")})}if(h.keyboardNav){b(window).keypress(function(q){if(q.keyCode=="37"){if(m.running){return false}clearInterval(c);c="";m.currentSlide-=2;o(d,e,h,"prev")}if(q.keyCode=="39"){if(m.running){return false}clearInterval(c);c="";o(d,e,h,"next")}})}if(h.pauseOnHover){d.hover(function(){m.paused=true;clearInterval(c);c=""},function(){m.paused=false;if(c==""&&!h.manualAdvance){c=setInterval(function(){o(d,e,h,false)},h.pauseTime)}})}d.bind("nivo:animFinished",function(){m.running=false;b(e).each(function(){if(b(this).is("a")){b(this).css("display","none")}});if(b(e[m.currentSlide]).is("a")){b(e[m.currentSlide]).css("display","block")}if(c==""&&!m.paused&&!h.manualAdvance){c=setInterval(function(){o(d,e,h,false)},h.pauseTime)}h.afterChange.call(this)});var f=function(s,r,u){for(var q=0;q<r.slices;q++){var t=Math.round(s.width()/r.slices);if(q==r.slices-1){s.append(b('<div class="nivo-slice"></div>').css({left:(t*q)+"px",width:(s.width()-(t*q))+"px",height:"0px",opacity:"0",background:'url("'+u.currentImage.attr("src")+'") no-repeat -'+((t+(q*t))-t)+"px 0%"}))}else{s.append(b('<div class="nivo-slice"></div>').css({left:(t*q)+"px",width:t+"px",height:"0px",opacity:"0",background:'url("'+u.currentImage.attr("src")+'") no-repeat -'+((t+(q*t))-t)+"px 0%"}))}}};var g=function(s,q,v){var r=Math.round(s.width()/q.boxCols);var w=Math.round(s.height()/q.boxRows);for(var t=0;t<q.boxRows;t++){for(var u=0;u<q.boxCols;u++){if(u==q.boxCols-1){s.append(b('<div class="nivo-box"></div>').css({opacity:0,left:(r*u)+"px",top:(w*t)+"px",width:(s.width()-(r*u))+"px",height:w+"px",background:'url("'+v.currentImage.attr("src")+'") no-repeat -'+((r+(u*r))-r)+"px -"+((w+(t*w))-w)+"px"}))}else{s.append(b('<div class="nivo-box"></div>').css({opacity:0,left:(r*u)+"px",top:(w*t)+"px",width:r+"px",height:w+"px",background:'url("'+v.currentImage.attr("src")+'") no-repeat -'+((r+(u*r))-r)+"px -"+((w+(t*w))-w)+"px"}))}}}};var o=function(E,D,H,A){var C=E.data("nivo:vars");if(C&&(C.currentSlide==C.totalSlides-1)){H.lastSlide.call(this)}if((!C||C.stop)&&!A){return false}H.beforeChange.call(this);if(!A){E.css("background",'url("'+C.currentImage.attr("src")+'") no-repeat')}else{if(A=="prev"){E.css("background",'url("'+C.currentImage.attr("src")+'") no-repeat')}if(A=="next"){E.css("background",'url("'+C.currentImage.attr("src")+'") no-repeat')}}C.currentSlide++;if(C.currentSlide==C.totalSlides){C.currentSlide=0;H.slideshowEnd.call(this)}if(C.currentSlide<0){C.currentSlide=(C.totalSlides-1)}if(b(D[C.currentSlide]).is("img")){C.currentImage=b(D[C.currentSlide])}else{C.currentImage=b(D[C.currentSlide]).find("img:first")}if(H.controlNav){b(".navImg").removeClass("aktive");b("#img-"+C.currentSlide).addClass("aktive")}n(H);b(".nivo-slice",E).remove();b(".nivo-box",E).remove();if(H.effect=="random"){var J=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","boxRandom","boxRain","boxRainReverse","boxRainGrow","boxRainGrowReverse");C.randAnim=J[Math.floor(Math.random()*(J.length+1))];if(C.randAnim==undefined){C.randAnim="fade"}}if(H.effect.indexOf(",")!=-1){var J=H.effect.split(",");C.randAnim=J[Math.floor(Math.random()*(J.length))];if(C.randAnim==undefined){C.randAnim="fade"}}C.running=true;if(H.effect=="sliceDown"||H.effect=="sliceDownRight"||C.randAnim=="sliceDownRight"||H.effect=="sliceDownLeft"||C.randAnim=="sliceDownLeft"){f(E,H,C);var I=0;var F=0;var q=b(".nivo-slice",E);if(H.effect=="sliceDownLeft"||C.randAnim=="sliceDownLeft"){q=b(".nivo-slice",E)._reverse()}q.each(function(){var v=b(this);v.css({top:"0px"});if(F==H.slices-1){setTimeout(function(){v.animate({height:"100%",opacity:"1.0"},H.animSpeed,"",function(){E.trigger("nivo:animFinished")})},(100+I))}else{setTimeout(function(){v.animate({height:"100%",opacity:"1.0"},H.animSpeed)},(100+I))}I+=50;F++})}else{if(H.effect=="sliceUp"||H.effect=="sliceUpRight"||C.randAnim=="sliceUpRight"||H.effect=="sliceUpLeft"||C.randAnim=="sliceUpLeft"){f(E,H,C);var I=0;var F=0;var q=b(".nivo-slice",E);if(H.effect=="sliceUpLeft"||C.randAnim=="sliceUpLeft"){q=b(".nivo-slice",E)._reverse()}q.each(function(){var v=b(this);v.css({bottom:"0px"});if(F==H.slices-1){setTimeout(function(){v.animate({height:"100%",opacity:"1.0"},H.animSpeed,"",function(){E.trigger("nivo:animFinished")})},(100+I))}else{setTimeout(function(){v.animate({height:"100%",opacity:"1.0"},H.animSpeed)},(100+I))}I+=50;F++})}else{if(H.effect=="sliceUpDown"||H.effect=="sliceUpDownRight"||C.randAnim=="sliceUpDown"||H.effect=="sliceUpDownLeft"||C.randAnim=="sliceUpDownLeft"){f(E,H,C);var I=0;var F=0;var y=0;var q=b(".nivo-slice",E);if(H.effect=="sliceUpDownLeft"||C.randAnim=="sliceUpDownLeft"){q=b(".nivo-slice",E)._reverse()}q.each(function(){var v=b(this);if(F==0){v.css("top","0px");F++}else{v.css("bottom","0px");F=0}if(y==H.slices-1){setTimeout(function(){v.animate({height:"100%",opacity:"1.0"},H.animSpeed,"",function(){E.trigger("nivo:animFinished")})},(100+I))}else{setTimeout(function(){v.animate({height:"100%",opacity:"1.0"},H.animSpeed)},(100+I))}I+=50;y++})}else{if(H.effect=="fold"||C.randAnim=="fold"){f(E,H,C);var I=0;var F=0;b(".nivo-slice",E).each(function(){var v=b(this);var K=v.width();v.css({top:"0px",height:"100%",width:"0px"});if(F==H.slices-1){setTimeout(function(){v.animate({width:K,opacity:"1.0"},H.animSpeed,"",function(){E.trigger("nivo:animFinished")})},(100+I))}else{setTimeout(function(){v.animate({width:K,opacity:"1.0"},H.animSpeed)},(100+I))}I+=50;F++})}else{if(H.effect=="fade"||C.randAnim=="fade"){f(E,H,C);var w=b(".nivo-slice:first",E);w.css({height:"100%",width:E.width()+"px"});w.animate({opacity:"1.0"},(H.animSpeed*2),"",function(){E.trigger("nivo:animFinished")})}else{if(H.effect=="slideInRight"||C.randAnim=="slideInRight"){f(E,H,C);var w=b(".nivo-slice:first",E);w.css({height:"100%",width:"0px",opacity:"1"});w.animate({width:E.width()+"px"},(H.animSpeed*2),"",function(){E.trigger("nivo:animFinished")})}else{if(H.effect=="slideInLeft"||C.randAnim=="slideInLeft"){f(E,H,C);var w=b(".nivo-slice:first",E);w.css({height:"100%",width:"0px",opacity:"1",left:"",right:"0px"});w.animate({width:E.width()+"px"},(H.animSpeed*2),"",function(){w.css({left:"0px",right:""});E.trigger("nivo:animFinished")})}else{if(H.effect=="boxRandom"||C.randAnim=="boxRandom"){g(E,H,C);var G=H.boxCols*H.boxRows;var F=0;var I=0;var s=l(b(".nivo-box",E));s.each(function(){var v=b(this);if(F==G-1){setTimeout(function(){v.animate({opacity:"1"},H.animSpeed,"",function(){E.trigger("nivo:animFinished")})},(100+I))}else{setTimeout(function(){v.animate({opacity:"1"},H.animSpeed)},(100+I))}I+=20;F++})}else{if(H.effect=="boxRain"||C.randAnim=="boxRain"||H.effect=="boxRainReverse"||C.randAnim=="boxRainReverse"||H.effect=="boxRainGrow"||C.randAnim=="boxRainGrow"||H.effect=="boxRainGrowReverse"||C.randAnim=="boxRainGrowReverse"){g(E,H,C);var G=H.boxCols*H.boxRows;var F=0;var I=0;var u=0;var B=0;var z=new Array();z[u]=new Array();var s=b(".nivo-box",E);if(H.effect=="boxRainReverse"||C.randAnim=="boxRainReverse"||H.effect=="boxRainGrowReverse"||C.randAnim=="boxRainGrowReverse"){s=b(".nivo-box",E)._reverse()}s.each(function(){z[u][B]=b(this);B++;if(B==H.boxCols){u++;B=0;z[u]=new Array()}});for(var x=0;x<(H.boxCols*2);x++){var r=x;for(var t=0;t<H.boxRows;t++){if(r>=0&&r<H.boxCols){(function(P,K,O,L,Q){var N=b(z[P][K]);var v=N.width();var M=N.height();if(H.effect=="boxRainGrow"||C.randAnim=="boxRainGrow"||H.effect=="boxRainGrowReverse"||C.randAnim=="boxRainGrowReverse"){N.width(0).height(0)}if(L==Q-1){setTimeout(function(){N.animate({opacity:"1",width:v,height:M},H.animSpeed/1.3,"",function(){E.trigger("nivo:animFinished")})},(100+O))}else{setTimeout(function(){N.animate({opacity:"1",width:v,height:M},H.animSpeed/1.3)},(100+O))}})(t,r,I,F,G);F++}r--}I+=100}}}}}}}}}}};var l=function(r){for(var s,q,t=r.length;t;s=parseInt(Math.random()*t),q=r[--t],r[t]=r[s],r[s]=q){}return r};var i=function(q){if(this.console&&typeof console.log!="undefined"){console.log(q)}};this.stop=function(){if(!b(j).data("nivo:vars").stop){b(j).data("nivo:vars").stop=true;i("Stop Slider")}};this.start=function(){if(b(j).data("nivo:vars").stop){b(j).data("nivo:vars").stop=false;i("Start Slider")}};h.afterLoad.call(this);return this};b.fn.nivoSlider=function(c){return this.each(function(e,g){var d=b(this);if(d.data("nivoslider")){return d.data("nivoslider")}var f=new a(this,c);d.data("nivoslider",f)})};b.fn.nivoSlider.defaults={effect:"random",slices:15,boxCols:8,boxRows:4,animSpeed:500,pauseTime:3000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,prevText:"Prev",nextText:"Next",beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};b.fn._reverse=[].reverse})(jQuery);
