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