var version="v3.1.0 Distributable Release - 27/08/10";var Glider=new Class({initialize:function(b,a){this.wrapper=$(b);this.scroller=this.wrapper.getElement("div.scroller");this.sections=this.wrapper.getElements("div.section");this.options=$extend({duration:1,frequency:3},a||{});this.sections.each(function(d,c){d._index=c});this.myFx=new Fx.Scroll(this.scroller);this.events={};if(this.options.initialSection){if(this.options.initialSection=="random"){this.moveTo(this.sections.getRandom(),this.scroller)}else{this.moveTo(this.options.initialSection,this.scroller)}}if(this.options.autoGlide){this.start()}},moveTo:function(c,b){var a=c.getPosition(b);this.myFx.cancel();this.myFx=new Fx.Scroll(b).toElement(c);this.current=$(c);return false},moveNext:function(c){if(c!=null){this.periodicallyUpdate(true)}if(this.current){var b=this.current._index;var a=(this.sections.length-1==b)?0:b+1}else{var a=1}this.moveTo(this.sections[a],this.scroller)},movePrevious:function(c){if(c!=null){this.periodicallyUpdate(true)}if(this.current){var a=this.current._index;var b=(a==0)?this.sections.length-1:a-1}else{var b=this.sections.length-1}this.moveTo(this.sections[b],this.scroller)},next:function(){this.moveNext(true)},previous:function(){this.movePrevious(true)},stop:function(){clearTimeout(this.timer)},start:function(){this.periodicallyUpdate()},periodicallyUpdate:function(a){if(this.timer!=null){clearTimeout(this.timer);if(a!=true){this.moveNext()}}this.timer=setTimeout(this.periodicallyUpdate.bind(this),this.options.frequency*1000)}});
