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