﻿Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadRotator=function(_1){
Telerik.Web.UI.RadRotator.initializeBase(this,[_1]);
this._skin="Default";
this._postBackReference=null;
this._items=null;
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings({});
this._webServiceLoader=null;
this._containerElement=null;
this._clickDelegate=null;
this._mouseOutDelegate=null;
this._mouseOverDelegate=null;
this._itemShownDelegate=null;
this._rotatorDisposed=false;
this._useRandomSlide=false;
this._pauseOnMouseOver=true;
var _2=Telerik.Web.UI.RotatorScrollDirection;
this._scrollDirection=_2.Left+_2.Right;
this._slideShowAnimationSettings={};
this._rotatorType=Telerik.Web.UI.RotatorType.AutomaticAdvance;
this._scrollDuration=500;
this._frameDuration=2000;
this._initialItemIndex=0;
this._canPause=true;
this._wrapFrames=true;
this._controlButtons={};
this._relativeWrapper=null;
this._clipElement=null;
this._itemsElement=null;
this._animationDirection=_2.Left;
this._rightButton=null;
this._leftButton=null;
this._downButton=null;
this._upButton=null;
};
Telerik.Web.UI.RadRotator.prototype={initialize:function(){
Telerik.Web.UI.RadRotator.callBaseMethod(this,"initialize");
this._rotatorDisposed=false;
this._setChildElements();
this._createUI();
this._createChildItems();
this._attachEvents(true);
this._initialItemSet=false;
this._loadInitialFrame();
this._enableDisableButtons();
this._fixVisibilityProblems(true);
this.raiseEvent("load",Sys.EventArgs.Empty);
if(this.isAutomaticAdvance()){
var _3=this.get_frameDuration();
if(_3>0){
window.setTimeout(Function.createDelegate(this,this.startAutoPlay),_3);
}else{
this.startAutoPlay();
}
}
},dispose:function(){
this._rotatorDisposed=true;
this._fixVisibilityProblems(false);
this._attachEvents(false);
this._containerElement=null;
if(this._animation){
this._animation.dispose();
this._animation=null;
}
if(this._slideShowAnimation){
this._slideShowAnimation.dispose();
this._slideShowAnimation=null;
}
if(this._rightButton){
$clearHandlers(this._rightButton);
}
if(this._leftButton){
$clearHandlers(this._leftButton);
}
if(this._downButton){
$clearHandlers(this._downButton);
}
if(this._upButton){
$clearHandlers(this._upButton);
}
if(this._itemsElement){
$clearHandlers(this._itemsElement);
}
Telerik.Web.UI.RadRotator.callBaseMethod(this,"dispose");
},_createChildItems:function(){
var _4=$telerik.getChildrenByTagName(this.get_containerElement(),"li");
for(var i=0;i<_4.length;i++){
var _6=$create(Telerik.Web.UI.RadRotatorItem,this.get_items()[i],null,null,_4[i]);
var _7=_6.get_index();
_4[i]._item=_6;
this.get_items()[i]=_6;
}
},_getNextItemToShow:function(){
var _8=this.getItemHtmlElements();
var _9=this.isScrollingForward();
if(this._nextItemIndex==null){
var _a=_9?0:_8.length-1;
this._nextItemIndex=_a;
}
if(this._nextItemIndex<0){
return null;
}
var li=_8[this._nextItemIndex];
if(_9){
this._nextItemIndex++;
}else{
this._nextItemIndex--;
}
if(this._nextItemIndex>_8.length-1||this._nextItemIndex<0){
this._nextItemIndex=null;
}
return li;
},get_currentItem:function(){
var _c=this._currentItem;
if(!_c){
var _d=this._itemsElement;
var _e=this.getItemHtmlElements();
_c=this.isScrollingForward()?_e[0]:_e[_e.length-1];
}
return _c;
},_needsShift:function(_f){
if(null==_f){
_f=this.get_animationDirection();
}
var _10=this._itemsElement;
var _11=this._clipElement;
var _12=parseInt(_10.style.left);
var _13=parseInt(_10.style.top);
var _14=$telerik.getOuterSize(_10);
var _15=$telerik.getContentSize(_11);
var _16=this.get_currentItem();
if(!_16){
return false;
}
var _17=$telerik.getOuterSize(_16);
var _18=false;
var _19=Telerik.Web.UI.RotatorScrollDirection;
switch(_f){
case _19.Left:
_18=_12+_14.width<_15.width+_17.width;
break;
case _19.Up:
_18=_13+_14.height<_15.height+_17.height;
break;
case _19.Right:
_18=_12*-1<_17.width;
break;
case _19.Down:
_18=_13*-1<_15.height;
break;
}
return _18;
},_getMoveAnimation:function(){
if(this._animation){
return this._animation;
}
var _1a=this._itemsElement;
var _1b=this._getCalculatedAnimationDuration();
var fps=25;
this._animation=new Telerik.Web.Animation.MoveAnimation(_1a,_1b,fps,true,false,false,"px");
function returnZeroPixels(_1d,end,_1f){
return 0;
}
if(this.get_vertical()){
this._animation._horizontalAnimation.interpolate=returnZeroPixels;
}else{
this._animation._verticalAnimation.interpolate=returnZeroPixels;
}
return this._animation;
},scrollViewport:function(){
var _20=this._itemsElement;
if(!this._animation){
var _21=this._getMoveAnimation();
var _22=Function.createDelegate(this,function(){
var _23=this._hasViewportWidth();
if(!_23&&this.get_wrapFrames()){
var _24=this.getItemHtmlElements().length;
for(var i=0;i<_24;i++){
this._shiftItemInList();
_23=this._hasViewportWidth();
if(_23){
break;
}
}
}
var _26=this._getViewPortPixelsToScroll();
var _27=this.isScrollingForward();
if(this.get_vertical()){
var _28=parseInt(_20.style.top)+(_27?-_26:_26);
_21.set_vertical(_28);
}else{
var _28=parseInt(_20.style.left)+(_27?-_26:_26);
_21.set_horizontal(_28);
}
});
_21.add_started(Function.createDelegate(this,function(){
this.stopViewportAnimation();
var _29=!this._hasViewportWidth();
if(_29&&!this.get_wrapFrames()){
return false;
}
var _2a=null;
var _2b=new Telerik.Web.UI.RadRotatorCancelEventArgs(_2a);
this.raiseEvent("itemShowing",_2b);
if(_2b.get_cancel&&_2b.get_cancel()){
return false;
}
if(this.isSlideShow()){
_20.style.visibility="hidden";
}
_22();
}));
_21.add_ended(Function.createDelegate(this,function(){
this._enableDisableButtons();
if(this.isSlideShow()){
_20.style.visibility="visible";
this.runSlideShowAnimation();
}else{
var _2c=null;
this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(_2c));
}
}));
}
this._animation.play();
},scrollItem:function(){
var _2d=this._clipElement;
var _2e=this._itemsElement;
if(!this._animation){
this._animation=this._getMoveAnimation();
var _2f=this._animation;
var _30=Function.createDelegate(this,function(){
var _31=this._getNextItemToShow();
if(!_31){
return;
}
this._currentItem=_31;
var _32=$telerik.getOuterSize(_31);
if(this.isScrollingForward()){
_32.width*=-1;
_32.height*=-1;
}
if(this.get_vertical()){
var _33=parseInt(_2e.style.top)+_32.height;
_2f.set_vertical(_33);
}else{
var _33=parseInt(_2e.style.left)+_32.width;
_2f.set_horizontal(_33);
}
});
_2f.add_started(Function.createDelegate(this,function(){
var _34=this._needsShift();
if(_34&&!this.get_wrapFrames()){
return false;
}
var _35=this._getNextItemToShow().control;
var _36=new Telerik.Web.UI.RadRotatorCancelEventArgs(_35);
this.raiseEvent("itemShowing",_36);
if(_36.get_cancel&&_36.get_cancel()){
return false;
}
if(_34){
this._shiftItemInList();
}
if(this._stopAnimationButtonOver){
return;
}
_30();
}));
_2f.add_ended(Function.createDelegate(this,function(){
var _37=this._getNextItemToShow().control;
this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(_37));
if(this._stopAnimationButtonOver){
return;
}
if(this.isAutomaticAdvance()){
if(this.get_frameDuration()>0){
this._setAnimationTimeout(this.get_frameDuration());
}else{
this._animation.play();
}
}
}));
}
this._animation.stop();
this._animation.play();
},_checkItemsSize:function(){
var _38=$telerik.getOuterSize(this._itemsElement);
var _39=this.get_vertical();
var _3a=(_39)?_38.height:_38.width;
var _3b=(_39)?this.get_height():this.get_width();
return parseInt(_3a)>parseInt(_3b);
},_shiftItemInList:function(){
var _3c=this._itemsElement;
var lis=this.getItemHtmlElements();
var _3e=this.get_vertical();
var _3f=this.isScrollingForward();
var _40=parseInt(_3c.style.left);
var _41=parseInt(_3c.style.top);
var _42=_3f?lis[0]:lis[lis.length-1];
var _43=$telerik.getOuterSize(_42);
_42.parentNode.removeChild(_42);
if(!_3f){
_3c.insertBefore(_42,_3c.firstChild);
}
if(_3e){
_3c.style.top=(_41+(_3f?_43.height:-_43.height))+"px";
}else{
_3c.style.left=(_40+(_3f?_43.width:-_43.width))+"px";
}
if(_3f){
_3c.appendChild(_42);
}
this._nextItemIndex=_3f?lis.length-1:0;
return _42;
},_loadInitialFrame:function(){
var _44=this.get_initialItemIndex();
var _45=this.get_defaultAnimationDirection();
var _46=Telerik.Web.UI.RotatorScrollDirection;
var _47=this.isVertical();
var _48=this._itemsElement;
var _49=$telerik.getOuterSize(_48);
var _4a=$telerik.getContentSize(this._clipElement);
var x=0;
var y=0;
if(_44>=0){
if(_47){
y=(_45==_46.Up)?0:-_49.height+_4a.height;
}else{
x=(_45==_46.Left)?0:-_49.width+_4a.width;
}
}else{
if(_44==-1){
if(_47){
y=(_45==_46.Down)?-_49.height:_4a.height;
}else{
x=(_45==_46.Right)?-_49.width:_4a.width;
}
}
}
_48.style.left=x+"px";
_48.style.top=y+"px";
if(_44>0&&!this._initialItemSet){
for(var i=0;i<_44;i++){
this._shiftItemInList();
}
_48.style.left=x+"px";
_48.style.top=y+"px";
}
if(!this._initialItemSet&&_44>=0){
this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(this.get_items()[_44]));
}
this._initialItemSet=true;
},pause:function(){
this._isPaused=true;
if(this._animation&&this._animation.get_isActive()){
this._animation.pause();
}
},resume:function(){
if(this._timeoutPassed||!this._isPaused){
if(this._animation){
this._animation.play();
}
}else{
if(this._isPaused){
this._isPaused=false;
if(this._animation&&this._animation.get_isActive()){
this._animation.play();
}
}
}
},stop:function(){
this._clearAnimationTimeout();
this._canPause=false;
this.pause();
},start:function(){
this._canPause=true;
this._isPaused=false;
this.resume();
},isViewportScrollMode:function(){
var _4e=Telerik.Web.UI.RotatorType;
if(this._isRotatorTypeEnabled(_4e.AutomaticAdvance)||this._isRotatorTypeEnabled(_4e.ButtonsOver)||this._isRotatorTypeEnabled(_4e.FromCode)){
return false;
}
return true;
},_getButtonScrollDirection:function(_4f){
var _50=Telerik.Web.UI.RotatorScrollDirection;
var _51=_50.Left;
switch(_4f){
case this._rightButton:
_51=_50.Left;
break;
case this._leftButton:
_51=_50.Right;
break;
case this._downButton:
_51=_50.Up;
break;
case this._upButton:
_51=_50.Down;
break;
}
return _51;
},_buttonClicked:function(e){
var _53=e.target;
if(this._isButtonDisabled(_53)){
return;
}
var _54=new Telerik.Web.UI.RadRotatorButtonEventArgs(_53);
this.raiseEvent("buttonClick",_54);
if(_54.get_cancel()){
return;
}
var _55=this._getButtonScrollDirection(_53);
this.set_animationDirection(_55);
this.scrollViewport();
return $telerik.cancelRawEvent(e);
},_buttonOver:function(e){
var _57=e.target;
if(this._isButtonDisabled(_57)){
return;
}
var _58=new Telerik.Web.UI.RadRotatorButtonEventArgs(_57);
this.raiseEvent("buttonOver",_58);
if(_58.get_cancel()){
return;
}
var _59=this._getButtonScrollDirection(_57);
this.set_animationDirection(_59);
this._stopAnimationButtonOver=false;
this.scrollItem();
return $telerik.cancelRawEvent(e);
},_buttonOut:function(e){
var _5b=e.target;
if(this._isButtonDisabled(_5b)){
return;
}
var _5c=new Telerik.Web.UI.RadRotatorButtonEventArgs(_5b);
this.raiseEvent("buttonOut",_5c);
if(_5c.get_cancel()){
return;
}
var _5d=this._getButtonScrollDirection(_5b);
this.set_animationDirection(_5d);
this._stopAnimationButtonOver=true;
return $telerik.cancelRawEvent(e);
},_initializeButtonsRotatorType:function(){
var _5e=this.get_controlButtons();
this._rightButton=$telerik.getElementByClassName(this._rootElement,this._rotatorRightClass);
this._leftButton=$telerik.getElementByClassName(this._rootElement,this._rotatorLeftClass);
this._downButton=$telerik.getElementByClassName(this._rootElement,this._rotatorDownClass);
this._upButton=$telerik.getElementByClassName(this._rootElement,this._rotatorUpClass);
var _5f=Telerik.Web.UI.RotatorScrollDirection;
var _60=[_5f.Right,_5f.Left,_5f.Down,_5f.Up];
var _61=[this._leftButton,this._rightButton,this._upButton,this._downButton];
var _62=[_5e.LeftButtonID?$get(_5e.LeftButtonID):null,_5e.RightButtonID?$get(_5e.RightButtonID):null,_5e.UpButtonID?$get(_5e.UpButtonID):null,_5e.DownButtonID?$get(_5e.DownButtonID):null];
var _63=[this._rotatorLeftClass,this._rotatorRightClass,this._rotatorUpClass,this._rotatorDownClass];
var _64=["marginLeft","marginRight","marginTop","marginBottom"];
var _65=["paddingLeft","paddingRight","paddingTop","paddingBottom"];
var _66=["width","width","height","height"];
var _67=this._relativeWrapper;
var _68=this.get_element();
for(var i=0;i<_61.length;i++){
var _6a=_61[i];
var _6b=(null!=_62[i])?_62[i]:_6a;
this._createButton(_6a,_63[i]);
if(this._isScrollDirectionEnabled(_60[i])&&null==_62[i]){
_6a.style.display="block";
var _6c=_66[i];
var _6d=parseInt($telerik.getCurrentStyle(_6a,_6c));
_67.style[_6c]=(parseInt(_67.style[_6c])-_6d)+"px";
_68.style[_6c]=(parseInt(_68.style[_6c])-_6d)+"px";
_68.style[_65[i]]=_6d+"px";
}
if(this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.Buttons)||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.SlideShowButtons)){
$addHandlers(_6b,{"click":this._buttonClicked},this);
}else{
$addHandlers(_6b,{"mouseover":this._buttonOver,"mouseout":this._buttonOut},this);
}
}
this._rightButton=_62[1]||this._rightButton;
this._leftButton=_62[0]||this._leftButton;
this._downButton=_62[3]||this._downButton;
this._upButton=_62[2]||this._upButton;
var _6e=false;
for(var i=0;i<_62.length;i++){
if(_62[i]){
_6e=true;
}
break;
}
return _6e;
},runSlideShowAnimation:function(){
if(!this._slideShowAnimation){
var _6f=this._itemsElement;
var _70=this.get_slideShowAnimationSettings().duration||500;
_70=_70/1000;
var _71=this.get_slideShowAnimationSettings().type||Telerik.Web.UI.RotatorAnimationType.None;
var _72=Function.createDelegate(this,function(){
this._canPause=false;
});
var _73=Function.createDelegate(this,function(){
this._canPause=true;
var _74=null;
this.raiseEvent("itemShown",new Telerik.Web.UI.RadRotatorEventArgs(_74));
if(this.get_frameDuration()>0&&this.isAutomaticAdvance()){
this._setAnimationTimeout(this.get_frameDuration());
}
});
switch(_71){
case Telerik.Web.UI.RotatorAnimationType.Fade:
this._slideShowAnimation=new Telerik.Web.Animation.FadeInAnimation(_6f,_70);
this._slideShowAnimation.add_started(_72);
this._slideShowAnimation.add_ended(_73);
break;
case Telerik.Web.UI.RotatorAnimationType.Pulse:
this._slideShowAnimation=new Telerik.Web.Animation.PulseAnimation(_6f,null);
this._slideShowAnimation.set_iterations(1);
this._slideShowAnimation.set_duration(_70);
this._slideShowAnimation.add_ended(_73);
break;
default:
this._slideShowAnimation={};
this._slideShowAnimation.play=_73;
this._slideShowAnimation.dispose=function(){
};
break;
}
}
this._slideShowAnimation.play();
},_hasViewportWidth:function(_75){
if(null==_75){
_75=this.get_animationDirection();
}
var _76=this._itemsElement;
var _77=this._clipElement;
var _78=parseInt(_76.style.left);
var _79=parseInt(_76.style.top);
var _7a=$telerik.getOuterSize(_76);
var _7b=$telerik.getContentSize(_77);
var _7c=false;
var _7d=Telerik.Web.UI.RotatorScrollDirection;
switch(_75){
case _7d.Left:
_7c=_7a.width+_78<_7b.width*2;
break;
case _7d.Up:
_7c=_7a.height+_79<_7b.height*2;
break;
case _7d.Right:
_7c=(_78*-1<_7b.width);
break;
case _7d.Down:
_7c=(_79*-1<_7b.height);
break;
}
return !_7c;
},stopViewportAnimation:function(){
var _7e=this._animation;
if(!_7e){
return;
}
if(_7e.get_isPlaying()){
_7e.stop();
var _7f=this.get_vertical();
var _80=_7f?_7e.get_vertical():_7e.get_horizontal();
if(null!=_80){
this._itemsElement.style[_7f?"top":"left"]=_80+"px";
}
}
},_getViewPortPixelsToScroll:function(){
var _81=this.get_vertical();
var _82=$telerik.getContentSize(this._clipElement);
var _83=_81?_82.height:_82.width;
return _83;
},showNext:function(_84){
this.set_animationDirection(_84);
if(!this._checkItemsSize()){
return;
}
if(this.isViewportScrollMode()){
this.scrollViewport();
}else{
this.scrollItem();
}
},getItemHtmlElements:function(){
var _85=this._itemsElement;
if(!this._hasCleanedList){
var _86=_85.childNodes;
for(var i=0;i<_86.length;i++){
var _88=_86[i];
if(_88&&_88.tagName!="LI"){
_85.removeChild(_88);
i--;
}
}
this._hasCleanedList=true;
}
return _85.childNodes;
},_getCalculatedAnimationDuration:function(_89){
var _8a=this.get_scrollDuration()/1000;
return _8a;
},_setAnimationTimeout:function(_8b){
this._clearAnimationTimeout();
this._currentAnimationTimeout=window.setTimeout(Function.createDelegate(this,function(){
if(!this._isPaused){
this.resume();
}
this._timeoutPassed=true;
}),_8b);
},_clearAnimationTimeout:function(){
if(this._currentAnimationTimeout){
window.clearTimeout(this._currentAnimationTimeout);
}
this._currentAnimationTimeout=0;
this._timeoutPassed=false;
},isAutomaticAdvance:function(){
var _8c=Telerik.Web.UI.RotatorType;
if(this._isRotatorTypeEnabled(_8c.AutomaticAdvance)||this._isRotatorTypeEnabled(_8c.SlideShow)){
return true;
}
return false;
},isSlideShow:function(){
var _8d=Telerik.Web.UI.RotatorType;
if(this._isRotatorTypeEnabled(_8d.SlideShow)||this._isRotatorTypeEnabled(_8d.SlideShowButtons)){
return true;
}
return false;
},isScrollingForward:function(){
return this.isScrollingLeft()||this.isScrollingUp();
},isScrollingLeft:function(){
return this._isAnimationDirectionOn(Telerik.Web.UI.RotatorScrollDirection.Left);
},isScrollingUp:function(){
return this._isAnimationDirectionOn(Telerik.Web.UI.RotatorScrollDirection.Up);
},_isAnimationDirectionOn:function(_8e){
return _8e==this.get_animationDirection()?true:false;
},_enableDisableButtons:function(){
if(this._rotatorType==Telerik.Web.UI.RotatorType.AutomaticAdvance){
return;
}
var _8f=this.get_wrapFrames();
var _90=Telerik.Web.UI.RotatorScrollDirection;
this._enableButton(this._rightButton,_8f||this._canSlideMore(_90.Left));
this._enableButton(this._leftButton,_8f||this._canSlideMore(_90.Right));
this._enableButton(this._downButton,_8f||this._canSlideMore(_90.Up));
this._enableButton(this._upButton,_8f||this._canSlideMore(_90.Down));
},_enableButton:function(_91,_92){
if(!_91){
return;
}
if(_92){
Sys.UI.DomElement.removeCssClass(_91,this._rotatorButtonDisabledClass);
_91.removeAttribute("disabled");
}else{
Sys.UI.DomElement.addCssClass(_91,this._rotatorButtonDisabledClass);
_91.setAttribute("disabled","disabled");
}
},_canSlideMore:function(_93){
if(null==_93){
_93=this.get_animationDirection();
}
var _94=false;
var _95=this._itemsElement;
var _96=this._clipElement;
var _97=Telerik.Web.UI.RotatorScrollDirection;
var _98=parseInt(_95.style.left);
var _99=parseInt(_95.style.top);
var _9a=$telerik.getBounds(_95);
var _9b=$telerik.getBounds(_96);
if(_93==_97.Left){
_94=(_9a.width+_98)>_9b.width;
}else{
if(_93==_97.Up){
_94=(_9a.height+_99)>_9b.height;
}else{
if(_93==_97.Right){
_94=(_98<0);
}else{
if(_93==_97.Down){
_94=(_99<0);
}
}
}
}
return _94;
},_getCalculatedAnimationDirection:function(){
var _9c=this.get_animationDirection();
var _9d=Telerik.Web.UI.RotatorScrollDirection;
var _9e=23;
switch(_9c){
case _9d.Left:
_9e=21;
break;
case _9d.Down:
_9e=32;
break;
case _9d.Up:
_9e=12;
break;
default:
_9e=23;
}
return _9e;
},startAutoPlay:function(){
if(this._rotatorDisposed){
return;
}
this._loadInitialFrame();
this.showNext(this.get_defaultAnimationDirection());
},get_defaultAnimationDirection:function(){
var _9f=Telerik.Web.UI.RotatorScrollDirection;
var dir=0;
if(this._isScrollDirectionEnabled(_9f.Left)){
dir=_9f.Left;
}else{
if(this._isScrollDirectionEnabled(_9f.Up)){
dir=_9f.Up;
}else{
if(this._isScrollDirectionEnabled(_9f.Right)){
dir=_9f.Right;
}else{
if(this._isScrollDirectionEnabled(_9f.Down)){
dir=_9f.Down;
}
}
}
}
if(!dir){
dir=_9f.Left;
}
return dir;
},get_containerElement:function(){
return this._itemsElement;
},_setChildElements:function(){
this._rotatorListClass="radr_itemsList";
this._rotatorVerticalClass="radr_verticalList";
this._rotatorRelativeWrapperClass="radr_relativeWrapper";
this._rotatorClipRegionClass="radr_clipRegion";
this._rotatorRightClass="radr_buttonRight";
this._rotatorLeftClass="radr_buttonLeft";
this._rotatorDownClass="radr_buttonDown";
this._rotatorUpClass="radr_buttonUp";
this._rotatorButtonDisabledClass="radr_buttonDisabled";
this._rootElement=this.get_element();
this._relativeWrapper=$telerik.getElementByClassName(this._rootElement,this._rotatorRelativeWrapperClass);
this._clipElement=$telerik.getElementByClassName(this._rootElement,this._rotatorClipRegionClass);
this._itemsElement=$telerik.getElementByClassName(this._rootElement,this._rotatorListClass);
},_createUI:function(){
if(!this.isVisible()){
return;
}
this._fixRootElementSize();
var _a1=this.get_element();
var _a2=this._relativeWrapper;
_a2.style.height=_a1.offsetHeight+"px";
_a2.style.width=_a1.offsetWidth+"px";
var _a3=true;
if(this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.Buttons)||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.ButtonsOver)||this._isRotatorTypeEnabled(Telerik.Web.UI.RotatorType.SlideShowButtons)){
_a3=this._initializeButtonsRotatorType();
}
if(_a3){
Sys.UI.DomElement.addCssClass(_a1,"radr_noBorder");
}
if(this.get_vertical()){
this.set_vertical(true);
}
_a2.style.overflow="auto";
var _a4=this._clipElement;
_a4.style.overflow="auto";
_a4.style.width="10000px";
_a4.style.height="10000px";
this._itemsElement.style.width=this.get_vertical()?_a2.style.width:this._itemsElement.offsetWidth+"px";
this._itemsElement.style.height=this._itemsElement.offsetHeight+"px";
_a2.style.overflow="";
_a4.style.width=_a2.style.width;
_a4.style.height=_a2.style.height;
_a4.style.overflow="hidden";
_a4.style.position="relative";
this._itemsElement.style.position="relative";
_a1.style.visibility="visible";
},_fixRootElementSize:function(){
var _a5=this.get_element();
var _a6=Telerik.Web.UI.RotatorScrollDirection;
var _a7=parseInt(_a5.style.paddingLeft);
if(_a7&&!isNaN(_a7)&&this._isScrollDirectionEnabled(_a6.Left)){
_a5.style.width=(parseInt(_a5.style.width)+_a7)+"px";
_a5.style.paddingLeft="";
}
_a7=parseInt(_a5.style.paddingRight);
if(_a7&&!isNaN(_a7)&&this._isScrollDirectionEnabled(_a6.Right)){
_a5.style.width=(parseInt(_a5.style.width)+_a7)+"px";
_a5.style.paddingRight="";
}
_a7=parseInt(_a5.style.paddingTop);
if(_a7&&!isNaN(_a7)&&this._isScrollDirectionEnabled(_a6.Up)){
_a5.style.height=(parseInt(_a5.style.height)+_a7)+"px";
_a5.style.paddingTop="";
}
_a7=parseInt(_a5.style.paddingBottom);
if(_a7&&!isNaN(_a7)&&this._isScrollDirectionEnabled(_a6.Down)){
_a5.style.height=(parseInt(_a5.style.height)+_a7)+"px";
_a5.style.paddingBottom="";
}
},_createButton:function(_a8,_a9){
var _aa=_a8;
if(!_aa){
_aa=document.createElement("div");
}
if(!_aa.className){
_aa.className=this._rotatorDownClass;
}
return _aa;
},_isButtonDisabled:function(_ab){
if(!_ab){
return true;
}
return Sys.UI.DomElement.containsCssClass(_ab,this._rotatorButtonDisabledClass);
},_isScrollDirectionEnabled:function(_ac){
return _ac&this._scrollDirection?true:false;
},_isRotatorTypeEnabled:function(_ad){
return _ad==this._rotatorType?true:false;
},get_rotatorType:function(){
return this._rotatorType;
},set_rotatorType:function(_ae){
this._rotatorType=_ae;
},get_wrapFrames:function(){
return this._wrapFrames;
},set_wrapFrames:function(_af){
this._wrapFrames=_af;
},get_scrollDuration:function(){
if(this.isSlideShow()){
return 1;
}else{
return this._scrollDuration;
}
},set_scrollDuration:function(_b0){
this._scrollDuration=_b0;
},set_vertical:function(_b1){
if(this._itemsElement){
Sys.UI.DomElement.addCssClass(this._itemsElement,this._rotatorVerticalClass);
}
},get_vertical:function(){
var _b2=Telerik.Web.UI.RotatorScrollDirection;
return (this._isScrollDirectionEnabled(_b2.Down)||this._isScrollDirectionEnabled(_b2.Up));
},isVertical:function(){
if(this._itemsElement){
return Sys.UI.DomElement.containsCssClass(this._itemsElement,this._rotatorVerticalClass);
}
return false;
},get_height:function(){
return this.get_element().style.height;
},set_height:function(_b3){
this.get_element().style.height=_b3;
if(this.isVisible()){
this.repaint();
}
},get_width:function(){
return this.get_element().style.width;
},set_width:function(_b4){
this.get_element().style.width=_b4;
if(this.isVisible()){
this.repaint();
}
},get_scrollDirection:function(){
return this._scrollDirection;
},set_scrollDirection:function(_b5){
this._scrollDirection=_b5;
},get_frameDuration:function(){
return this._frameDuration;
},set_frameDuration:function(_b6){
this._frameDuration=_b6;
},get_controlButtons:function(){
return this._controlButtons;
},set_controlButtons:function(_b7){
this._controlButtons=_b7;
},get_initialItemIndex:function(){
return this._initialItemIndex;
},set_initialItemIndex:function(_b8){
this._initialItemIndex=_b8;
},get_slideShowAnimationSettings:function(){
return this._slideShowAnimationSettings;
},set_slideShowAnimationSettings:function(_b9){
this._slideShowAnimationSettings=_b9;
},set_animationDirection:function(_ba){
this._animationDirection=_ba?_ba:Telerik.Web.UI.RotatorScrollDirection.Left;
},get_animationDirection:function(){
return this._animationDirection;
},_attachEvents:function(_bb){
var _bc=this.get_containerElement();
if(null==_bc){
return;
}
if(_bb!=false){
this._clickDelegate=Function.createDelegate(this,this._mouseClickHandler);
this._mouseOutDelegate=Function.createDelegate(this,this._mouseOutHandler);
this._mouseOverDelegate=Function.createDelegate(this,this._mouseOverHandler);
this._itemShownDelegate=Function.createDelegate(this,this._itemShownHandler);
$addHandler(_bc,"mouseover",this._mouseOverDelegate);
$addHandler(_bc,"mouseout",this._mouseOutDelegate);
$addHandler(_bc,"click",this._clickDelegate);
this.add_itemShown(this._itemShownDelegate);
}else{
$removeHandler(_bc,"mouseover",this._mouseOverDelegate);
$removeHandler(_bc,"mouseout",this._mouseOutDelegate);
$removeHandler(_bc,"click",this._clickDelegate);
this._clickDelegate=null;
this._mouseOutDelegate=null;
this._mouseOverDelegate=null;
this.remove_itemShown(this._itemShownDelegate);
}
},_itemShownHandler:function(_bd){
if(typeof (Telerik.Web.UI.RadTicker)=="undefined"){
return;
}
var _be=this.get_items();
for(var i=0,len=_be.length;i<len;i++){
var _c1=_be[i];
if(this._isItemVisible(_c1)){
this._fireTickersForItem(_c1);
}else{
this._resetTickersForItem(_c1);
}
}
},_mouseOverHandler:function(_c2){
if(this.isAutomaticAdvance()&&this._canPause){
this.pause();
}
var _c3=this._getItemFromEvent(_c2.target);
if(null!=_c3){
this.raiseEvent("mouseOver",new Telerik.Web.UI.RadRotatorEventArgs(_c3));
}
},_mouseOutHandler:function(_c4){
if(this.isAutomaticAdvance()&&this._canPause){
this.resume();
}
var _c5=this._getItemFromEvent(_c4.target);
if(null!=_c5){
this.raiseEvent("mouseOut",new Telerik.Web.UI.RadRotatorEventArgs(_c5));
}
},_mouseClickHandler:function(_c6){
var _c7=this._getItemFromEvent(_c6.target);
if(null!=_c7){
var _c8=new Telerik.Web.UI.RadRotatorCancelEventArgs(_c7);
this.raiseEvent("itemClicking",_c8);
if(_c8.get_cancel&&_c8.get_cancel()){
$telerik.cancelRawEvent(_c6.rawEvent);
return false;
}
window.setTimeout(Function.createDelegate(this,function(){
this.raiseEvent("itemClicked",new Telerik.Web.UI.RadRotatorEventArgs(_c7));
this._postback(_c7.get_index());
}),0);
}
},_postback:function(_c9){
if(!this._postBackReference){
return;
}
var _ca=this._postBackReference.replace("arguments",_c9);
eval(_ca);
},_isItemVisible:function(_cb){
var _cc=$telerik.getContentSize(this._clipElement);
var _cd=$telerik.getLocation(this._clipElement);
_cc.x=_cd.x;
_cc.y=_cd.y;
var _ce=$telerik.getOuterSize(_cb.get_element());
var _cd=$telerik.getLocation(_cb.get_element());
_ce.x=_cd.x;
_ce.y=_cd.y;
var eiv=($telerik.containsPoint(_cc,_ce.x,_ce.y)&&$telerik.containsPoint(_cc,_ce.x+_ce.width,_ce.y+_ce.height));
var vie=($telerik.containsPoint(_ce,_cc.x,_cc.y)&&$telerik.containsPoint(_ce,_cc.x+_cc.width,_cc.y+_cc.height));
return eiv||vie;
},_fireTickersForItem:function(_d1){
var _d2=_d1.get_tickers();
for(var i=0,len=_d2.length;i<len;i++){
if(_d2[i]){
var _d5=$find(_d2[i]);
if(_d5){
_d5.startTicker();
}
}
}
},_resetTickersForItem:function(_d6){
var _d7=_d6.get_tickers();
for(var i=0,len=_d7.length;i<len;i++){
if(_d7[i]){
var _da=$find(_d7[i]);
if(_da){
_da.resetTicker();
}
}
}
},_getItemFromEvent:function(_db){
var _dc=this.get_containerElement();
var _dd=null;
while(null!=_db&&_db!=_dc){
if(_db.tagName.toLowerCase()=="li"&&null!=_db._item&&Object.getTypeName(_db._item)=="Telerik.Web.UI.RadRotatorItem"){
_dd=_db._item;
}
_db=_db.parentNode;
}
return _dd;
},_initializeWebServiceLoader:function(){
this._webServiceLoader=new Telerik.Web.UI.WebServiceLoader(this.get_webServiceSettings());
this._webServiceLoader.add_loadingStarted(Function.createDelegate(this,this._onItemLoadingStarted));
this._webServiceLoader.add_loadingSuccess(Function.createDelegate(this,this._onItemLoadingSuccess));
this._webServiceLoader.add_loadingError(Function.createDelegate(this,this._onItemLoadingError));
},_loadChildrenFromWebService:function(_de,_df){
if(!this._webServiceLoader){
this._initializeWebServiceLoader();
}
var _e0={itemIndex:_de,itemCount:_df};
this._webServiceLoader.loadData(_e0,_e0);
},_onItemLoadingStarted:function(_e1,_e2){
},_onItemLoadingSuccess:function(_e3,_e4){
var _e5=_e4.get_data();
if(_e5&&_e5.length>0){
for(var i=0;i<_e5.length;i++){
this.createRotatorItem(_e5[i]);
}
}
},_onItemLoadingError:function(_e7,_e8){
var _e9=_e8.get_message();
alert(_e9);
},createRotatorItem:function(_ea){
var _eb=this.get_containerElement();
var _ec=_eb.ownerDocument.createElement("li");
_eb.appendChild(_ec);
_ec.innerHTML=_ea.Html;
var _ed={cssClass:_ea.CssClass,visible:_ea.Visible};
var _ee=$create(Telerik.Web.UI.RadRotatorItem,_ed,null,null,_ec);
_ec._item=_ee;
Array.add(this.get_items(),_ee);
},_getInvisibleParent:function(){
var _ef=this.get_element();
while(_ef&&_ef!=document){
if("none"==$telerik.getCurrentStyle(_ef,"display","")){
return _ef;
}
_ef=_ef.parentNode;
}
return null;
},isVisible:function(){
return (this._getInvisibleParent()==null);
},_fixVisibilityProblems:function(_f0){
if(_f0){
var _f1=this._getInvisibleParent();
if(_f1){
this._onParentVisibilityChangeDelegate=Function.createDelegate(this,this._onParentVisibilityChange);
this._invisibleParent=_f1;
if($telerik.isIE){
$addHandler(this._invisibleParent,"propertychange",this._onParentVisibilityChangeDelegate);
}else{
this._invisibleParent.addEventListener("DOMAttrModified",this._onParentVisibilityChangeDelegate,false);
}
}
}else{
if(this._invisibleParent&&this._onParentVisibilityChangeDelegate){
if($telerik.isIE){
$removeHandler(this._invisibleParent,"propertychange",this._onParentVisibilityChangeDelegate);
}else{
this._invisibleParent.removeEventListener("DOMAttrModified",this._onParentVisibilityChangeDelegate,false);
}
this._onParentVisibilityChangeDelegate=null;
this._invisibleParent=null;
}
}
},_onParentVisibilityChange:function(e){
if($telerik.isIE){
var e=e.rawEvent;
if(!e){
return;
}
if(e.propertyName=="style.display"||e.propertyName=="className"){
var _f3=$telerik.getCurrentStyle(this._invisibleParent,"display");
if(_f3!="none"){
this.repaint();
}
}
}else{
if(e.attrName=="style"||e.attrName=="class"){
var _f4=e.target;
if((e.currentTarget==e.originalTarget)&&"none"!=$telerik.getCurrentStyle(_f4,"display")){
window.setTimeout(Function.createDelegate(this,function(){
this.repaint();
}),0);
}
}
}
this._fixVisibilityProblems(false);
},repaint:function(){
this._createUI();
},add_itemClicking:function(_f5){
this.get_events().addHandler("itemClicking",_f5);
},remove_itemClicking:function(_f6){
this.get_events().removeHandler("itemClicking",_f6);
},add_itemClicked:function(_f7){
this.get_events().addHandler("itemClicked",_f7);
},remove_itemClicked:function(_f8){
this.get_events().removeHandler("itemClicked",_f8);
},add_mouseOver:function(_f9){
this.get_events().addHandler("mouseOver",_f9);
},remove_mouseOver:function(_fa){
this.get_events().removeHandler("mouseOver",_fa);
},add_mouseOut:function(_fb){
this.get_events().addHandler("mouseOut",_fb);
},remove_mouseOut:function(_fc){
this.get_events().removeHandler("mouseOut",_fc);
},add_itemShowing:function(_fd){
this.get_events().addHandler("itemShowing",_fd);
},remove_itemShowing:function(_fe){
this.get_events().removeHandler("itemShowing",_fe);
},add_itemShown:function(_ff){
this.get_events().addHandler("itemShown",_ff);
},remove_itemShown:function(_100){
this.get_events().removeHandler("itemShown",_100);
},add_load:function(_101){
this.get_events().addHandler("load",_101);
},remove_load:function(_102){
this.get_events().removeHandler("load",_102);
},add_buttonOver:function(_103){
this.get_events().addHandler("buttonOver",_103);
},remove_buttonOver:function(_104){
this.get_events().removeHandler("buttonOver",_104);
},add_buttonOut:function(_105){
this.get_events().addHandler("buttonOut",_105);
},remove_buttonOut:function(_106){
this.get_events().removeHandler("buttonOut",_106);
},add_buttonClick:function(_107){
this.get_events().addHandler("buttonClick",_107);
},remove_buttonClick:function(_108){
this.get_events().removeHandler("buttonClick",_108);
},get_items:function(){
return this._items;
},set_items:function(_109){
this._items=_109;
},get_webServiceSettings:function(){
return this._webServiceSettings;
},set_webServiceSettings:function(_10a){
var _10b=Sys.Serialization.JavaScriptSerializer.deserialize(_10a);
this._webServiceSettings=new Telerik.Web.UI.WebServiceSettings(_10b);
},get_skin:function(){
return this._skin;
},set_skin:function(_10c){
this._skin=_10c;
}};
Telerik.Web.UI.RadRotator.registerClass("Telerik.Web.UI.RadRotator",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.RadRotatorEventArgs=function(item){
Telerik.Web.UI.RadRotatorEventArgs.initializeBase(this);
this._item=item;
};
Telerik.Web.UI.RadRotatorEventArgs.prototype={get_item:function(){
return this._item;
}};
Telerik.Web.UI.RadRotatorEventArgs.registerClass("Telerik.Web.UI.RadRotatorEventArgs",Sys.EventArgs);
Telerik.Web.UI.RadRotatorCancelEventArgs=function(item){
Telerik.Web.UI.RadRotatorCancelEventArgs.initializeBase(this);
this._item=item;
};
Telerik.Web.UI.RadRotatorCancelEventArgs.prototype={get_item:function(){
return this._item;
}};
Telerik.Web.UI.RadRotatorCancelEventArgs.registerClass("Telerik.Web.UI.RadRotatorCancelEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadRotatorButtonEventArgs=function(_10f){
Telerik.Web.UI.RadRotatorButtonEventArgs.initializeBase(this);
this._button=_10f;
};
Telerik.Web.UI.RadRotatorButtonEventArgs.prototype={get_button:function(){
return this._button;
}};
Telerik.Web.UI.RadRotatorButtonEventArgs.registerClass("Telerik.Web.UI.RadRotatorButtonEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.RadRotatorItem=function(_110){
Telerik.Web.UI.RadRotatorItem.initializeBase(this,[_110]);
this._visible=null;
this._cssClass=null;
this._index=-1;
};
Telerik.Web.UI.RadRotatorItem.prototype={initialize:function(){
Telerik.Web.UI.RadRotatorItem.callBaseMethod(this,"initialize");
this._tickers=null;
},dispose:function(){
Telerik.Web.UI.RadRotatorItem.callBaseMethod(this,"dispose");
},get_index:function(){
if(this._index==-1){
var _111=0;
var _112=this.get_element();
var _113=_112.parentNode;
if(null!=_113){
var _114=$telerik.getChildrenByTagName(_113,"li");
if(null!=_114){
for(_111=0;_111<_114.length&&_114[_111]!=_112;_111++){
}
if(_111==_114.length){
_111=0;
}
}
}
this._index=_111;
}
return this._index;
},get_visible:function(){
return this._visible;
},set_visible:function(_115){
this._visible=_115;
},get_cssClass:function(){
return this._cssClass;
},set_cssClass:function(_116){
this._cssClass=_116;
},get_tickers:function(){
if(null==this._tickers&&typeof (Telerik.Web.UI.RadTicker)!="undefined"){
this._tickers=[];
for(var i=0,_118=$telerik.radControls.length;i<_118;i++){
var _119=$telerik.radControls[i];
if(Telerik.Web.UI.RadTicker.isInstanceOfType(_119)&&$telerik.isDescendant(this.get_element(),_119.get_element())){
Array.add(this._tickers,_119.get_id());
}
}
}
return this._tickers;
}};
Telerik.Web.UI.RadRotatorItem.registerClass("Telerik.Web.UI.RadRotatorItem",Sys.UI.Control);
Telerik.Web.UI.RotatorScrollDirection=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.RotatorScrollDirection.prototype={Left:1,Right:2,Up:4,Down:8};
Telerik.Web.UI.RotatorScrollDirection.registerEnum("Telerik.Web.UI.RotatorScrollDirection",false);
Telerik.Web.UI.RotatorAnimationType=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.RotatorAnimationType.prototype={None:1,Fade:2,Pulse:3};
Telerik.Web.UI.RotatorAnimationType.registerEnum("Telerik.Web.UI.RotatorAnimationType",false);
Telerik.Web.UI.RotatorType=function(){
throw Error.invalidOperation();
};
Telerik.Web.UI.RotatorType.prototype={AutomaticAdvance:1,ButtonsOver:2,Buttons:3,SlideShow:4,SlideShowButtons:5,FromCode:6};
Telerik.Web.UI.RotatorType.registerEnum("Telerik.Web.UI.RotatorType",false);


if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();