﻿Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadTicker=function(a){Telerik.Web.UI.RadTicker.initializeBase(this,[a]);
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._items=[];
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._originalControlElement=this._controlElement;
tickElements=$telerik.getChildrenByTagName(this._itemsContainer,"span");
this._invisibleElementsCount=0;
for(var c=0;
c<this.get_itemsData().length;
c++){var d=this.get_itemsData()[c];
if(d.visible==false){this._invisibleElementsCount++;
}else{var e=this._items.length;
var a=tickElements[e];
var b=$create(Telerik.Web.UI.RadTickerItem,d,null,null,a);
a._item=b;
this._items[e]=b;
}}this.set_numberOfItems(tickElements.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(a,b){if(b&&this._lineTimeOut==null){return;
}this._length=0;
this._controlElement=this._originalControlElement;
this._controlElement.innerHTML="";
var d=this._getChildElement("i"+a);
if(!d){this.lineEnd();
return;
}this._currentLine=a;
var c=d._item.get_navigateUrl();
if(c!=null){var e=document.createElement("a");
e.setAttribute("href",c);
this._controlElement.appendChild(e);
this._controlElement=e;
}this.tickOne(a);
},resetTicker:function(){this._length=0;
this._isReset=true;
this.clearTimeouts();
this._lineTimeOut=null;
this._tickTimeOut=null;
this._controlElement.innerHTML="";
},_trimString:function(a){return a.replace(/^\s{1,}/ig,"").replace(/\s{1,}$/ig,"");
},tickOne:function(b,c){if(c&&this._tickTimeOut==null){return;
}var e=this._trimString(this._getChildElement("i"+b).innerHTML);
var g=e.length;
var d=this._length;
if(d<g){var a=this._controlElement.innerHTML;
if(e.charAt(d)=="&"){a=a+"&amp;";
}else{if(e.charAt(d)==" "&&d+1<g&&e.charAt(d+1)==" "){a=a+" &nbsp;";
this._length++;
}else{a=a+e.charAt(d);
}}this._controlElement.innerHTML=a;
this._length++;
var f=this;
this._tickTimeOut=window.setTimeout(function(){f.tickOne(b,true);
},this.get_tickSpeed());
}else{this.lineEnd();
}},clearTimeouts:function(){window.clearTimeout(this._tickTimeOut);
window.clearTimeout(this._lineTimeOut);
},lineEnd:function(a){this._length=0;
var b=(this._currentLine+1)%(this.get_numberOfItems()+this._invisibleElementsCount);
if(isNaN(b)){b=0;
}if(b<=this._currentLine&&!this.get_loop()){this.tickerEnd();
return;
}else{this._currentLine=b;
}if(this.get_autoAdvance()){var c=this;
this._lineTimeOut=window.setTimeout(function(){c.tickLine(b,true);
},this.get_lineDuration());
}},tickerEnd:function(){if(this.tickerEndCode){eval(this.tickerEndCode);
}},_postback:function(){if(!this._postBackReference){return;
}var a=this._postBackReference.replace("arguments",this._currentLine);
eval(a);
},get_numberOfItems:function(){return this._numberOfItems;
},set_numberOfItems:function(a){this._numberOfItems=a;
},get_autoStart:function(){return this._autoStart;
},set_autoStart:function(a){this._autoStart=a;
},get_loop:function(){return this._loop;
},set_loop:function(a){this._loop=a;
},get_tickSpeed:function(){return this._tickSpeed;
},set_tickSpeed:function(a){this._tickSpeed=a;
},get_lineDuration:function(){return this._lineDuration;
},set_lineDuration:function(a){this._lineDuration=a;
},get_autoAdvance:function(){return this._autoAdvance;
},set_autoAdvance:function(a){this._autoAdvance=a;
},get_skin:function(){return this._skin;
},set_skin:function(a){this._skin=a;
},get_items:function(){return this._items;
},set_items:function(a){this._items=a;
},get_itemsData:function(){return this._itemsData;
},set_itemsData:function(a){this._itemsData=a;
}};
Telerik.Web.UI.RadTicker.registerClass("Telerik.Web.UI.RadTicker",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.RadTickerItem=function(a){Telerik.Web.UI.RadTickerItem.initializeBase(this,[a]);
};
Telerik.Web.UI.RadTickerItem.prototype={initialize:function(){Telerik.Web.UI.RadTickerItem.callBaseMethod(this,"initialize");
},dispose:function(){Telerik.Web.UI.RadTickerItem.callBaseMethod(this,"dispose");
},get_navigateUrl:function(){return this._navigateUrl;
},set_navigateUrl:function(a){this._navigateUrl=a;
},get_cssClass:function(){return this._cssClass;
},set_cssClass:function(a){this._cssClass=a;
}};
Telerik.Web.UI.RadTickerItem.registerClass("Telerik.Web.UI.RadTickerItem",Telerik.Web.UI.RadWebControl);

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();