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