﻿Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadTicker=function(b){Telerik.Web.UI.RadTicker.initializeBase(this,[b]);
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.get_numberOfItems()>0){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(c,d){if(d&&this._lineTimeOut==null){return
}this._length=0;
this._controlElement.innerHTML="";
this._currentLine=c;
this.tickOne(c)
},resetTicker:function(){this._length=0;
this._isReset=true;
this.clearTimeouts();
this._lineTimeOut=null;
this._tickTimeOut=null;
this._controlElement.innerHTML=""
},_trimString:function(b){return b.replace(/^\s{1,}/ig,"").replace(/\s{1,}$/ig,"")
},tickOne:function(i,j){if(j&&this._tickTimeOut==null){return
}var l=this._trimString(this._getChildElement("i"+i).innerHTML);
var n=l.length;
var k=this._length;
if(k<n){var h=this._controlElement.innerHTML;
if(l.charAt(k)=="&"){h=h+"&amp;"
}else{if(l.charAt(k)==" "&&k+1<n&&l.charAt(k+1)==" "){h=h+" &nbsp;";
this._length++
}else{h=h+l.charAt(k)
}}this._controlElement.innerHTML=h;
this._length++;
var m=this;
this._tickTimeOut=window.setTimeout(function(){m.tickOne(i,true)
},this.get_tickSpeed())
}else{this.lineEnd()
}},clearTimeouts:function(){window.clearTimeout(this._tickTimeOut);
window.clearTimeout(this._lineTimeOut)
},lineEnd:function(d){this._length=0;
var e=(this._currentLine+1)%this.get_numberOfItems();
if(isNaN(e)){e=0
}if(e<=this._currentLine&&!this.get_loop()){this.tickerEnd();
return
}else{this._currentLine=e
}if(this.get_autoAdvance()){var f=this;
this._lineTimeOut=window.setTimeout(function(){f.tickLine(e,true)
},this.get_lineDuration())
}},tickerEnd:function(){if(this.tickerEndCode){eval(this.tickerEndCode)
}},_postback:function(){if(!this._postBackReference){return
}var b=this._postBackReference.replace("arguments",this._currentLine);
eval(b)
},get_numberOfItems:function(){return this._numberOfItems
},set_numberOfItems:function(b){this._numberOfItems=b
},get_autoStart:function(){return this._autoStart
},set_autoStart:function(b){this._autoStart=b
},get_loop:function(){return this._loop
},set_loop:function(b){this._loop=b
},get_tickSpeed:function(){return this._tickSpeed
},set_tickSpeed:function(b){this._tickSpeed=b
},get_lineDuration:function(){return this._lineDuration
},set_lineDuration:function(b){this._lineDuration=b
},get_autoAdvance:function(){return this._autoAdvance
},set_autoAdvance:function(b){this._autoAdvance=b
},get_skin:function(){return this._skin
},set_skin:function(b){this._skin=b
}};
Telerik.Web.UI.RadTicker.registerClass("Telerik.Web.UI.RadTicker",Telerik.Web.UI.RadWebControl);
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();