(function(){var C=YAHOO.util.Dom;var A=YAHOO.util.Event;var B=YAHOO.util.Element;SODON.widget.TickerStream=function(E,D){SODON.widget.TickerStream.superclass.constructor.call(this,E,D)};YAHOO.extend(SODON.widget.TickerStream,B,{myTween:null,paused:false,startedLoop:false,initAttributes:function(D){var E=this;SODON.widget.TickerStream.superclass.initAttributes.call(this,D);this.setAttributeConfig("direction",{value:D.direction||"horizontal"});this.setAttributeConfig("mask",{value:D.mask||"ticker-stream-mask"});this.setAttributeConfig("speed",{value:D.speed||50});this.setAttributeConfig("swidth",{value:(C.getRegion(this.get("element"))["right"]-C.getRegion(this.get("element"))["left"])});this.setAttributeConfig("sheight",{value:(C.getRegion(this.get("element"))["bottom"]-C.getRegion(this.get("element"))["top"])});A.on(this.get("element"),"mouseover",function(F){E.paused=true;E.myTween.stop(false)});A.on(this.get("element"),"mouseout",function(F){if(E.get("direction")=="horizontal"){E.myTween.attributes.left.from=E.myTween.getAttribute("left");E.myTween.duration=Math.abs(E.myTween.attributes.left.to-E.myTween.attributes.left.from)/E.get("speed")}else{E.myTween.attributes.top.from=E.myTween.getAttribute("top");E.myTween.duration=Math.abs(E.myTween.attributes.top.to-E.myTween.attributes.top.from)/E.get("speed")}E.myTween.animate();E.paused=false});this.play()},play:function(){var E=this;var D={};var F=0;if(this.get("direction")=="horizontal"){D={left:{from:0,to:(-1)*this.get("swidth")}};F=this.get("swidth")/this.get("speed")}else{D={top:{from:0,to:(-1)*this.get("sheight")}};F=this.get("sheight")/this.get("speed")}this.myTween=new YAHOO.util.Anim(this.get("element"),D,F,YAHOO.util.Easing.easeNone);this.myTween.onComplete.subscribe(function(G){if(!E.paused){E.startedLoop=true;if(E.get("direction")=="horizontal"){E.myTween.attributes.left.from=parseInt(C.getStyle(C.get(E.get("mask")),"width"),10);E.myTween.duration=(E.get("swidth")+parseInt(C.getStyle(C.get(E.get("mask")),"width"),10))/E.get("speed")}else{E.myTween.attributes.top.from=parseInt(C.getStyle(C.get(E.get("mask")),"height"),10);E.myTween.duration=(E.get("sheight")+parseInt(C.getStyle(C.get(E.get("mask")),"height"),10))/E.get("speed")}E.myTween.animate()}});this.myTween.animate();this.paused=false}})})();