(function(n){n.fn.mzSlide=function(t){var o;if(this.data("handle"))return this.data("handle");var e=n.extend(!0,{toggleTime:400,onToggleOver:null},t),u=[],f=[],r=-1,i=n(this);return i.css({position:"relative",zIndex:999,overflow:"hidden"}).data("handle",i),i.add=function(t,e){i.exists(t)&&i.remove(t,e);var o=n('<div style="display:none;position:absolute;overflow:hidden;z-index:-1" class="mzslide_'+t+'" />').data("slidename",t).appendTo(i);return f[t]=u.push(o)-1,(r==-1||r==f[t])&&(r=f[t],o.css({position:"static"}).show(),i.height("auto")),o},i.exists=function(n){return f[n]||f[n]>-1},i.indexOf=function(n){return f[n]||-1},i.page=function(n){if(i.exists(n))return u[f[n]]},i.activeName=function(){return r>-1?u[r].data("slidename"):""},i.remove=function(n,t){var i=f[n],h,e,o,s;if(i>-1&&u[i]){i==r,h=1,e=[],u[i].remove();for(o in f)if(o!=n)if(s=f[o],i<s)if(t){u[s].remove(),h++;continue}else e[o]=s-1;else e[o]=s;f=e,u.splice(i,h),r>i&&r--,delete e}},o=function(t,r,u){var o=n(t),s=n(r),f=i.width(),h,c;u=u?u:"left",i.height(o.innerHeight()>s.innerHeight()?o.innerHeight():s.innerHeight()),u=="left"?(h={left:-f},c={position:"absolute",left:f,width:f}):u=="right"&&(h={left:f},c={position:"absolute",left:-f,width:f}),s.length>0&&s.css({position:"absolute",left:0,width:f}).animate(h,e.toggleTime,null,function(){s.hide()}),o.length>0&&o.css(c).show().animate({left:0},e.toggleTime,null,function(){if(o.css({position:"static",width:"auto"}),i.height("auto"),e.onToggleOver)e.onToggleOver(o.data("slidename"),s.data("slidename"))})},i.canBack=function(){return r-1>-1},i.back=function(){if(i.canBack()){var n,t;return n=u[r],t=u[--r],o(t,n,"right"),!0}return!1},i.canNext=function(){return r>-1&&r+1<u.length},i.next=function(){if(i.canNext()){var n,t;return n=u[r],t=u[++r],o(t,n,"left"),!0}return!1},i.go=function(n){var t,i;f[n]>-1&&(f[n]!=r?(r>-1&&(t=u[r]),r=f[n],i=u[r],o(i,t)):u[r].show())},i}})(jQuery)