﻿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 a=0;
a<this.get_itemsData().length;
a++){var d=this.get_itemsData()[a];
if(d.visible==false){this._invisibleElementsCount++;
}else{var c=this._items.length;
var e=tickElements[c];
var b=$create(Telerik.Web.UI.RadTickerItem,d,null,null,e);
e._item=b;
this._items[c]=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(b,e){if(e&&this._lineTimeOut==null){return;
}this._length=0;
this._controlElement=this._originalControlElement;
this._controlElement.innerHTML="";
var d=this._getChildElement("i"+b);
if(!d){this.lineEnd();
return;
}this._currentLine=b;
var a=d._item.get_navigateUrl();
if(a!=null){var c=document.createElement("a");
c.setAttribute("href",a);
this._controlElement.appendChild(c);
this._controlElement=c;
}this.tickOne(b);
},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(c,f){if(f&&this._tickTimeOut==null){return;
}var e=this._trimString(this._getChildElement("i"+c).innerHTML);
var a=e.length;
var b=this._length;
if(b<a){var g=this._controlElement.innerHTML;
if(e.charAt(b)=="&"){g=g+"&amp;";
}else{if(e.charAt(b)==" "&&b+1<a&&e.charAt(b+1)==" "){g=g+" &nbsp;";
this._length++;
}else{g=g+e.charAt(b);
}}this._controlElement.innerHTML=g;
this._length++;
var d=this;
this._tickTimeOut=window.setTimeout(function(){d.tickOne(c,true);
},this.get_tickSpeed());
}else{this.lineEnd();
}},clearTimeouts:function(){window.clearTimeout(this._tickTimeOut);
window.clearTimeout(this._lineTimeOut);
},lineEnd:function(b){this._length=0;
var a=(this._currentLine+1)%(this.get_numberOfItems()+this._invisibleElementsCount);
if(isNaN(a)){a=0;
}if(a<=this._currentLine&&!this.get_loop()){this.tickerEnd();
return;
}else{this._currentLine=a;
}if(this.get_autoAdvance()){var c=this;
this._lineTimeOut=window.setTimeout(function(){c.tickLine(a,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();