File Manager

Current Directory: /home/astoriaah/www/old15/media/widgetkit/widgets/slideshow/js
Viewing File: /home/astoriaah/www/old15/media/widgetkit/widgets/slideshow/js/slideshow.js
/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */ (function($){var support=$widgetkit.support,prefix=$widgetkit.prefix;var Plugin=function(){};Plugin.prototype=$.extend(Plugin.prototype,{name:"slideshow",options:{index:0,width:"auto",height:"auto",autoplay:true,interval:5e3,navbar_items:4,caption_animation_duration:500,kenburns_animation_duration:null,slices:20,duration:500,animated:"random",easing:"swing"},nav:null,navbar:null,captions:null,caption:null,kbi:0,initialize:function(element,options){var $this=this,height=0,width=0;this.options=$.extend({},this.options,options);this.element=this.wrapper=element;this.ul=this.wrapper.find("ul.slides:first").css({width:"100%",overflow:"hidden"});this.wrapper.css({position:"relative"});this.slides=this.ul.css({position:"relative"}).children().css({top:"0px",left:"0px",position:"absolute"}).hide();this.index=this.slides[this.options.index]?this.options.index:0;$(".next",this.wrapper).bind("click",function(e){$this.stop();$this.nextSlide()});$(".prev",this.wrapper).bind("click",function(e){$this.stop();$this.prevSlide()});if(this.wrapper.find(".nav:first").length){this.nav=this.wrapper.find(".nav:first");var tabs=this.nav.children();tabs.each(function(i){$(this).bind("click",function(){$this.stop();if($this.slides[i])$this.show(i)})});element.bind("slideshow-show",function(e,current,next){$(tabs.removeClass("active").get(next)).addClass("active")})}if(this.wrapper.find(".captions:first").length&&this.wrapper.find(".caption:first").length){this.captions=this.wrapper.find(".captions:first").hide().children();this.caption=this.wrapper.find(".caption:first").hide()}if(this.nav){$(this.nav.children().get(this.index)).addClass("active")}if(this.navbar){$(this.navbar.children().get(this.index)).addClass("active")}this.showCaption(this.index);this.timer=null;this.hover=false;this.wrapper.hover(function(){$this.hover=true},function(){$this.hover=false});if("ontouchend"in document){element.bind("touchstart",function(event){var data=event.originalEvent.touches?event.originalEvent.touches[0]:event,start={time:(new Date).getTime(),coords:[data.pageX,data.pageY],origin:$(event.target)},stop;function moveHandler(event){if(!start){return}var data=event.originalEvent.touches?event.originalEvent.touches[0]:event;stop={time:(new Date).getTime(),coords:[data.pageX,data.pageY]};if(Math.abs(start.coords[0]-stop.coords[0])>10){event.preventDefault()}}element.bind("touchmove",moveHandler).one("touchend",function(event){element.unbind("touchmove",moveHandler);if(start&&stop){if(stop.time-start.time<1e3&&Math.abs(start.coords[0]-stop.coords[0])>30&&Math.abs(start.coords[1]-stop.coords[1])<75){start.origin.trigger("swipe").trigger(start.coords[0]>stop.coords[0]?"swipeleft":"swiperight")}}start=stop=undefined})});this.wrapper.bind("swipeleft",function(){$this.stop();$this.nextSlide()}).bind("swiperight",function(){$this.stop();$this.prevSlide()})}$(window).bind("debouncedresize",function(){$this.resize()});$this.resize();$this.slides.eq($this.index).css("z-index",2).show();if($this.options.animated=="kenburns"&&support.canvas){$this.show(this.index,true)}if($this.options.autoplay)$this.start()},resize:function(){if(this["fx"]){if(this.slicer)this.slicer.remove();this.slides.filter(":animated").stop(true,true);this.next.css({top:0,left:0,"z-index":2}).show();if(this.options.animated=="kenburns"&&support.canvas){this.element.find("img:animated").stop().css({width:"",height:"",top:"",left:""}).fadeIn("fast");this.element.find("canvas.tmp").remove()}this.current.css({top:0,left:0,"z-index":1}).hide()}this["fx"]=false;var o_width=this.options.width,o_height=this.options.height;this.slides.css("width","");this.slides.css("height","");this.ul.css("height","");this.wrapper.css("width","");if(o_width!="auto"&&this.wrapper.width()<o_width){o_width="auto";o_height="auto"}this.wrapper.css({width:o_width=="auto"?this.wrapper.width():o_width});var width=this.ul.width(),height=o_height;if(height=="auto"){height=0;this.slides.css("width",width).show().each(function(){height=Math.max(height,$(this).height())}).hide().eq(this.index).show()}this.slides.css({height:height,width:this.ul.width()});this.ul.css("height",height);if(this.options.animated=="kenburns"&&support.canvas){this.show(this.index,true)}},nextSlide:function(){this.show(this.slides[this.index+1]?this.index+1:0)},prevSlide:function(){this.show(this.index-1>-1?this.index-1:this.slides.length-1)},show:function(index,init){if(this.index==index&&!init||this["fx"]&&this.options.animated!="kenburns")return;this.current=$(this.slides.get(this.index)),this.next=$(this.slides.get(index)),this.animated=this.options.animated,this.duration=this.options.duration,this.easing=this.options.easing;this.dir=index>this.index?"right":"left";this.init=init;this.showCaption(index);this.element.trigger("slideshow-show",[this.index,index]);this.index=index;if(this[this.animated]){this.fx=true;this[this.animated]()}else{this.current.hide();this.next.show()}},showCaption:function(index){if(!this.caption||!this.captions[index]){return}var content=$(this.captions.get(index)).html();if(this.caption.is(":animated")){this.caption.stop()}if(!$.trim(content).length){if(this.caption.is(":visible")){this.caption.fadeOut(this.options.caption_animation_duration)}return}else{if($.fn.lightbox&&content.match(/data\-lightbox/)){content=$("<div>"+content+"</div>");content.find("a[data-lightbox]").lightbox()}}if(this.caption.is(":visible")){var $this=this;this.caption.fadeOut(this.options.caption_animation_duration,function(){$(this).html(content).delay(200).css("opacity","").fadeIn($this.options.caption_animation_duration)})}else{this.caption.html(content).fadeIn(this.options.caption_animation_duration)}},start:function(){if(this.timer)return;var $this=this;this.timer=setInterval(function(){if($this.options.animated=="kenburns"||!$this.hover&&!$this["fx"]){$this.nextSlide()}},this.options.interval)},stop:function(){if(this.timer){clearInterval(this.timer);if(this["tmptimer"])clearTimeout(this.tmptimer);var $this=this;this.tmptimer=setTimeout(function(){$this.start();this.tmptimer=false},3e4);this.timer=false}},bindTransitionEnd:function(ele){var $this=this;$(ele).bind("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd",function(){$this.fx=null;$this.next.css({"z-index":"2",left:0,top:0}).show();$this.current.hide();if($this.slicer){$this.slicer.remove()}})},randomSimple:function(){var animations=["top","bottom","fade","slide","scroll","swipe"];this.animated=animations[Math.floor(Math.random()*animations.length)];this[this.animated]()},randomFx:function(){var animations=["sliceUp","sliceDown","sliceUpDown","fold","puzzle","boxes","boxesReverse"];this.animated=animations[Math.floor(Math.random()*animations.length)];this[this.animated]()},top:function(){var $this=this;this.current.css({"z-index":1});this.next.css({"z-index":2,display:"block",left:0,top:this.wrapper.height()*(this.animated=="bottom"?2:-1)}).animate({top:0},{duration:$this.duration,easing:$this.easing,complete:function(){$this.fx=null;$this.current.hide()}})},bottom:function(){this.top.apply(this)},left:function(){var $this=this;this.current.css({"z-index":1});this.next.css({"z-index":2,display:"block",left:this.current.width()*(this.animated=="right"?2:-1)}).animate({left:0},{duration:$this.duration,easing:this.easing,complete:function(){$this.fx=null;$this.current.hide()}})},right:function(){this.left()},slide:function(){var $this=this;this.current.css({"z-index":1});this.next.css({"z-index":2,display:"block",left:this.current.width()*(this.dir=="right"?2:-1)}).animate({left:0},{duration:$this.duration,easing:this.easing,complete:function(){$this.fx=null;$this.current.hide()}})},fade:function(){var $this=this;this.next.css({top:0,left:0,"z-index":1}).fadeIn($this.duration);this.current.css({"z-index":2}).fadeOut(this.duration,function(){$this.fx=null;$this.current.hide().css({opacity:1})})},scrollLeft:function(){var $this=this;this.current.css({"z-index":1});this.next.css({"z-index":2,display:"block",left:this.current.width()*(this.animated=="scrollRight"?1:-1)}).animate({left:0},{duration:$this.duration,easing:this.easing,complete:function(){$this.fx=null;$this.current.hide()},step:function(now,fx){$this.current.css("left",(Math.abs(fx.start)-Math.abs(now))*($this.animated=="scrollRight"?-1:1))}})},scrollRight:function(){this.scrollLeft(this)},scroll:function(){var $this=this;this.current.css({"z-index":1});this.next.css({"z-index":2,display:"block",left:this.current.width()*(this.dir=="right"?1:-1)}).animate({left:0},{duration:$this.duration,easing:this.easing,complete:function(){$this.fx=null;$this.current.hide()},step:function(now,fx){$this.current.css("left",(Math.abs(fx.start)-Math.abs(now))*($this.dir=="right"?-1:1))}})},swipe:function(){var $this=this;this.current.css({"z-index":2});this.next.css({"z-index":1,top:0,left:this.next.width()/3*($this.dir=="right"?1:-1)}).show();var div_current=$("<div></div>").css({position:"absolute",top:0,left:0,width:this.current.outerWidth(),height:this.current.outerHeight(),opacity:0,"background-color":"#000"}).appendTo(this.current);var div_next=$("<div></div>").css({position:"absolute",top:0,left:0,width:this.current.outerWidth(),height:this.current.outerHeight(),opacity:.6,"background-color":"#000"}).appendTo(this.next);div_current.animate({opacity:.6},{duration:$this.duration});div_next.animate({opacity:0},{duration:$this.duration});this.current.animate({left:($this.dir=="right"?-1:1)*this.current.width()},{duration:$this.duration,easing:"easeOutCubic",complete:function(){$this.fx=null;$this.current.hide();div_current.remove();div_next.remove()}});this.next.animate({left:0},{duration:$this.duration,easing:"easeOutCubic"})},slice:function(){var $this=this,img=this.next.find("img:first"),pos=this.animated=="sliceUp"?"bottom":"top";if(!img.length){this.next.css({"z-index":"2",left:0,top:0}).show();this.current.hide();this.fx=null;return}var position=this.current.find("img:first").position(),next_width=$this.next.width(),next_height=$this.next.height();createSlicer(this,position.top,position.left);var sliceWidth=Math.round(this.slicer.width()/this.options.slices);for(var i=0;i<this.options.slices;i++){var width=i==this.options.slices-1?this.slicer.width()-sliceWidth*i:sliceWidth;if(this.animated=="sliceUpDown"){pos=(i%2+2)%2==0?"top":"bottom"}var bar=$("<div />").css(pos,0).css(css3({position:"absolute",left:sliceWidth*i+"px",width:width+"px",height:0,background:"url("+img.attr("src")+") no-repeat -"+(sliceWidth+i*sliceWidth-sliceWidth)+"px "+pos,"background-size":next_width+"px "+next_height+"px",opacity:0,transition:"all "+$this.duration+"ms ease-in "+i*60+"ms"}));this.slicer.append(bar)}this.slices=this.slicer.children();this.bindTransitionEnd.apply(this,[this.slices.get(this.slices.length-1)]);this.current.css({"z-index":1});this.slicer.show();var wheight=this.wrapper.height();if(support.transition){this.slices.css(css3({height:wheight,opacity:1}))}else{var timeBuff=0;this.slices.each(function(i){var ele=$(this);setTimeout(function(){ele.animate({height:wheight,opacity:1},$this.duration,function(){if(i==$this.slices.length-1){$(this).trigger("transitionend")}})},timeBuff);timeBuff+=60})}},sliceUp:function(){this.slice.apply(this)},sliceDown:function(){this.slice.apply(this)},sliceUpDown:function(){this.slice.apply(this)},fold:function(){var $this=this,img=this.next.find("img:first");if(!img.length){this.next.css({"z-index":"2",left:0,top:0}).show();this.current.hide();this.fx=null;return}var pos=this.current.find("img:first").position(),next_width=$this.next.width(),next_height=$this.next.height();createSlicer(this,pos.top,pos.left);var sliceWidth=Math.round(this.slicer.width()/this.options.slices)+2,sliceHeight=this.current.height();for(var i=0;i<this.options.slices+1;i++){var width=i==$this.options.slices?$this.slicer.width()-sliceWidth*i:sliceWidth,bar=$("<div />").css(css3({position:"absolute",left:sliceWidth*i+"px",width:width,top:"0px",height:sliceHeight,background:"url("+img.attr("src")+") no-repeat -"+(sliceWidth+i*sliceWidth-sliceWidth)+"px 0%","background-size":next_width+"px "+next_height+"px",opacity:0,transform:"scalex(0.0001)",transition:"all "+$this.duration+"ms ease-in "+(100+i*60)+"ms"}));this.slicer.append(bar)}this.slices=this.slicer.children();this.bindTransitionEnd.apply(this,[this.slices.get(this.slices.length-1)]);this.current.css({"z-index":1});this.slicer.show();if(support.transition){this.slices.css(css3({opacity:1,transform:"scalex(1)"}))}else{var timeBuff=0;this.slices.width(0).each(function(i){var width=i==$this.options.slices-1?$this.slicer.width()-sliceWidth*i:sliceWidth;var ele=$(this);setTimeout(function(){ele.animate({opacity:1,width:width},$this.duration,function(){if(i==$this.slices.length-1){$(this).trigger("transitionend")}})},timeBuff+100);timeBuff+=50})}},puzzle:function(){var $this=this,boxCols=Math.round(this.options.slices/2),boxWidth=Math.round(this.wrapper.width()/boxCols),boxRows=Math.round(this.wrapper.height()/boxWidth),boxHeight=Math.round(this.wrapper.height()/boxRows)+1,timeBuff=0,img=this.next.find("img:first");if(!img.length){this.next.css({"z-index":"2",left:0,top:0}).show();this.current.hide();this.fx=null;return}var pos=this.current.find("img:first").position(),next_width=$this.next.width(),next_height=$this.next.height();createSlicer(this,pos.top,pos.left);var wrapperWidth=this.wrapper.width();for(var rows=0;rows<boxRows;rows++){for(var cols=0;cols<boxCols;cols++){var bar=$("<div />").css(css3({position:"absolute",left:boxWidth*cols+"px",width:cols==boxCols-1?wrapperWidth-boxWidth*cols+"px":boxWidth+"px",top:boxHeight*rows+"px",height:boxHeight+"px",background:"url("+img.attr("src")+") no-repeat -"+(boxWidth+cols*boxWidth-boxWidth)+"px -"+(boxHeight+rows*boxHeight-boxHeight)+"px","background-size":next_width+"px "+next_height+"px",opacity:0,"-webkit-transform":"translateZ(0)","-moz-transform":"rotate(0)",transition:"all "+$this.duration+"ms ease-in 0ms"}));this.slicer.append(bar)}}this.slices=shuffle(this.slicer.children());this.bindTransitionEnd.apply(this,[this.slices.get(this.slices.length-1)]);this.current.css({"z-index":1});this.slicer.show();this.slices.each(function(i){var ele=$(this);setTimeout(function(){if(support.transition){ele.css(css3({opacity:1}))}else{ele.animate({opacity:1},$this.duration,function(){if(i==$this.slices.length-1){$(this).trigger("transitionend")}})}},100+i*50)})},boxes:function(){var $this=this,boxCols=Math.round(this.options.slices/2),boxWidth=Math.round(this.wrapper.width()/boxCols),boxRows=Math.round(this.wrapper.height()/boxWidth),boxHeight=Math.round(this.wrapper.height()/boxRows)+1,timeBuff=0,img=this.next.find("img:first");if(!img.length){this.next.css({"z-index":"2",left:0,top:0}).show();this.current.hide();this.fx=null;return}var pos=this.current.find("img:first").position(),next_width=$this.next.width(),next_height=$this.next.height();createSlicer(this,pos.top,pos.left);for(var rows=0;rows<boxRows;rows++){for(var cols=0;cols<boxCols;cols++){this.slicer.append($("<div />").css(css3({position:"absolute",left:boxWidth*cols+"px",width:0,top:boxHeight*rows+"px",height:0,background:"url("+img.attr("src")+") no-repeat -"+(boxWidth+cols*boxWidth-boxWidth)+"px -"+(boxHeight+rows*boxHeight-boxHeight)+"px","background-size":next_width+"px "+next_height+"px",opacity:0,transition:"all "+(100+$this.duration)+"ms ease-in 0ms"})).data("base",{width:cols==boxCols-1?this.wrapper.width()-boxWidth*cols:boxWidth,height:boxHeight}))}}this.slices=this.slicer.children();this.current.css({"z-index":1});this.slicer.show();var rowIndex=0;var colIndex=0;var box2Darr=[];box2Darr[rowIndex]=[];var boxes=this.animated=="boxesReverse"?this.slices._reverse():this.slices;this.bindTransitionEnd.apply(this,[boxes.get(boxes.length-1)]);boxes.each(function(){box2Darr[rowIndex][colIndex]=$(this);colIndex++;if(colIndex==boxCols){rowIndex++;colIndex=0;box2Darr[rowIndex]=[]}});var i=0;for(var cols=0;cols<boxCols*boxRows;cols++){var prevCol=cols;for(var rows=0;rows<boxRows;rows++){if(prevCol>=0&&prevCol<boxCols){(function(row,col,time,i,totalBoxes){var box=box2Darr[row][col];setTimeout(function(){if(support.transition){box.css({opacity:"1",width:box.data("base").width,height:box.data("base").height})}else{box.animate({opacity:"1",width:box.data("base").width,height:box.data("base").height},$this.duration,function(){if(i==$this.slices.length-1){$(this).trigger("transitionend")}})}},100+time)})(rows,prevCol,timeBuff,i,boxes.length);i++}prevCol--}timeBuff+=100}},boxesReverse:function(){this.boxes.apply(this)},kenburns:function(){var $this=this,timeBuff=0,img=this.next.find("img:first"),animDuration=$this.options.kenburns_animation_duration||$this.options.interval*2;if(!img.length){this.next.css({"z-index":"2",left:0,top:0}).show();this.current.hide();this.fx=null;return}if(!support.canvas){this.fade(this);return}img.stop(false,true).css({width:"",height:"","max-width":"none"});this.slides.not(this.current).not(this.next).hide();this.current.css({"z-index":1});this.next.css({"z-index":2,visibility:"hidden",opacity:1}).show();this.next.find("canvas.tmp").remove();var pos=img.position(),o_width=img.attr("width"),o_height=img.attr("height"),modes=[{start:["c-l",1],stop:["c-r",1.2]},{start:["t-r",1],stop:["b-l",1.2]},{start:["b-l",1],stop:["t-r",1.2]},{start:["t-c",1],stop:["b-c",1.2]},{start:["c-c",1],stop:["c-c",1.2]},{start:["b-r",1],stop:["t-l",1.2]},{start:["c-l",1],stop:["c-r",1.2]}],mode=modes[this["kbi"]?this["kbi"]:0],canvas=$('<canvas class="tmp"></canvas>'),calcCss=function(position,scale){var scale=scale||1,css={top:0,left:0,width:o_width*scale,height:o_height*scale};switch(position){case"t-l":css["top"]=css["left"]=0;break;case"t-c":css["top"]=0;css["left"]=-1*((css["width"]-o_width)/2);break;case"t-r":css["top"]=0;css["left"]=-1*(css["width"]-o_width);break;case"c-l":css["top"]=-1*((css["height"]-o_height)/2);css["left"]=0;break;case"c-c":css["top"]=-1*((css["height"]-o_height)/2);css["left"]=-1*((css["width"]-o_width)/2);break;case"c-r":css["top"]=-1*((css["height"]-o_height)/2);css["left"]=-1*(css["width"]-o_width);break;case"b-l":css["top"]=-1*(css["height"]-o_height);css["left"]=0;break;case"b-c":css["top"]=-1*(css["height"]-o_height);css["left"]=-1*((css["width"]-o_width)/2);break;case"b-r":css["top"]=-1*(css["height"]-o_height);css["left"]=-1*(css["width"]-o_width);break}return css};if(o_width>this.ul.width()){var ratio=o_width/this.ul.width();o_width=this.ul.width();o_height=o_height/ratio;this.ul.height(o_height).css("overflow","hidden").css("z-index","4")}canvas.attr({width:o_width,height:o_height}).css({width:o_width,height:o_height,opacity:0});img.css({width:"",height:"",top:"",left:""}).after(canvas).hide();var ctx=canvas.get(0).getContext("2d");this.next.css({visibility:"visible"});canvas.animate({opacity:1},$this.duration);var x=false,y=false,w=false,h=false;img.css(calcCss.apply(this,mode.start)).animate(calcCss.apply(this,mode.stop),{step:function(val,obj){if(x!==false&&y!==false&&w!==false&&h!==false){ctx.drawImage(img.get(0),x,y,w,h);x=false;y=false;w=false;h=false}if(obj.prop=="width")w=val;if(obj.prop=="height")h=val;if(obj.prop=="left")x=val;if(obj.prop=="top")y=val},complete:function(){$(this).css({width:"",height:"",top:"",left:""});$this.fx=null},easing:"swing",duration:animDuration});$this["kbi"]=modes[$this["kbi"]+1]?$this["kbi"]+1:0},scale:function(){var $this=this;if(!support.transition){this.fade(this);return}this.fx=null;this.ul.css({"-webkit-transform":"translateZ(0)"});this.slides.css(css3({transition:"none",transform:"none",opacity:1}));this.slides.not(this.current).hide();this.current.one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd",function(){$this.next.css({"z-index":"2",left:0,top:0,opacity:1}).show();$(this).hide().css(css3({transition:"none",transform:"none",opacity:1}))}).css(css3({"z-index":2,opacity:1,transform:"scale(1)",transition:"all "+$this.duration+"ms ease-in-out 0ms"}));this.next.css(css3({"z-index":1,opacity:1,transform:"none"})).show();$this.current.css({"z-index":2}).css(css3({opacity:0,transform:"scale(1.5)"}))},rotate:function(){if(!support.transition){this.fade(this);return}this.fx=null;var $this=this,current=this.current,transitions=[["rotate(90deg) translate(200%, -10%) scale(0.2)","rotate(-90deg) translate(-200%, -10%) scale(0.2)"],["rotate(-90deg) translate(-200%, -10%) scale(0.2)","rotate(90deg) translate(200%, -10%) scale(0.2)"],["rotate(-90deg) translate(200%, -90%) scale(0.2)","rotate(90deg) translate(-200%, -90%) scale(0.2)"],["rotate(90deg) translate(-200%, -90%) scale(0.2)","rotate(-90deg) translate(200%, -90%) scale(0.2)"],["rotate(90deg) translate(200%, -10%) scale(0.2)","rotate(90deg) translate(-200%, -90%) scale(0.2)"],["rotate(-90deg) translate(-200%, -10%) scale(0.2)","rotate(-90deg) translate(200%, -90%) scale(0.2)"],["rotate(90deg) translate(-200%, -90%) scale(0.2)","rotate(90deg) translate(200%, -10%) scale(0.2)"],["rotate(-90deg) translate(200%, -90%) scale(0.2)","rotate(-90deg) translate(-200%, -10%) scale(0.2)"],["rotate(10deg) translate(200%, 20%) scale(0.2)","rotate(10deg) translate(-200%, -20%) scale(0.2)"],["rotate(10deg) translate(-200%, -20%) scale(0.2)","rotate(10deg) translate(200%, 20%) scale(0.2)"],["rotate(-10deg) translate(200%, -20%) scale(0.2)","rotate(-10deg) translate(-200%, 20%) scale(0.2)"],["rotate(-10deg) translate(-200%, 20%) scale(0.2)","rotate(-10deg) translate(200%, -20%) scale(0.2)"],["translate(50%, 200%) scale(0.2)","translate(-50%, -200%) scale(0.2)"],["translate(-50%, -200%) scale(0.2)","translate(50%, 200%) scale(0.2)"],["translate(50%, -200%) scale(0.2)","translate(-50%, 200%) scale(0.2)"],["translate(-50%, 200%) scale(0.2)","translate(50%, -200%) scale(0.2)"]],eindex=parseInt(Math.random()*transitions.length);this.slides.not(this.current).hide();this.current.css({"z-index":1}).css(css3({opacity:1,transform:"rotate(0deg) translate(0, 0) scale(1)",transition:"all "+this.duration+"ms ease-in-out 0ms"}));this.next.css(css3({"z-index":"2",left:0,top:0,opacity:0,transform:transitions[eindex][0],transition:"all "+this.duration+"ms ease-in-out 0ms"})).show();this.next.one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd",function(){$this.slides.filter(":visible").css(css3({transition:"",transform:""}));current.css(css3({transition:"",transform:""})).hide()});setTimeout(function(){$this.next.css(css3({opacity:1,transform:"rotate(0deg) translate(0, 0) scale(1)"}));$this.current.css(css3({opacity:0,transform:transitions[eindex][1]}))},10)}});$.fn._reverse=[].reverse;var Transforms={translate:function(x,y,z){x=x!=undefined?x:0;y=y!=undefined?y:0;z=z!=undefined?z:0;return"translate"+(support.css3d?"3d(":"(")+x+"px,"+y+(support.css3d?"px,"+z+"px)":"px)")},rotateX:function(deg){return Transforms.rotate("x",deg)},rotateY:function(deg){return Transforms.rotate("y",deg)},rotateZ:function(deg){return Transforms.rotate("z",deg)},rotate:function(axis,deg){if(!axis in{x:"",y:"",z:""})axis="z";deg=deg!=undefined?deg:0;if(support.css3d){return"rotate3d("+(axis=="x"?"1":"0")+", "+(axis=="y"?"1":"0")+", "+(axis=="z"?"1":"0")+", "+deg+"deg)"}else{return axis=="z"?"rotate("+deg+"deg)":""}}};function css3(cssprops){return $widgetkit.css3(cssprops)}var shuffle=function(arr){for(var j,x,i=arr.length;i;j=parseInt(Math.random()*i),x=arr[--i],arr[i]=arr[j],arr[j]=x){}return arr};var createSlicer=function(context,top,left){var top=top||0,left=left||0;context.slicer=$("<li />").addClass("slices").css({top:top,left:left,position:"absolute",width:context.wrapper.width(),height:context.ul.height(),"z-index":3}).hide().appendTo(context.ul)};$.fn[Plugin.prototype.name]=function(){var args=arguments;var method=args[0]?args[0]:null;return this.each(function(){var element=$(this);if(Plugin.prototype[method]&&element.data(Plugin.prototype.name)&&method!="initialize"){element.data(Plugin.prototype.name)[method].apply(element.data(Plugin.prototype.name),Array.prototype.slice.call(args,1))}else if(!method||$.isPlainObject(method)){var plugin=new Plugin;if(Plugin.prototype["initialize"]){plugin.initialize.apply(plugin,$.merge([element],args))}element.data(Plugin.prototype.name,plugin)}else{$.error("Method "+method+" does not exist on jQuery."+Plugin.name)}})}})(jQuery);