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