(function(a,D){Type.registerNamespace("Telerik.Web.UI"); var b=Telerik.Web.UI; var l=b.EventType; var m=window; var j=m.document; var c=m.$telerik; var w=m.Math; var A=a.proxy; var k=""; var z="px"; var B=".telerikRotator"; var g=Function.createDelegate; c.toRotator=function(E){return E; }; c.findRotator=$find; a.registerEnum(b,"RotatorScrollDirection",{Left:1,Right:2,Up:4,Down:8}); a.registerEnum(b,"RotatorAnimationType",{None:1,Fade:2,Pulse:3,CrossFade:4}); a.registerEnum(b,"RotatorType",{AutomaticAdvance:1,ButtonsOver:2,Buttons:3,SlideShow:4,SlideShowButtons:5,FromCode:6,Carousel:7,CarouselButtons:8,CoverFlow:9,CoverFlowButtons:10}); b.RadRotator=function(E){var F=this; b.RadRotator.initializeBase(F,[E]); F._enabled=true; F._postBackReference=null; F._webServiceSettings=new b.WebServiceSettings({}); F._webServiceLoader=null; F._containerElement=null; F._clickDelegate=null; F._mouseOutDelegate=null; F._mouseOverDelegate=null; F._itemShownDelegate=null; F._rotatorDisposed=false; F._scrollDuration=500; F._canPause=true; F._domScrollSpeed=0.6; F._itemWidth=null; F._itemHeight=null; F._isLODEnabled=null; F._lastLODRequestPassed=false; F._firstLODRequestPassed=false; F._noActiveLODRequest=true; F._relativeWrapper=null; F._clipElement=null; F._itemsElement=null; F._loadingSign=null; F._rightButton=null; F._leftButton=null; F._downButton=null; F._upButton=null; F._firstItem=null; F._imageItems=[]; F._initialAngle=(w.PI/2); F._carouselAnimationAngle=F._initialAngle; F._coverFlowAnimationIndex=-1; F._pendingImage=null; F._imageOnLoadDelegate=null; F._automaticAdvanceStarted=false; F._nextItemIndex=-1; F._persistedItemIndex=-1; F._isMouseOverClipElement=false; F._clientDataSourceID=k; F._clientTemplate=k; F._clientDataSource=null; F._dataSource=null; F._ieTouchActionManager=new b.Helpers.IETouchActionManager(); F._dragHandler=A(F._onDrag,F); F._dragEndHandler=A(F._onDragEnd,F); }; b.RadRotator.prototype={initialize:function(){b.RadRotator.callBaseMethod(this,"initialize"); this._rotatorDisposed=false; this._isLODEnabled=!this.isCarousel()&&!this.isCoverFlow()&&this.get_webServiceSettings().get_method(); this._setChildElements(); this._createUI(); var E=this.get_initialItemIndex(); if(this._isLODEnabled){this._enableDisableAllButtonsUnconditionally(false); this._loadChildrenFromWebService(E); }else{this._createChildItems(); this._initialItemSet=false; this._loadInitialFrame(); this._enableDisableButtons(); }this._attachEventHandlers(true); this.add_parentShown(this.get_element()); if(c.isSafari){this._mouseWheelDelegate=g(this,this._mouseWheelHandler); $addHandler(this._relativeWrapper,"mousewheel",this._mouseWheelDelegate); }this.raiseEvent("load",Sys.EventArgs.Empty); if(!this._isLODEnabled){this._startAutomaticAdvance(); }this._itemShownHandler(); if(this._persistedItemIndex!=-1){this.set_currentItemIndex(this._persistedItemIndex); }if(this.get_enableDragScrolling()&&c.isTouchDevice&&Telerik.Web.Browser.scrollBarWidth==0){Sys.UI.DomElement.addCssClass(this.get_element(),"rrTouchEnabled"); }},dispose:function(){var E=this; if(this._imageOnLoadDelegate&&this._pendingImage){c.removeExternalHandler(this._pendingImage,"load",this._imageOnLoadDelegate); this._pendingImage=null; this._imageOnLoadDelegate=null; }this._firstItem=null; this._previousCrossFadeItems=this._currentCrossFadeItems=null; this._rotatorDisposed=true; this._attachEventHandlers(false); this._containerElement=null; if(this._animation){if(this._animation.dispose){this._animation.dispose(); }this._animation=null; }this._imageItems=null; b.RadRotatorAnimation._removeScrollAnimation(this.get_id()); 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(c.isSafari){if(this._mouseWheelDelegate&&this._relativeWrapper){$removeHandler(this._relativeWrapper,"mousewheel",this._mouseWheelDelegate); }}if(this._itemsElement){$clearHandlers(this._itemsElement); }E._ieTouchActionManager.dispose(); b.RadRotator.callBaseMethod(this,"dispose"); },saveClientState:function(){return this.get_persistCurrentItemOnPostBack()?'{"currentItemIndex":'+this.get_currentItemIndex()+"}":null; },get_currentItemIndex:function(){var E=this.get_currentItem(); return E?E.get_index():-1; },_createChildItems:function(){var G=this; var E=c.getChildrenByTagName(G.get_containerElement(),"li"); for(var F=0; FG.length-1){E=0; }}}if(E>=0&&E=0&&E0&&H>0){H=K-H; }H%=K; }else{H=F.get_index(); }}}else{var M=parseInt(L[0].parentNode.style.left,10),G="left"; if(isNaN(M)||M==0){M=parseInt(L[0].parentNode.style.top,10); G="top"; }while(++H=Q.length){return; }var R=Q[L]; if(!R){return; }var M=this.isCarousel(); var N=this.isCoverFlow(); if(E&&(M||N)){var F=this._animation; if(F&&this.get_pauseOnMouseOver()){F._isPaused=false; F._isPlaying=true; F._getAnimationQuery().filter("[paused='true']").removeAttr("paused").removeAttr("elapsedTime"); F.stop(); }this._nextItemIndex=L; this.scrollItem(); this._nextItemIndex=-1; }else{if(M){this._changeCarouselAngleByIndex(L); if(!this._animation){this.set_currentItemIndex(L,true); }}else{if(N){this._changeCoverFlowIndexByIndex(L); if(!this._animation){this.set_currentItemIndex(L,true); }}else{var S=R.get_element(); var W=this.get_wrapFrames(); if(W){var U=this.getItemHtmlElements(); for(var K=0,T=U.length; K0){this._shiftItemInList(); }}},_changeCarouselAngleByIndex:function(K,I,R,J){var H=this._imageItems; var M=H.length; if(M<1){return; }if(K<0){K=0; }else{if(K>(M-1)){K%=M; }}var O=(w.PI*2)/M; var L=I?a(H[0].element).attr("telerikCarouselAngle"):null; var E=((typeof(L)!="undefined"&&L!=null)?L:this._initialAngle)-K*O; if(E.toString().indexOf("e")>-1){E=(w.round(E*10000)/10000); }var F=this._animation; if(F){F.set_angle(E); }else{this._carouselAnimationAngle=E; }var G=b.RadRotatorAnimation.get_scrollAnimationProperties(this.get_id()); var Q=/^([\d+-.]+)(.*)$/; var P=!a.support.opacity&&(G&&G.opacity!=null); var N=this._getScrollAnimationOptions(R,J); a.each(H,function(U,ab){var Z=this; var Y=w.sin(E); var V=N.minScale; var X=V+(Y+1)*((1-V)/2); var ac=N.xO+(((w.cos(E+w.PI)*N.xR)-Z.outerWidth/2)*X); var ad=N.yO+((Y*N.yR)*X); var S=a.extend({},G); if(G){a.each(S,function(ae,ag){var af=Q.exec(ag); S[ae]=af?(af[1]*X+af[2]):ag; }); }var T=this.element; T.telerikCarouselAngle=E; var aa="px"; var W=a.extend(S,{width:Z.width*X+aa,height:Z.height*X*(P&&this.reflection?2:1)+aa,position:"absolute",left:ac+aa,top:ad+aa,zIndex:parseInt(X*100,10)}); a(T).css("display","none").css(W).css("display",""); E+=O; if(E.toString().indexOf("e")>-1){E=(w.round(E*10000)/10000); }}); },_getTransformProperty:function(){var E="transform"; if(c.isIE9Mode){E="msTransform"; }else{if(c.isIE){E="filter"; }else{if(c.isFirefox){E="MozTransform"; }else{if(c.isSafari){E="WebkitTransform"; }else{if(c.isOpera){E="OTransform"; }}}}}return E; },_changeCoverFlowIndexByIndex:function(J,S,I){var H=this._imageItems; var L=H.length; if(L<1){return; }if(J<0){J=0; }else{if(J>(L-1)){J%=L; }}var E=this._animation; if(E){E.set_index(J); }else{this._coverFlowAnimationIndex=J; }var G=b.RadRotatorAnimation.get_scrollAnimationProperties(this.get_id()); var R=/^([\d+-.]+)(.*)$/; var M=this._getScrollAnimationOptions(S,I); var K=this.isVertical(); var N=H[J]; var O={top:M.yO-N.outerHeight/2,right:M.xO+N.outerWidth/2,bottom:M.yO+N.outerHeight/2,left:M.xO-N.outerWidth/2}; var F=M.matrix; if(F.m11==1&&F.m22==1&&F.m12==0&&F.m21==0){F=null; }var Q=this._getTransformProperty(); var P=("filter"==Q)&&F; a.each(H,function(Z,am){var af=this; var T=(Z-J); var Y=(T==0); var ae=Y?1:M.minScale; var X=(T>0); var an=K?(M.xO+af.outerWidth/2-af.outerWidth*ae):(O[X?"right":"left"]); var ao=K?(O[X?"bottom":"top"]):(M.yO+af.outerHeight/2-af.outerHeight*ae); var ac=T; if(ac>0){if(K){ao+=M.yR+(--ac*M.yItemSpacing); }else{an+=M.xR+(--ac*M.xItemSpacing); }}else{if(ac<0){if(K){ao+=-(M.yR+af.outerHeight*ae)+(++ac*M.yItemSpacing); }else{an+=-(M.xR+af.outerWidth*ae)+(++ac*M.xItemSpacing); }}else{an+=M.selectedItemOffsetX; ao+=M.selectedItemOffsetY; }}var U=a.extend({},G); if(G&&!Y){a.each(U,function(ap,ar){var aq=R.exec(ar); U[ap]=aq?(aq[1]*ae+aq[2]):ar; }); }var al="px"; var ad=a.extend(U,{width:af.width*ae+al,height:af.height*ae*(P&&this.reflection?2:1)+al,position:"absolute",zIndex:((L-w.abs(T))*100)}); var ah=0; var aj=0; if(F){var aa=a.extend({},F); var ab=Y?0:(T<0?-1:1); aa.m12*=ab; aa.m21*=ab; if(Y){aa.m11=aa.m22=1; }var W=("filter"==Q); var ag="matrix("+aa.m11+", "+aa.m21+", "+aa.m12+", "+aa.m22+", 0, 0)"; if(W){ag="progid:DXImageTransform.Microsoft.Matrix(FilterType='bilinear',M11="+aa.m11+", M12="+aa.m12+", M21="+aa.m21+", M22="+aa.m22+",sizingMethod='auto expand')"; }ad[Q]=ag; var ai=w.abs(aa.m11)+w.abs(aa.m12); var ak=w.abs(aa.m21)+w.abs(aa.m22); if(!K){ah=ab*((1-ai)/2); }else{aj=ab*((1-ak)/2); }if(W&&!Y){ah+=(ai-1)/2; aj+=(ak-1)/2; if(F.m12&&this.reflection){ah*=2; }}}ad.left=an-ah*ae*af.outerWidth+al; ad.top=ao-aj*ae*af.outerHeight+al; var V=this.element; V.telerikCoverFlowIndex=T; a(V).css("display","none").css(ad).css("display",""); }); },_needsShift:function(H){if(null==H){H=this.get_animationDirection(); }var K=this._itemsElement; var N=this._clipElement; var L=parseInt(K.style.left,10); var M=parseInt(K.style.top,10); var J=c.getOuterSize(K); var O=c.getContentSize(N); var F=this.get_firstItem(); if(!F){return false; }var G=c.getOuterSize(F); var E=false; var I=b.RotatorScrollDirection; switch(H){case I.Left:E=L+J.width1)?0.5:H.minScale; H.reflectionHeight=isNaN(H.reflectionHeight)?0:H.reflectionHeight; H.reflectionOpacity=isNaN(H.reflectionOpacity)?1:H.reflectionOpacity; H.xO=isNaN(H.xO)?parseInt(J/2,10):H.xO; if(this.isCarousel()){H.xR=isNaN(H.xR)?parseInt(J/2.3,10):H.xR; H.yR=isNaN(H.yR)?parseInt(I/6,10):H.yR; H.yO=isNaN(H.yO)?parseInt(H.minScale*((I-(1-H.minScale)*H.yR)/2),10):H.yO; H.matrix=null; }else{if(this.isCoverFlow()){var G=this.isVertical(); H.xR=isNaN(H.xR)?(G?0:15):H.xR; H.yR=isNaN(H.yR)?(G?15:0):H.yR; H.yO=isNaN(H.yO)?parseInt(I/2,10):H.yO; H.xItemSpacing=isNaN(H.xItemSpacing)?(G?0:100):H.xItemSpacing; H.yItemSpacing=isNaN(H.yItemSpacing)?(G?100:0):H.yItemSpacing; H.selectedItemOffsetX=isNaN(H.selectedItemOffsetX)?0:H.selectedItemOffsetX; H.selectedItemOffsetY=isNaN(H.selectedItemOffsetY)?0:H.selectedItemOffsetY; H.matrix.m11=isNaN(H.matrix.m11)?1:H.matrix.m11; H.matrix.m12=isNaN(H.matrix.m12)?0:H.matrix.m12; H.matrix.m21=isNaN(H.matrix.m21)?0:H.matrix.m21; H.matrix.m22=isNaN(H.matrix.m22)?1:H.matrix.m22; H.coverFlowDirection=isNaN(H.coverFlowDirection)?1:(H.coverFlowDirection<0?-1:1); }}return H; },scrollViewport:function(){if(!this.get_enabled()){return; }var E=this._itemsElement; if(!this._animation){var F=this._getMoveAnimation(); this._initItemAnimation=g(this,function(){if(this.get_wrapFrames()&&!this._hasViewportWidth()){if(!this._isLODEnabled||this._noActiveLODRequest){var L=this.getItemHtmlElements().length; for(var I=0; I=G.length){return 0; }var F=c.getOuterSize(G[E])[H]; if(!F&&this._isLODEnabled){F=this.get_vertical()?parseInt(this._itemHeight,10):parseInt(this._itemWidth,10); }var I=parseInt(c.getContentSize(this._clipElement)[H]/F,10); return I; },_initCrossFadeItemAnimation:function(){var E=this.get_slideShowAnimationSettings().type||b.RotatorAnimationType.None; if(b.RotatorAnimationType.CrossFade==E){var L=this._itemsElement; var K=(-1)*parseInt(L.style.top,10)+"px"; var I=(-1)*parseInt(L.style.left,10)+"px"; var M=this.getItemHtmlElements(); var F=this._getCurrentItemIndex(); if(F>=M.length){return; }var P=this._getVarSizeAttribute(); var J=c.getOuterSize(M[F])[P]; var Q=this._getVisibleItemsCount(); var N=F+(this.isScrollingForward()?1:-1)*Q; if(N>=0&&N0){this._setAnimationTimeout(this.get_frameDuration()); }else{this._animation.play(); }}})}); }this._animation.stop(); this._animation.play(); },_scrollImageItem:function(){var E=this.isCarousel(); var F=this.isCoverFlow(); if(!this._animation){var G=this._imageItems.length; if(G<1){return; }this._animation=this._getMoveAnimation(); this._initializeAnimationHandlers({started:g(this,function(J,H){var I=this._getNextItemToShow(); if(!I){H.set_cancel(true); return false; }var K=new b.RotatorCancelEventArgs(I.control); this.raiseEvent("itemShowing",K); if(K.get_cancel&&K.get_cancel()){H.set_cancel(true); return false; }this._initItemAnimation(); }),ended:g(this,function(){var H=this._itemsElement; if(!H||!H.parentNode){return; }if(a(H).children("li:animated").length>1){return; }if(F){this._enableDisableButtons(); }var I=this.get_currentItem(); if(I!=null){this.raiseEvent("itemShown",new b.RotatorEventArgs(I)); }if(this.isAutomaticAdvance()){if(this.get_frameDuration()>0){this._setAnimationTimeout(this.get_frameDuration()); }else{this._animation.play(); }}this.updateClientState(); })}); this._initItemAnimation=g(this,function(){var J=this._getCurrentItemIndex(true); var P=this._getNextItemToShow().control.get_index(); var H=J-P; if(E){H=w.abs(H); if(H>w.floor(G/2)){H=w.abs(G-H); }var L=(J+w.floor(G/2))%G; if(P<=L&&P<=J){P+=G; }if(L=P&&P>=J){H*=(-1); }var N=this.getItemHtmlElements(); var S=(N.length>0)?((w.PI*2)/N.length):0; H*=S; var I=this._animation.get_angle()+H; var M=this._initialAngle; var R=w.PI*2+S; if(w.round((I-(M+R))/S)==0||w.round((I-(M-R))/S)==0){var Q=P!=1?(P-G)*S:0; I=M+H+Q; }if(I.toString().indexOf("e")>-1){I=(w.round(I*10000)/10000); }var K=I-H; a(N).each(function(U,T){if(K.toString().indexOf("e")>-1){K=(w.round(K*10000)/10000); }T.telerikCarouselAngle=K; K+=S; }); this._animation.set_angle(I); }else{var O=this._animation.get_index()-this._getScrollAnimationOptions().coverFlowDirection*H; this._animation.set_index(O); }}); }this._animation.stop(); this._animation.play(); },_checkItemsSize:function(){var H=c.getOuterSize(this._itemsElement); var E=this.get_vertical(); var F=(E)?H.height:H.width; var G=(E)?this.get_height():this.get_width(); return parseInt(F,10)>parseInt(G,10); },_shiftItemInList:function(){var O=(this._initialItemSet&&this.get_enableRandomOrder()); var K=this._itemsElement; var J=this.getItemHtmlElements(); var H=this.get_vertical(); var G=this.isScrollingForward(); var E=parseInt(K.style.left,10); var F=parseInt(K.style.top,10); var L=0; if(O){var P=this._getVisibleItemsCount(); var N=w.ceil(w.random()*(J.length-P))-1; L=G?N:N+P; }else{L=G?0:J.length-1; }var M=J[L]; var I=c.getOuterSize(M); M.parentNode.removeChild(M); if(!G){K.insertBefore(M,K.firstChild); }if(H){K.style.top=(F+(G?I.height:-I.height))+"px"; }else{K.style.left=(E+(G?I.width:-I.width))+"px"; }if(G){K.appendChild(M); }return M; },_shuffleFrames:function(){if(!this._canShuffle()){return; }var E=this._getShuffledArray(a.makeArray(this.getItemHtmlElements())); while(E.length){this._itemsElement.appendChild(E.pop()); }},_getShuffledArray:function(E){var F=[]; while(E.length){F.push(this._extractRandomFromArray(E)); }return F; },_extractRandomFromArray:function(E){return E.splice(w.random()*E.length,1)[0]; },_canShuffle:function(){return !this._initialItemSet&&this.get_enableRandomOrder(); },_loadInitialFrame:function(){var G=this.get_initialItemIndex(); if(!this.isCarousel()&&!this.isCoverFlow()){this._shuffleFrames(); var E=this.get_defaultAnimationDirection(); var F=b.RotatorScrollDirection; var H=this.isVertical(); var J=this._itemsElement; var K=c.getOuterSize(J); var L=c.getContentSize(this._clipElement); var M=0; var N=0; G=this.get_initialItemIndex(); if(G>=0){if(H){N=(E==F.Up)?0:-K.height+L.height; }else{M=(E==F.Left)?0:-K.width+L.width; }}else{if(G==-1){if(H){N=(E==F.Down)?-K.height:L.height; }else{M=(E==F.Right)?-K.width:L.width; }}}J.style.left=M+"px"; J.style.top=N+"px"; if(G>0&&!this._initialItemSet){for(var I=0; I=0){this.raiseEvent("itemShown",new b.RotatorEventArgs(this.get_items()[G])); }this._initialItemSet=true; },_setImageItems:function(){if(this._imageItems.length>0){return; }var G={}; if(this._itemWidth){G.width=parseInt(this._itemWidth,10); }if(this._itemHeight){G.height=parseInt(this._itemHeight,10); }var F=(G.width&&G.height); var E=[]; a(this.getItemHtmlElements()).each(function(I,J){var N=a.extend({},G); if(!F){var M=a(J).css("float","left"); N=a.extend(c.getContentSize(J),N); M.css("float",""); }var H=c.getBorderBox(J); var L=c.getPaddingBox(J); var K=c.getMarginBox(J); H.horizontal+=L.horizontal+K.horizontal; H.vertical+=L.vertical+K.vertical; E[I]=a.extend(N,{element:J,outerWidth:(N.width+H.horizontal),outerHeight:(N.height+H.vertical)}); }); this._imageItems=E; },stop:function(){this._clearAnimationTimeout(); this._canPause=false; this.pause(); },pause:function(){if(this._isPaused){return; }this._isPaused=true; if(this._animation&&this._animation.get_isActive()){this._animation.pause(); }},start:function(){this._canPause=true; this._isPaused=false; this.resume(); },resume:function(){var E=this._animation; if(!E||!E._isPlaying){if(this._timeoutPassed||!this._isPaused){if(E){E.play(this._timeoutPassed); }}else{if(this._isPaused){if(E&&E.get_isActive()){E.play(); }}}}this._isPaused=false; },isViewportScrollMode:function(){var E=b.RotatorType; if(this._isRotatorTypeEnabled(E.AutomaticAdvance)||this._isRotatorTypeEnabled(E.ButtonsOver)||this._isRotatorTypeEnabled(E.FromCode)||this._isRotatorTypeEnabled(E.Carousel)||this._isRotatorTypeEnabled(E.CarouselButtons)||this._isRotatorTypeEnabled(E.CoverFlow)||this._isRotatorTypeEnabled(E.CoverFlowButtons)){return false; }return true; },_getButtonScrollDirection:function(E){var F=b.RotatorScrollDirection; var G=F.Left; switch(E){case this._rightButton:G=F.Left; break; case this._leftButton:G=F.Right; break; case this._downButton:G=F.Up; break; case this._upButton:G=F.Down; break; }return G; },_buttonClicked:function(H){if(!this.get_enabled()){c.cancelRawEvent(H); return false; }this._raiseItemClickedFlags(); var E=this._animation; if(E&&E.get_isPlaying()){E.stop(); }var G=H.target; var I=G.parentNode; if(I&&Sys.UI.DomElement.containsCssClass(I,"RadButton")){G=I; }if(this._isButtonDisabled(G)||this.get_items().length==0){return; }var F=new b.RotatorButtonEventArgs(G); this.raiseEvent("buttonClick",F); if(F.get_cancel()){return; }var J=this._getButtonScrollDirection(G); this.set_animationDirection(J); if(this.isCarousel()||this.isCoverFlow()){this.scrollItem(); }else{this.scrollViewport(); }return c.cancelRawEvent(H); },_buttonOver:function(G){if(!this.get_enabled()){c.cancelRawEvent(G); return false; }var F=G.target; if(this._isButtonDisabled(F)||this.get_items().length==0){return; }var E=new b.RotatorButtonEventArgs(F); this.raiseEvent("buttonOver",E); if(E.get_cancel()){return; }var H=this._getButtonScrollDirection(F); this.set_animationDirection(H); this._stopAnimationButtonOver=false; this.scrollItem(); return c.cancelRawEvent(G); },_buttonOut:function(G){if(!this.get_enabled()){c.cancelRawEvent(G); return false; }var F=G.target; if(this._isButtonDisabled(F)){return; }var E=new b.RotatorButtonEventArgs(F); this.raiseEvent("buttonOut",E); if(E.get_cancel()){return; }var H=this._getButtonScrollDirection(F); this.set_animationDirection(H); this._stopAnimationButtonOver=true; return c.cancelRawEvent(G); },_initializeButtonsRotatorType:function(){this._rightButton=c.getElementByClassName(this._rootElement,this._rotatorRightClass); this._leftButton=c.getElementByClassName(this._rootElement,this._rotatorLeftClass); this._downButton=c.getElementByClassName(this._rootElement,this._rotatorDownClass); this._upButton=c.getElementByClassName(this._rootElement,this._rotatorUpClass); var J=this.get_controlButtons(),I=this._clipElement,N=b.RotatorScrollDirection,M=[N.Right,N.Left,N.Down,N.Up],F=[this._leftButton,this._rightButton,this._upButton,this._downButton],L=[J.LeftButtonID?$get(J.LeftButtonID):null,J.RightButtonID?$get(J.RightButtonID):null,J.UpButtonID?$get(J.UpButtonID):null,J.DownButtonID?$get(J.DownButtonID):null],K=[this._rotatorLeftClass,this._rotatorRightClass,this._rotatorUpClass,this._rotatorDownClass],R=["marginLeft","marginRight","marginTop","marginBottom"],S=["width","width","height","height"]; for(var P=0; P1){return; }this._canPause=true; if(E!=b.RotatorAnimationType.None){if(J){a(this.getItemHtmlElements()).css({position:"",visibility:""}); a(H).css("visibility","visible"); }else{a(H).css("opacity","1"); }}var K=this.get_currentItem(); this.raiseEvent("itemShown",new b.RotatorEventArgs(K)); if(!this.get_pauseOnMouseOver()||(!this._isMouseOverClipElement)){if(this.isAutomaticAdvance()){var I=this.get_frameDuration(); if(I>=0){this._setAnimationTimeout(I); }}}}); switch(E){case b.RotatorAnimationType.Fade:this._canPause=false; a(H).css("opacity","0").fadeTo(F,1,G); break; case b.RotatorAnimationType.Pulse:this._canPause=false; a(H).fadeTo(F,0).fadeTo(F,1,G); break; case b.RotatorAnimationType.CrossFade:this._canPause=false; this._runCrossFadeSlideShowAnimation(F,G); break; default:G(); break; }},_runCrossFadeSlideShowAnimation:function(G,H){var M=this._itemsElement; var L=(-1)*parseInt(M.style.top,10)+"px"; var J=(-1)*parseInt(M.style.left,10)+"px"; var N=this.getItemHtmlElements(); var E=this._getCurrentItemIndex(); if(E>=N.length){return; }var Q=this._getVarSizeAttribute(); var K=c.getOuterSize(N[E])[Q]; var R=parseInt(c.getContentSize(this._clipElement)[Q]/K,10); var O=E-(this.isScrollingForward()?1:-1)*R; if(O>=0&&O0; }else{if((J&&F==1)||(K&&F==-1)){E=GQ.width; }else{if(H==I.Up){E=(L.height+O)>Q.height; }else{if(H==I.Right){E=(N<0); }else{if(H==I.Down){E=(O<0); }}}}}return E; },_getCalculatedAnimationDirection:function(){var E=this.get_animationDirection(); var G=b.RotatorScrollDirection; var F=23; switch(E){case G.Left:F=21; break; case G.Down:F=32; break; case G.Up:F=12; break; default:F=23; }return F; },startAutoPlay:function(){if(this._rotatorDisposed){return; }this._loadInitialFrame(); this._startAutoPlayItems(); },_startAutoPlayItems:function(){if(this._rotatorDisposed){return; }if((this.isCarousel()||this.isCoverFlow())&&!this._automaticAdvanceStarted){this._automaticAdvanceStarted=true; return; }this.showNext(this.get_defaultAnimationDirection()); },get_defaultAnimationDirection:function(){var F=b.RotatorScrollDirection; var E=0; if(this._isScrollDirectionEnabled(F.Left)){E=F.Left; }else{if(this._isScrollDirectionEnabled(F.Up)){E=F.Up; }else{if(this._isScrollDirectionEnabled(F.Right)){E=F.Right; }else{if(this._isScrollDirectionEnabled(F.Down)){E=F.Down; }}}}if(!E){E=F.Left; }return E; },get_containerElement:function(){return this._itemsElement; },_setChildElements:function(){this._rotatorListClass="rrItemsList"; this._rotatorListItemClass="rrItem"; 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=c.getElementByClassName(this._rootElement,this._rotatorRelativeWrapperClass); this._clipElement=c.getElementByClassName(this._rootElement,this._rotatorClipRegionClass); this._itemsElement=c.getElementByClassName(this._rootElement,this._rotatorListClass); if(this.get_items().length==0&&this._itemsElement.children.length){this._itemsElement.removeChild(this._itemsElement.firstChild); }this._fixEmptyList(); },_fixEmptyList:function(){var E=this._itemsElement.getElementsByTagName("li"); if(this.get_items().length==0&&E.length==1){this._itemsElement.removeChild(E[0]); }},_createUI:function(){if(!this.isVisible()){return; }var P=this.get_element(),O=this._relativeWrapper,E=this._clipElement,F={top:0,bottom:0,left:0,right:0,horizontal:0,vertical:0},K=this._hasButtons(); if(!P){return; }if(!this._isCreated){var L=true; if(K){L=this._initializeButtonsRotatorType(); }if(L){Sys.UI.DomElement.addCssClass(P,"rrNoBorder"); }F=c.getBorderBox(E); this._fixRootElementSize(); O.style.height=P.offsetHeight+F.vertical+"px"; O.style.width=P.offsetWidth+F.horizontal+"px"; this._isCreated=true; }else{if(K){F=c.getBorderBox(E); }}if(this.get_vertical()){this.set_vertical(true); }O.style.overflow="auto"; E.style.overflow="auto"; var N=this._itemsElement; if(this._isLODEnabled){N.style.width=""; N.style.height=""; }var I=10000,G; try{I=1000+N.offsetWidth*c.getChildrenByTagName(N,"li").length; }catch(J){I=10000; }E.style.width=w.max(I,10000)+"px"; E.style.height="10000px"; var H=c.getMarginBox(E); I=w.max(0,(O.offsetWidth-H.horizontal-F.horizontal))+"px"; G=w.max(0,(O.offsetHeight-H.vertical-F.vertical))+"px"; var M=this.isCarousel()||this.isCoverFlow(); if(M){this._setImageItemsSize(parseInt(I,10),parseInt(G,10),true); }N.style.width=M?I:(this.get_vertical()?O.style.width:N.offsetWidth+"px"); N.style.height=M?G:(N.offsetHeight+"px"); O.style.overflow=""; E.style.width=I; E.style.height=G; E.style.overflow="hidden"; E.style.position="relative"; N.style.position="relative"; P.style.visibility="visible"; this._ensureWrappersPersentWidht(); },_hasButtons:function(){var E=this; return E._isRotatorTypeEnabled(b.RotatorType.Buttons)||E._isRotatorTypeEnabled(b.RotatorType.ButtonsOver)||E._isRotatorTypeEnabled(b.RotatorType.SlideShowButtons)||E._isRotatorTypeEnabled(b.RotatorType.CarouselButtons)||E._isRotatorTypeEnabled(b.RotatorType.CoverFlowButtons); },_ensureWrappersPersentWidht:function(){var E=this; if(E._isWidthInPersent()){E._relativeWrapper.style.width="auto"; E._clipElement.style.width="auto"; }},_isWidthInPersent:function(){return this._element.style.width.indexOf("%")>-1; },_isHeightInPersent:function(){return this._element.style.height.indexOf("%")>-1; },_setImageItemsSize:function(F,E,G){if(this._shouldWaitForImagesToLoad(F,E)){this._waitForImagesToLoad(g(this,function(){this._finishSetImageItemSize(F,E,G); })); }else{this._finishSetImageItemSize(F,E,G); }},_finishSetImageItemSize:function(F,E,H){if(H){this._shuffleFrames(); this._setImageItems(); if(this.isCarousel()){this._changeCarouselAngleByIndex(this.get_initialItemIndex(),true,F,E); }else{this._changeCoverFlowIndexByIndex(this.get_initialItemIndex(),F,E); }var G=this.getItemHtmlElements(); a(G).children("div").css({width:"100%",height:"100%"}).children("img").css({width:"100%",height:"100%"}); }this._createReflection(F,E); if(H){this._startAutomaticAdvance(); }},_shouldWaitForImagesToLoad:function(F,E){var G=(this._imageItems.length>0); var I=(this._itemWidth&&this._itemHeight); var H=this._toCreateReflection(F,E); return(!G&&!I)||H; },_waitForImagesToLoad:function(E){var H=a(this._itemsElement).find("img"); this._imagesToLoad=H.length; this._imagesLoadedDelegate=E; this._imageOnLoadDelegate=g(this,this._loadedImageHandler); for(var F=0,I=H.length; F0&&G.reflectionOpacity>0); },_createReflection:function(I,H){var K=this._imageItems; if(!K||K.length==0||K[0].reflection||!this._toCreateReflection(I,H)){return; }var N=this._getScrollAnimationOptions(I,H); var J=N.reflectionHeight; J=N.reflectionHeight=(J>1)?1:J; var M=N.reflectionOpacity; M=N.reflectionOpacity=(M>1)?1:M; var P=J; var G=(J<=0.5)?0:(J-0.5); var L=N.matrix; var E=b.RadRotatorAnimation.get_scrollAnimationProperties(this.get_id()); var O=(L!=null&&("filter"==this._getTransformProperty())&&!(L.m11==1&&L.m22==1&&L.m12==0&&L.m21==0))||(E&&E.opacity!=null&&!a.support.opacity); a.each(K,function(W,Y){var T=this.element; var V=T.getElementsByTagName("img"); V=(V&&V.length>0)?V[0]:null; var X={width:"100%",height:"100%"}; if(V&&!this.reflection){var Q=j.createElement("canvas"); if(Q.getContext){Q.height=this.height; Q.width=this.width; T.appendChild(Q); var S=Q.getContext("2d"); S.save(); S.globalAlpha=M; S.translate(0,this.height); S.scale(1,-1); S.drawImage(V,0,0,this.width,this.height); S.restore(); S.globalCompositeOperation="destination-in"; var U=S.createLinearGradient(0,0,0,this.height); U.addColorStop(0,"rgba(255, 255, 255, "+P+")"); U.addColorStop((J>=0.5)?1:2*J,"rgba(255, 255, 255, "+G+")"); S.fillStyle=U; S.rect(0,0,this.width,this.height); S.fill(); this.reflection=Q; }else{var R=a(V).clone(false).appendTo(T); if(c.isIE){R.css({filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1) progid:DXImageTransform.Microsoft.Alpha(opacity="+P*M*100+", style=1, finishOpacity="+G*M*100+", startx=0, starty=0, finishx=0, finishy="+this.height*((J>=0.5)?1:2*J)+")"}); }this.reflection=R[0]; if(O){a(T).children("div").css({height:"50%"}); X.height="50%"; }}a(this.reflection).css(X); }}); var F=this._animation; if(O&&(!F||!F.get_isPlaying())){if(this.isCoverFlow()){this._changeCoverFlowIndexByIndex(this._getCurrentItemIndex(),I,H); }else{if(this.isCarousel()){this._changeCarouselAngleByIndex(this._getCurrentItemIndex(),false,I,H); }}}},_createButton:function(E,F){var G=E; if(!G){G=j.createElement("div"); }if(!G.className){G.className=this._rotatorDownClass; }return G; },_isButtonDisabled:function(E){if(!E){return true; }return Sys.UI.DomElement.containsCssClass(E,this._rotatorButtonDisabledClass); },_isScrollDirectionEnabled:function(E){return E&this.get_scrollDirection()?true:false; },_isRotatorTypeEnabled:function(E){return E==this.get_rotatorType()?true:false; },get_scrollDuration:function(){if(this.isSlideShow()){return 1; }else{return this._scrollDuration; }},set_scrollDuration:function(E){this._scrollDuration=E; if(this._animation){this._animation.set_duration(this.get_scrollDuration()); }},set_vertical:function(F){var E=this._itemsElement; if(E){Sys.UI.DomElement.addCssClass(E,this._rotatorVerticalClass); }},get_vertical:function(){var E=b.RotatorScrollDirection; return(this._isScrollDirectionEnabled(E.Down)||this._isScrollDirectionEnabled(E.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(E){this.get_element().style.height=this._toStyleComplientValue(E); if(this.isVisible()){this._isCreated=false; this.repaint(); }},get_width:function(){return this.get_element().style.width; },set_width:function(E){this.get_element().style.width=this._toStyleComplientValue(E); if(this.isVisible()){this._isCreated=false; this.repaint(); }},_toStyleComplientValue:function(E){return isNaN(E)?E:E+"px"; },_attachEventHandlers:function(H){var G=this; var E=this.get_containerElement(); if(null==E){return; }var F=a(E).find("li."+this._rotatorListItemClass); if(H!=false){this._clickDelegate=g(this,this._mouseClickHandler); this._mouseOutDelegate=g(this,this._mouseOutHandler); this._mouseOverDelegate=g(this,this._mouseOverHandler); this._itemShownDelegate=g(this,this._itemShownHandler); F.on({mouseenter:this._mouseOverDelegate,mouseleave:this._mouseOutDelegate}); $addHandler(E,"click",this._clickDelegate); if(this.get_enableDragScrolling()&&!this.isCarousel()&&!this.isCoverFlow()&&!this.isSlideShow()){G._dragStartHandler=A(G._onDragStart,G); a(E).onEvent(l.Down+B,G._dragStartHandler); G._ieTouchActionManager.element=E; G._ieTouchActionManager.allowUserTouch(); G._dragStartHandler=A(G._onDragStart,G); G._attachImagesDragHandler(); }this.add_itemShown(this._itemShownDelegate); if(c.isSafari){this._documentClickDelegate=g(this,this._documentClickHandler); this._keyDownDelegate=g(this,this._keyDownHandler); c.addHandler(j,"click",this._documentClickDelegate); c.addHandler(j,"keydown",this._keyDownDelegate); }}else{if(this._mouseOverDelegate){F.off({mouseenter:this._mouseOverDelegate,mouseleave:this._mouseOutDelegate}); }if(this._clickDelegate){$removeHandler(E,"click",this._clickDelegate); }if(this._dragStartHandler){a(E).offEvent(l.Down+B,G._dragStartHandler); }if(this._imgDragStartHandler){G._detachImagesDragHandler(); }this._clickDelegate=this._mouseOutDelegate=this._mouseOverDelegate=this._dragStartHandler=null; if(this._itemShownDelegate){this.remove_itemShown(this._itemShownDelegate); }if(c.isSafari){if(this._documentClickDelegate){c.removeHandler(j,"click",this._documentClickDelegate); this._documentClickDelegate=null; }if(this._keyDownDelegate){c.removeHandler(j,"keydown",this._keyDownDelegate); this._keyDownDelegate=null; }}}},_attachImagesDragHandler:function(){var E=this; E._imgDragStartHandler=A(E._imgDragStart,E); E._getRotatorItemImages().on("dragstart"+B,E._imgDragStartHandler); },_detachImagesDragHandler:function(){var E=this; E._getRotatorItemImages().off("dragstart"+B,E._imgDragStartHandler); },_imgDragStart:function(E){E.preventDefault(); },_getRotatorItemImages:function(){return a(this.get_element()).find(".rrItemsList .rrItem img"); },_documentClickHandler:function(E){if(this._itemClickedChanged){this._itemClickedChanged=false; }else{if(this._itemClicked){this._itemClicked=false; }}},_keyDownHandler:function(E){if(this._itemClicked&&(E.keyCode>32&&E.keyCode<41)&&a(E.target).is("body")){return c.cancelRawEvent(E.rawEvent); }},_itemShownHandler:function(E){if(typeof(b.RadTicker)=="undefined"){return; }var G=this.get_items(); for(var F=0,H=G.length; F0){I.innerHTML=""; var F=I.firstChild; if(F&&I.removeChild){I.removeChild(F); }}if(J&&J.length>0){for(var G=0; G=F.children.length||typeof(G)=="undefined"||G==null||this._isLODEnabled){F.appendChild(I); Array.add(H,K); }else{F.insertBefore(I,F.children[G]); Array.insert(this.get_items(),G,K); this._fixItemsIndices(H,G); }return K; },removeRotatorItem:function(G){var L=this.get_items(); var M=L.length; G=parseInt(G,10); G=isNaN(G)||G>=M?M-1:G; if(G<0){G=0; }var E=this.get_containerElement(); if(M){this.pause(); var F=this._getCurrentItemIndex(); var I=L.splice(G,1)[0]; var K=I.get_element(); var J=c.getOuterSize(K); E.removeChild(K); E.style.width=""; E.style.height=""; this._firstItem=null; if(L.length<1){this.stop(); return; }this.repaint(); this._fixItemsIndices(L,G); var H=this.isVertical(); if(H){var O=w.floor(parseInt(this._itemsElement.style.top,10)/J.height); if(O!=0&&F<=w.abs(O)){this._itemsElement.style.top=(-(F-1)*J.height)+"px"; }}else{var N=w.floor(parseInt(this._itemsElement.style.left,10)/J.width); if(N!=0&&F<=w.abs(N)){this._itemsElement.style.left=(-(F-1)*J.width)+"px"; }}var P=this.get_rotatorType(); if(P==b.RotatorType.AutomaticAdvance||P==b.RotatorType.SlideShow||P==b.RotatorType.FromCode){this.resume(); }}},_fixItemsIndices:function(G,F){var H=G.length; for(var E=F; E0){var G=E[0].id.match(/_i(\d+)$/); if(G){return parseInt(G[1],10); }}return this.get_index(); },get_visible:function(){return this._visible; },set_visible:function(E){this._visible=E; },get_cssClass:function(){return this._cssClass; },set_cssClass:function(E){this._cssClass=E; },get_tickers:function(){if(null==this._tickers&&typeof(b.RadTicker)!="undefined"){this._tickers=[]; for(var F=0,G=c.radControls.length; F