AP.widget.eSlide=function(m){var g={duration:1000,pause:1000,num:1,dir:[-1,0],auto:false,floatFix:true};var p={scroll_to:[]},q={scroll_to:[]},d=m.nodeName?m:D.get(m),e=f(d),r=arguments[1]||g,t=l("dir")[0]==0?"top":"left";function k(){var u={position:"relative"};D.setStyles(d.parentNode,u);var w=0;for(var v=0;v<e.length;v++){e[v].startPos=w;w+=e[v][l("dir")[0]==0?"clientHeight":"clientWidth"]}if(l("floatFix")){u.width=w+"px"}u[t]=0;D.setStyles(d,u)}k();var j,i=0;function h(y){var v=o("scroll_to",{from:i,to:y,total:e.length});var z=v.from;y=v.to;if(!e[y]){return}var u=-e[y].startPos;var w=parseInt(e[z]?-e[z].startPos:d.style[t]);i=y;j&&j.stop();var x={};x[t]={from:w,to:u};j=new U.Anim(d,x,l("duration")/1000);j.onComplete.subscribe(function(){c("scroll_to",{cur:i})});j.animate()}function a(){var v;do{var u=l("dir");v=i+(u[0]+u[1])*l("num")*(arguments[0]?arguments[0]:-1);if(arguments[0]){break}}while(!n(v));h(v)}function n(u){var v=true;if(u<0||u>=e.length){r.dir=[l("dir")[0]*-1,l("dir")[1]*-1];v=false}return v}var s=0;function b(){s=window.setInterval(function(){if(l("auto")){a()}else{window.clearInterval(s)}},l("duration")+l("pause"))}if(l("auto")){b()}function l(u){return r[u]===undefined?g[u]:r[u]}function f(x){var w=[];var y=x.childNodes;for(var v=0,u=y.length;v<u;v++){if(y[v].tagName!=undefined&&y[v].nodeName!="#comment"){w.push(y[v])}}return w}function o(x,w){if(p[x].length>0){for(var v=0,u=p[x].length;v<u;v++){w=p[x][v].call(w)||w}}return w}function c(x,w){if(q[x].length>0){for(var v=0,u=q[x].length;v<u;v++){w=q[x][v].call(w)||w}}return w}return{next:function(){window.clearInterval(s);h(i+l("num"));if(l("auto")){b()}return{current:i,first:i==0,end:i==(e.length-1)}},prev:function(){window.clearInterval(s);h(i-l("num"));if(l("auto")){b()}return{current:i,first:i==0,end:i==(e.length-1)}},go:function(u){h(u)},play:function(){window.clearInterval(s);if(l("auto")){b()}},stop:function(){window.clearInterval(s)},addFilter:function(v,u){p[v].push(u)},addAction:function(v,u){q[v].push(u)}}};
