Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadTicker=function(_1){
Telerik.Web.UI.RadTicker.initializeBase(this,[_1]);
this._autoStart=false;
this._autoAdvance=true;
this._loop=false;
this._tickSpeed=20;
this._lineDuration=2000;
this._currentLine=0;
this._length=0;
this._itemsContainer=null;
this._controlElement=null;
this._numberOfItems=0;
this._postBackReference=null;
};
Telerik.Web.UI.RadTicker.prototype={initialize:function(){
Telerik.Web.UI.RadTicker.callBaseMethod(this,"initialize");
this._itemsContainer=this._getChildElement("itemsContainer");
this._controlElement=document.createElement("span");
this.get_element().appendChild(this._controlElement);
this.set_numberOfItems($telerik.getChildrenByTagName(this._itemsContainer,"span").length);
if(this.get_autoStart()){
this.startTicker();
}
},dispose:function(){
this.clearTimeouts();
this._itemsContainer=null;
this._controlElement=null;
Telerik.Web.UI.RadTicker.callBaseMethod(this,"dispose");
},startTicker:function(){
this.tickLine(0);
},stopTicker:function(){
this.clearTimeouts();
},tickNextLine:function(){
this.tickLine(this._currentLine);
},tickLine:function(_2,_3){
if(_3&&this._lineTimeOut==null){
return;
}
this._length=0;
this._controlElement.innerHTML="";
this._currentLine=_2;
this.tickOne(_2);
},resetTicker:function(){
this._length=0;
this._isReset=true;
this.clearTimeouts();
this._lineTimeOut=null;
this._tickTimeOut=null;
this._controlElement.innerHTML="";
},_trimString:function(_4){
return _4.replace(/^\s{1,}/ig,"").replace(/\s{1,}$/ig,"");
},tickOne:function(_5,_6){
if(_6&&this._tickTimeOut==null){
return;
}
var _7=this._trimString(this._getChildElement("i"+_5).innerHTML);
var _8=_7.length;
var _9=this._length;
if(_9<_8){
var _a=this._controlElement.innerHTML;
if(_7.charAt(_9)=="&"){
_a=_a+"&amp;";
}else{
if(_7.charAt(_9)==" "&&_9+1<_8&&_7.charAt(_9+1)==" "){
_a=_a+" "+"&nbsp;";
this._length++;
}else{
_a=_a+_7.charAt(_9);
}
}
this._controlElement.innerHTML=_a;
this._length++;
var _b=this;
this._tickTimeOut=window.setTimeout(function(){
_b.tickOne(_5,true);
},this.get_tickSpeed());
}else{
this.lineEnd();
}
},clearTimeouts:function(){
window.clearTimeout(this._tickTimeOut);
window.clearTimeout(this._lineTimeOut);
},lineEnd:function(_c){
this._length=0;
var _d=(this._currentLine+1)%this.get_numberOfItems();
if(isNaN(_d)){
_d=0;
}
if(_d<=this._currentLine&&!this.get_loop()){
this.tickerEnd();
return;
}else{
this._currentLine=_d;
}
if(this.get_autoAdvance()){
var _e=this;
this._lineTimeOut=window.setTimeout(function(){
_e.tickLine(_d,true);
},this.get_lineDuration());
}
},tickerEnd:function(){
if(this.tickerEndCode){
eval(this.tickerEndCode);
}
},_postback:function(){
if(!this._postBackReference){
return;
}
var _f=this._postBackReference.replace("arguments",this._currentLine);
eval(_f);
},get_numberOfItems:function(){
return this._numberOfItems;
},set_numberOfItems:function(_10){
this._numberOfItems=_10;
},get_autoStart:function(){
return this._autoStart;
},set_autoStart:function(_11){
this._autoStart=_11;
},get_loop:function(){
return this._loop;
},set_loop:function(_12){
this._loop=_12;
},get_tickSpeed:function(){
return this._tickSpeed;
},set_tickSpeed:function(_13){
this._tickSpeed=_13;
},get_lineDuration:function(){
return this._lineDuration;
},set_lineDuration:function(_14){
this._lineDuration=_14;
},get_autoAdvance:function(){
return this._autoAdvance;
},set_autoAdvance:function(_15){
this._autoAdvance=_15;
},get_skin:function(){
return this._skin;
},set_skin:function(_16){
this._skin=_16;
}};
Telerik.Web.UI.RadTicker.registerClass("Telerik.Web.UI.RadTicker",Telerik.Web.UI.RadWebControl);

