Type.registerNamespace("Telerik.Web.UI"); (function(){$telerik.toRotator=function(c){return c; }; $telerik.findRotator=$find; var b=$telerik.$; var a=Telerik.Web.UI; b.registerEnum(a,"RotatorScrollDirection",{Left:1,Right:2,Up:4,Down:8}); b.registerEnum(a,"RotatorAnimationType",{None:1,Fade:2,Pulse:3,CrossFade:4}); b.registerEnum(a,"RotatorType",{AutomaticAdvance:1,ButtonsOver:2,Buttons:3,SlideShow:4,SlideShowButtons:5,FromCode:6,Carousel:7,CarouselButtons:8,CoverFlow:9,CoverFlowButtons:10}); a.RadRotator=function(c){a.RadRotator.initializeBase(this,[c]); this._enabled=true; this._postBackReference=null; this._webServiceSettings=new a.WebServiceSettings({}); this._webServiceLoader=null; this._containerElement=null; this._clickDelegate=null; this._mouseOutDelegate=null; this._mouseOverDelegate=null; this._itemShownDelegate=null; this._rotatorDisposed=false; this._scrollDuration=500; this._canPause=true; this._itemWidth=null; this._itemHeight=null; this._isLODEnabled=null; this._lastLODRequestPassed=false; this._firstLODRequestPassed=false; this._noActiveLODRequest=true; this._relativeWrapper=null; this._clipElement=null; this._itemsElement=null; this._loadingSign=null; this._rightButton=null; this._leftButton=null; this._downButton=null; this._upButton=null; this._firstItem=null; this._imageItems=[]; this._initialAngle=(Math.PI/2); this._carouselAnimationAngle=this._initialAngle; this._coverFlowAnimationIndex=-1; this._pendingImage=null; this._imageOnLoadDelegate=null; this._automaticAdvanceStarted=false; this._isMouseOverClipElement=false; }; a.RadRotator.prototype={initialize:function(){a.RadRotator.callBaseMethod(this,"initialize"); this._rotatorDisposed=false; this._isLODEnabled=!this.isCarousel()&&!this.isCoverFlow()&&this.get_webServiceSettings().get_method(); this._setChildElements(); this._createUI(); var c=this.get_initialItemIndex(); if(this._isLODEnabled){this._enableDisableAllButtonsUnconditionally(false); this._loadChildrenFromWebService(c); }else{this._createChildItems(); this._initialItemSet=false; this._loadInitialFrame(); this._enableDisableButtons(); }this._attachEvents(true); this._fixVisibilityProblems(true); if($telerik.isSafari){$addHandler(this._relativeWrapper,"mousewheel",this._mouseWheelHandler); }this.raiseEvent("load",Sys.EventArgs.Empty); if(!this._isLODEnabled){this._startAutomaticAdvance(); }},dispose:function(){if(this._imageOnLoadDelegate&&this._pendingImage){$telerik.removeExternalHandler(this._pendingImage,"load",this._imageOnLoadDelegate); this._pendingImage=null; this._imageOnLoadDelegate=null; }this._firstItem=null; this._rotatorDisposed=true; this._fixVisibilityProblems(false); this._attachEvents(false); this._containerElement=null; if(this._animation){this._animation.dispose(); this._animation=null; }this._imageItems=null; a.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){$removeHandler(this._relativeWrapper,"mousewheel",this._mouseWheelHandler); }if(this._itemsElement){$clearHandlers(this._itemsElement); }a.RadRotator.callBaseMethod(this,"dispose"); },_createChildItems:function(){var f=$telerik.getChildrenByTagName(this.get_containerElement(),"li"); for(var c=0; cc.length-1||this._nextItemIndex<0){this._nextItemIndex=null; }return e; },_startAutomaticAdvance:function(){if(this.isAutomaticAdvance()){var c=this.get_frameDuration(); if(c>0){window.setTimeout(Function.createDelegate(this,this.startAutoPlay),c); }else{this.startAutoPlay(); }}},get_firstItem:function(){var d=this._firstItem; if(!d){var c=this.getItemHtmlElements(); d=this.isScrollingForward()?c[0]:c[c.length-1]; }return d; },get_currentItem:function(){var c=this.getItemHtmlElements(); var d=this._getCurrentItemIndex(); return((0<=d&&d0&&d>0){d=g-d; }d%=g; }else{d=j.get_index(); }}}else{var f=parseInt(k[0].parentNode.style.left),h="left"; if(isNaN(f)||f==0){f=parseInt(k[0].parentNode.style.top); h="top"; }while(++d(o-1)){k%=o; }}var f=(Math.PI*2)/o; var j=i?b(d[0].element).attr("telerikCarouselAngle"):null; var g=((typeof(j)!="undefined"&&j!=null)?j:this._initialAngle)-k*f; if(g.toString().indexOf("e")>-1){g=(Math.round(g*10000)/10000); }var c=this._animation; if(c){c.set_angle(g); }else{this._carouselAnimationAngle=g; }var l=a.RadRotatorAnimation.get_scrollAnimationProperties(this.get_id()); var h=/^([\d+-.]+)(.*)$/; var n=$telerik.isIE&&(l&&l.opacity!=null); var m=this._getScrollAnimationOptions(p,e); b.each(d,function(C,w){var q=this; var t=Math.sin(g); var z=m.minScale; var s=z+(t+1)*((1-z)/2); var r=m.xO+(((Math.cos(g+Math.PI)*m.xR)-q.outerWidth/2)*s); var u=m.yO+((t*m.yR)*s); var A=b.extend({},l); if(l){b.each(A,function(E,x){var y=h.exec(x); A[E]=y?(y[1]*s+y[2]):x; }); }var v=this.element; v.telerikCarouselAngle=g; var D="px"; var B=b.extend(A,{width:q.width*s+D,height:q.height*s*(n&&this.reflection?2:1)+D,position:"absolute",left:r+D,top:u+D,zIndex:parseInt(s*100)}); b(v).css("display","none").css(B).css("display",""); g+=f; if(g.toString().indexOf("e")>-1){g=(Math.round(g*10000)/10000); }}); },_getTransformProperty:function(){var c="transform"; if($telerik.isIE){c="filter"; }else{if($telerik.isFirefox){c="MozTransform"; }else{if($telerik.isSafari){c="WebkitTransform"; }else{if($telerik.isOpera){c="OTransform"; }}}}return c; },_changeCoverFlowIndexByIndex:function(k,q,d){var f=this._imageItems; var o=f.length; if(o<1){return; }if(k<0){k=0; }else{if(k>(o-1)){k%=o; }}var c=this._animation; if(c){c.set_index(k); }else{this._coverFlowAnimationIndex=k; }var l=a.RadRotatorAnimation.get_scrollAnimationProperties(this.get_id()); var h=/^([\d+-.]+)(.*)$/; var i=this._getScrollAnimationOptions(q,d); var p=this.isVertical(); var n=f[k]; var g={top:i.yO-n.outerHeight/2,right:i.xO+n.outerWidth/2,bottom:i.yO+n.outerHeight/2,left:i.xO-n.outerWidth/2}; var e=i.matrix; if(e.m11==1&&e.m22==1&&e.m12==0&&e.m21==0){e=null; }var j=$telerik.isIE&&e; var m=this._getTransformProperty(); b.each(f,function(t,E){var H=this; var O=(t-k); var K=(O==0); var A=K?1:i.minScale; var w=(O>0); var r=p?(i.xO+H.outerWidth/2-H.outerWidth*A):(g[w?"right":"left"]); var s=p?(g[w?"bottom":"top"]):(i.yO+H.outerHeight/2-H.outerHeight*A); var M=O; if(M>0){if(p){s+=i.yR+(--M*i.yItemSpacing); }else{r+=i.xR+(--M*i.xItemSpacing); }}else{if(M<0){if(p){s+=-(i.yR+H.outerHeight*A)+(++M*i.yItemSpacing); }else{r+=-(i.xR+H.outerWidth*A)+(++M*i.xItemSpacing); }}else{r+=i.selectedItemOffsetX; s+=i.selectedItemOffsetY; }}var D=b.extend({},l); if(l&&!K){b.each(D,function(P,x){var y=h.exec(x); D[P]=y?(y[1]*A+y[2]):x; }); }var C="px"; var u=b.extend(D,{width:H.width*A+C,height:H.height*A*(j&&this.reflection?2:1)+C,position:"absolute",zIndex:((o-Math.abs(O))*100)}); var F=0; var B=0; if(e){var G=b.extend({},e); var I=K?0:(O<0?-1:1); G.m12*=I; G.m21*=I; if(K){G.m11=G.m22=1; }var N="matrix("+G.m11+", "+G.m21+", "+G.m12+", "+G.m22+", 0, 0)"; if($telerik.isIE){N="progid:DXImageTransform.Microsoft.Matrix(FilterType='bilinear',M11="+G.m11+", M12="+G.m12+", M21="+G.m21+", M22="+G.m22+",sizingMethod='auto expand')"; }u[m]=N; var J=Math.abs(G.m11)+Math.abs(G.m12); var L=Math.abs(G.m21)+Math.abs(G.m22); if(!p){F=I*((1-J)/2); }else{B=I*((1-L)/2); }if($telerik.isIE&&!K){F+=(J-1)/2; B+=(L-1)/2; }}u.left=r-F*A*H.outerWidth+C; u.top=s-B*A*H.outerHeight+C; var v=this.element; v.telerikCoverFlowIndex=O; var z=b(v).css("display","none").css(u).css("display",""); }); },_needsShift:function(i){if(null==i){i=this.get_animationDirection(); }var e=this._itemsElement; var h=this._clipElement; var f=parseInt(e.style.left); var k=parseInt(e.style.top); var j=$telerik.getOuterSize(e); var c=$telerik.getContentSize(h); var g=this.get_firstItem(); if(!g){return false; }var l=$telerik.getOuterSize(g); var d=false; var m=a.RotatorScrollDirection; switch(i){case m.Left:d=f+j.width1)?0.5:d.minScale; d.reflectionHeight=isNaN(d.reflectionHeight)?0:d.reflectionHeight; d.reflectionOpacity=isNaN(d.reflectionOpacity)?1:d.reflectionOpacity; d.xO=isNaN(d.xO)?parseInt(g/2):d.xO; if(this.isCarousel()){d.xR=isNaN(d.xR)?parseInt(g/2.3):d.xR; d.yR=isNaN(d.yR)?parseInt(e/6):d.yR; d.yO=isNaN(d.yO)?parseInt(d.minScale*((e-(1-d.minScale)*d.yR)/2)):d.yO; d.matrix=null; }else{if(this.isCoverFlow()){var f=this.isVertical(); d.xR=isNaN(d.xR)?(f?0:15):d.xR; d.yR=isNaN(d.yR)?(f?15:0):d.yR; d.yO=isNaN(d.yO)?parseInt(e/2):d.yO; d.xItemSpacing=isNaN(d.xItemSpacing)?(f?0:100):d.xItemSpacing; d.yItemSpacing=isNaN(d.yItemSpacing)?(f?100:0):d.yItemSpacing; d.selectedItemOffsetX=isNaN(d.selectedItemOffsetX)?0:d.selectedItemOffsetX; d.selectedItemOffsetY=isNaN(d.selectedItemOffsetY)?0:d.selectedItemOffsetY; d.matrix.m11=isNaN(d.matrix.m11)?1:d.matrix.m11; d.matrix.m12=isNaN(d.matrix.m12)?0:d.matrix.m12; d.matrix.m21=isNaN(d.matrix.m21)?0:d.matrix.m21; d.matrix.m22=isNaN(d.matrix.m22)?1:d.matrix.m22; d.coverFlowDirection=isNaN(d.coverFlowDirection)?1:(d.coverFlowDirection<0?-1:1); }}return d; },scrollViewport:function(){if(!this.get_enabled()){return; }var c=this._itemsElement; if(!this._animation){var d=this._getMoveAnimation(); var e=Function.createDelegate(this,function(){if(this.get_wrapFrames()&&!this._hasViewportWidth()){if(!this._isLODEnabled||this._noActiveLODRequest){var k=this.getItemHtmlElements().length; for(var f=0; f=g.length){return 0; }var d=$telerik.getOuterSize(g[f])[c]; if(!d&&this._isLODEnabled){d=this.get_vertical()?parseInt(this._itemHeight):parseInt(this._itemWidth); }var e=parseInt($telerik.getContentSize(this._clipElement)[c]/d); return e; },_initCrossFadeItemAnimation:function(){var c=this.get_slideShowAnimationSettings().type||a.RotatorAnimationType.None; if(a.RotatorAnimationType.CrossFade==c){var l=this._itemsElement; var k=(-1)*parseInt(l.style.top)+"px"; var n=(-1)*parseInt(l.style.left)+"px"; var g=this.getItemHtmlElements(); var i=this._getCurrentItemIndex(); if(i>=g.length){return; }var m=this._getVarSizeAttribute(); var h=$telerik.getOuterSize(g[i])[m]; var o=this._getVisibleItemsCount(); var j=i+(this.isScrollingForward()?1:-1)*o; if(j>=0&&j0){this._setAnimationTimeout(this.get_frameDuration()); }else{this._animation.play(); }}})); }this._animation.stop(); this._animation.play(); },_scrollImageItem:function(){var d=this.isCarousel(); var c=this.isCoverFlow(); if(!this._animation){if(this._imageItems.length<1){return; }var e=this._animation=this._getMoveAnimation(); e.add_started(Function.createDelegate(this,function(k,j){if(c&&!this._canSlideMore()){j.set_cancel(true); return false; }var g=this.get_currentItem(); var l=new a.RadRotatorCancelEventArgs(g); this.raiseEvent("itemShowing",l); if(l.get_cancel&&l.get_cancel()){j.set_cancel(true); return false; }var q=this._getNextItemToShow(); if(!q){return; }this._firstItem=q; var h=this.getItemHtmlElements(); var i=this.isScrollingForward()?-1:1; if(d){var f=(h.length>0)?((Math.PI*2)/h.length):0; i*=f; var o=this._animation.get_angle()+i; var n=this._initialAngle; var r=Math.PI*2+f; if(Math.round((o-(n+r))/f)==0||Math.round((o-(n-r))/f)==0){o=n+i; }if(o.toString().indexOf("e")>-1){o=(Math.round(o*10000)/10000); }var p=o-i; b(h).each(function(t,s){if(p.toString().indexOf("e")>-1){p=(Math.round(p*10000)/10000); }s.telerikCarouselAngle=p; p+=f; }); this._animation.set_angle(o); }else{var m=this._animation.get_index()-this._getScrollAnimationOptions().coverFlowDirection*i; this._animation.set_index(m); }})); e.add_ended(Function.createDelegate(this,function(){var f=this._itemsElement; if(!f||!f.parentNode){return; }if(b(f).children("li:animated").length>1){return; }if(c){this._enableDisableButtons(); }var g=this.get_currentItem(); if(g!=null){this.raiseEvent("itemShown",new a.RadRotatorEventArgs(g)); }if(this.isAutomaticAdvance()){if(this.get_frameDuration()>0){this._setAnimationTimeout(this.get_frameDuration()); }else{this._animation.play(); }}})); }this._animation.stop(); this._animation.play(); },_checkItemsSize:function(){var e=$telerik.getOuterSize(this._itemsElement); var d=this.get_vertical(); var c=(d)?e.height:e.width; var f=(d)?this.get_height():this.get_width(); return parseInt(c)>parseInt(f); },_shiftItemInList:function(){var d=(this._initialItemSet&&this.get_enableRandomOrder()); var k=this._itemsElement; var g=this.getItemHtmlElements(); var l=this.get_vertical(); var h=this.isScrollingForward(); var n=parseInt(k.style.left); var i=parseInt(k.style.top); var m=0; if(d){var e=this._getVisibleItemsCount(); var f=Math.ceil(Math.random()*(g.length-e))-1; m=h?f:f+e; }else{m=h?0:g.length-1; }var j=g[m]; var c=$telerik.getOuterSize(j); j.parentNode.removeChild(j); if(!h){k.insertBefore(j,k.firstChild); }if(l){k.style.top=(i+(h?c.height:-c.height))+"px"; }else{k.style.left=(n+(h?c.width:-c.width))+"px"; }if(h){k.appendChild(j); }this._nextItemIndex=h?g.length-1:0; return j; },_shuffleFrames:function(){if(!this._initialItemSet&&this.get_enableRandomOrder()){var d=this._itemsElement; var c=this.getItemHtmlElements(); for(var g=0,e=c.length; g=0){if(m){f=(k==i.Up)?0:-c.height+l.height; }else{d=(k==i.Left)?0:-c.width+l.width; }}else{if(e==-1){if(m){f=(k==i.Down)?-c.height:l.height; }else{d=(k==i.Right)?-c.width:l.width; }}}g.style.left=d+"px"; g.style.top=f+"px"; if(e>0&&!this._initialItemSet){for(var h=0; h=0){this.raiseEvent("itemShown",new a.RadRotatorEventArgs(this.get_items()[e])); }this._initialItemSet=true; },_setImageItems:function(){if(this._imageItems.length>0){return; }var c={}; if(this._itemWidth){c.width=parseInt(this._itemWidth); }if(this._itemHeight){c.height=parseInt(this._itemHeight); }var e=(c.width&&c.height); var d=[]; b(this.getItemHtmlElements()).each(function(i,l){var f=b.extend({},c); if(!e){var k=b(l).css("float","left"); f=b.extend($telerik.getContentSize(l),f); k.css("float",""); }var g=$telerik.getBorderBox(l); var h=$telerik.getPaddingBox(l); var j=$telerik.getMarginBox(l); g.horizontal+=h.horizontal+j.horizontal; g.vertical+=h.vertical+j.vertical; d[i]=b.extend(f,{element:l,outerWidth:(f.width+g.horizontal),outerHeight:(f.height+g.vertical)}); }); this._imageItems=d; },pause:function(){if(this._isPaused){return; }this._isPaused=true; if(this._animation&&this._animation.get_isActive()){this._animation.pause(); }},resume:function(){if(this._timeoutPassed||!this._isPaused){if(this._animation){this._animation.play(this._timeoutPassed); }}else{if(this._isPaused){if(this._animation&&this._animation.get_isActive()){this._animation.play(); }}}this._isPaused=false; },stop:function(){this._clearAnimationTimeout(); this._canPause=false; this.pause(); },start:function(){this._canPause=true; this._isPaused=false; this.resume(); },isViewportScrollMode:function(){var c=a.RotatorType; if(this._isRotatorTypeEnabled(c.AutomaticAdvance)||this._isRotatorTypeEnabled(c.ButtonsOver)||this._isRotatorTypeEnabled(c.FromCode)||this._isRotatorTypeEnabled(c.Carousel)||this._isRotatorTypeEnabled(c.CarouselButtons)||this._isRotatorTypeEnabled(c.CoverFlow)||this._isRotatorTypeEnabled(c.CoverFlowButtons)){return false; }return true; },_getButtonScrollDirection:function(e){var c=a.RotatorScrollDirection; var d=c.Left; switch(e){case this._rightButton:d=c.Left; break; case this._leftButton:d=c.Right; break; case this._downButton:d=c.Up; break; case this._upButton:d=c.Down; break; }return d; },_buttonClicked:function(h){if(!this.get_enabled()){$telerik.cancelRawEvent(h); return false; }var c=this._animation; if(c&&c.get_isPlaying()){c.stop(); }var g=h.target; if(this._isButtonDisabled(g)||this.get_items().length==0){return; }var f=new a.RadRotatorButtonEventArgs(g); this.raiseEvent("buttonClick",f); if(f.get_cancel()){return; }var d=this._getButtonScrollDirection(g); this.set_animationDirection(d); if(this.isCarousel()||this.isCoverFlow()){this.scrollItem(); }else{this.scrollViewport(); }return $telerik.cancelRawEvent(h); },_buttonOver:function(g){if(!this.get_enabled()){$telerik.cancelRawEvent(g); return false; }var c=g.target; if(this._isButtonDisabled(c)||this.get_items().length==0){return; }var f=new a.RadRotatorButtonEventArgs(c); this.raiseEvent("buttonOver",f); if(f.get_cancel()){return; }var d=this._getButtonScrollDirection(c); this.set_animationDirection(d); this._stopAnimationButtonOver=false; this.scrollItem(); return $telerik.cancelRawEvent(g); },_buttonOut:function(g){if(!this.get_enabled()){$telerik.cancelRawEvent(g); return false; }var c=g.target; if(this._isButtonDisabled(c)){return; }var f=new a.RadRotatorButtonEventArgs(c); this.raiseEvent("buttonOut",f); if(f.get_cancel()){return; }var d=this._getButtonScrollDirection(c); this.set_animationDirection(d); this._stopAnimationButtonOver=true; return $telerik.cancelRawEvent(g); },_initializeButtonsRotatorType:function(){var r=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 v=a.RotatorScrollDirection; var q=[v.Right,v.Left,v.Down,v.Up]; var t=[this._leftButton,this._rightButton,this._upButton,this._downButton]; var k=[r.LeftButtonID?$get(r.LeftButtonID):null,r.RightButtonID?$get(r.RightButtonID):null,r.UpButtonID?$get(r.UpButtonID):null,r.DownButtonID?$get(r.DownButtonID):null]; var l=[this._rotatorLeftClass,this._rotatorRightClass,this._rotatorUpClass,this._rotatorDownClass]; var e=["marginLeft","marginRight","marginTop","marginBottom"]; var d=["paddingLeft","paddingRight","paddingTop","paddingBottom"]; var m=["width","width","height","height"]; var c=this._relativeWrapper; var f=this.get_element(); for(var n=0; n1){return; }this._canPause=true; if(e!=a.RotatorAnimationType.None){if(i){b(this.getItemHtmlElements()).css({position:"",visibility:""}); b(d).css("visibility","visible"); }else{b(d).css("opacity","1"); }}var g=this.get_currentItem(); this.raiseEvent("itemShown",new a.RadRotatorEventArgs(g)); if(!this.get_pauseOnMouseOver()||(!this._isMouseOverClipElement)){if(this.isAutomaticAdvance()){var h=this.get_frameDuration(); if(h>=0){this._setAnimationTimeout(h); }}}}); switch(e){case a.RotatorAnimationType.Fade:this._canPause=false; b(d).css("opacity","0").fadeTo(f,1,c); break; case a.RotatorAnimationType.Pulse:this._canPause=false; b(d).fadeTo(f,0).fadeTo(f,1,c); break; case a.RotatorAnimationType.CrossFade:this._canPause=false; this._runCrossFadeSlideShowAnimation(f,c); break; default:c(); break; }},_runCrossFadeSlideShowAnimation:function(c,p){var l=this._itemsElement; var j=(-1)*parseInt(l.style.top)+"px"; var n=(-1)*parseInt(l.style.left)+"px"; var g=this.getItemHtmlElements(); var i=this._getCurrentItemIndex(); if(i>=g.length){return; }var m=this._getVarSizeAttribute(); var h=$telerik.getOuterSize(g[i])[m]; var o=parseInt($telerik.getContentSize(this._clipElement)[m]/h); var k=i-(this.isScrollingForward()?1:-1)*o; if(k>=0&&k0; }else{if((i&&k==1)||(c&&k==-1)){j=lf.width; }else{if(e==n.Up){j=(d.height+m)>f.height; }else{if(e==n.Right){j=(g<0); }else{if(e==n.Down){j=(m<0); }}}}}return j; },_getCalculatedAnimationDirection:function(){var d=this.get_animationDirection(); var c=a.RotatorScrollDirection; var e=23; switch(d){case c.Left:e=21; break; case c.Down:e=32; break; case c.Up:e=12; break; default:e=23; }return e; },startAutoPlay:function(){if(this._rotatorDisposed){return; }this._loadInitialFrame(); if((this.isCarousel()||this.isCoverFlow())&&!this._automaticAdvanceStarted){this._automaticAdvanceStarted=true; return; }this.showNext(this.get_defaultAnimationDirection()); },get_defaultAnimationDirection:function(){var d=a.RotatorScrollDirection; var c=0; if(this._isScrollDirectionEnabled(d.Left)){c=d.Left; }else{if(this._isScrollDirectionEnabled(d.Up)){c=d.Up; }else{if(this._isScrollDirectionEnabled(d.Right)){c=d.Right; }else{if(this._isScrollDirectionEnabled(d.Down)){c=d.Down; }}}}if(!c){c=d.Left; }return c; },get_containerElement:function(){return this._itemsElement; },_setChildElements:function(){this._rotatorListClass="rrItemsList"; this._rotatorVerticalClass="rrVerticalList"; this._rotatorRelativeWrapperClass="rrRelativeWrapper"; this._rotatorClipRegionClass="rrClipRegion"; this._rotatorRightClass="rrButtonRight"; this._rotatorLeftClass="rrButtonLeft"; this._rotatorDownClass="rrButtonDown"; this._rotatorUpClass="rrButtonUp"; this._rotatorButtonDisabledClass="rrButtonDisabled"; this._rootElement=this.get_element(); this._relativeWrapper=$telerik.getElementByClassName(this._rootElement,this._rotatorRelativeWrapperClass); this._clipElement=$telerik.getElementByClassName(this._rootElement,this._rotatorClipRegionClass); this._itemsElement=$telerik.getElementByClassName(this._rootElement,this._rotatorListClass); },_createUI:function(){if(!this.isVisible()){return; }var i=this.get_element(); var h=this._relativeWrapper; if(!i){return; }if(!this._isCreated){this._fixRootElementSize(); h.style.height=i.offsetHeight+"px"; h.style.width=i.offsetWidth+"px"; var l=true; if(this._isRotatorTypeEnabled(a.RotatorType.Buttons)||this._isRotatorTypeEnabled(a.RotatorType.ButtonsOver)||this._isRotatorTypeEnabled(a.RotatorType.SlideShowButtons)||this._isRotatorTypeEnabled(a.RotatorType.CarouselButtons)||this._isRotatorTypeEnabled(a.RotatorType.CoverFlowButtons)){l=this._initializeButtonsRotatorType(); }if(l){Sys.UI.DomElement.addCssClass(i,"rrNoBorder"); }this._isCreated=true; }if(this.get_vertical()){this.set_vertical(true); }h.style.overflow="auto"; var d=this._clipElement; d.style.overflow="auto"; var g=this._itemsElement; if(this._isLODEnabled){g.style.width=""; g.style.height=""; }var j=10000; try{j=1000+g.offsetWidth*$telerik.getChildrenByTagName(g,"li").length; }catch(k){j=10000; }d.style.width=Math.max(j,10000)+"px"; d.style.height="10000px"; var j=h.style.width; var c=h.style.height; var f=this.isCarousel()||this.isCoverFlow(); if(f){this._setImageItemsSize(parseInt(j),parseInt(c),true); }g.style.width=f?j:(this.get_vertical()?h.style.width:g.offsetWidth+"px"); g.style.height=f?c:(g.offsetHeight+"px"); h.style.overflow=""; d.style.width=j; d.style.height=c; d.style.overflow="hidden"; d.style.position="relative"; g.style.position="relative"; i.style.visibility="visible"; },_setImageItemsSize:function(m,n,l){var o=(this._imageItems.length>0); var h=this._itemsElement; var c=(this._itemWidth&&this._itemHeight); var f=this._toCreateReflection(m,n); if((!o&&!c)||f){var k=b(h).find("img"); if(!c&&k.length==0){return; }for(var d=0,e=k.length; d0&&d.reflectionOpacity>0); },_createReflection:function(l,k){var j=this._imageItems; if(!j||j.length==0||j[0].reflection||!this._toCreateReflection(l,k)){return; }var d=this._getScrollAnimationOptions(l,k); var f=d.reflectionHeight; f=d.reflectionHeight=(f>1)?1:f; var m=d.reflectionOpacity; m=d.reflectionOpacity=(m>1)?1:m; var e=f; var n=(f<=0.5)?0:(f-0.5); var h=d.matrix; var c=a.RadRotatorAnimation.get_scrollAnimationProperties(this.get_id()); var g=$telerik.isIE&&((h!=null&&!(h.m11==1&&h.m22==1&&h.m12==0&&h.m21==0))||(c&&c.opacity!=null)); b.each(j,function(v,o){var p=this.element; var u=p.getElementsByTagName("img"); u=(u&&u.length>0)?u[0]:null; var s={width:"100%",height:"100%"}; if(u&&!this.reflection){var q=document.createElement("canvas"); if(q.getContext){q.height=this.height; q.width=this.width; p.appendChild(q); var r=q.getContext("2d"); r.save(); r.globalAlpha=m; r.translate(0,this.height); r.scale(1,-1); r.drawImage(u,0,0,this.width,this.height); r.restore(); r.globalCompositeOperation="destination-in"; var w=r.createLinearGradient(0,0,0,this.height); w.addColorStop(0,"rgba(255, 255, 255, "+e+")"); w.addColorStop((f>=0.5)?1:2*f,"rgba(255, 255, 255, "+n+")"); r.fillStyle=w; r.rect(0,0,this.width,this.height); r.fill(); this.reflection=q; }else{var t=b(u).clone(false).appendTo(p); if($telerik.isIE){t.css({filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1) progid:DXImageTransform.Microsoft.Alpha(opacity="+e*m*100+", style=1, finishOpacity="+n*m*100+", startx=0, starty=0, finishx=0, finishy="+this.height*((f>=0.5)?1:2*f)+")"}); }this.reflection=t[0]; if(g){b(p).children("div").css({height:"50%"}); s.height="50%"; }}b(this.reflection).css(s); }}); var i=this._animation; if(g&&(!i||!i.get_isPlaying())){if(this.isCoverFlow()){this._changeCoverFlowIndexByIndex(this._getCurrentItemIndex(),l,k); }else{if(this.isCarousel()){this._changeCarouselAngleByIndex(this._getCurrentItemIndex(),false,l,k); }}}},_createButton:function(c,d){var e=c; if(!e){e=document.createElement("div"); }if(!e.className){e.className=this._rotatorDownClass; }return e; },_isButtonDisabled:function(c){if(!c){return true; }return Sys.UI.DomElement.containsCssClass(c,this._rotatorButtonDisabledClass); },_isScrollDirectionEnabled:function(c){return c&this.get_scrollDirection()?true:false; },_isRotatorTypeEnabled:function(c){return c==this.get_rotatorType()?true:false; },get_scrollDuration:function(){if(this.isSlideShow()){return 1; }else{return this._scrollDuration; }},set_scrollDuration:function(c){this._scrollDuration=c; if(this._animation){this._animation.set_duration(this.get_scrollDuration()); }},set_vertical:function(d){var c=this._itemsElement; if(c){Sys.UI.DomElement.addCssClass(c,this._rotatorVerticalClass); }},get_vertical:function(){var c=a.RotatorScrollDirection; return(this._isScrollDirectionEnabled(c.Down)||this._isScrollDirectionEnabled(c.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(c){this.get_element().style.height=c; if(this.isVisible()){this.repaint(); }},get_width:function(){return this.get_element().style.width; },set_width:function(c){this.get_element().style.width=c; if(this.isVisible()){this.repaint(); }},_attachEvents:function(c){var d=this.get_containerElement(); if(null==d){return; }if(c!=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(d,"mouseover",this._mouseOverDelegate); $addHandler(d,"mouseout",this._mouseOutDelegate); $addHandler(d,"click",this._clickDelegate); this.add_itemShown(this._itemShownDelegate); }else{$removeHandler(d,"mouseover",this._mouseOverDelegate); $removeHandler(d,"mouseout",this._mouseOutDelegate); $removeHandler(d,"click",this._clickDelegate); this._clickDelegate=null; this._mouseOutDelegate=null; this._mouseOverDelegate=null; this.remove_itemShown(this._itemShownDelegate); }},_itemShownHandler:function(d){if(typeof(a.RadTicker)=="undefined"){return; }var f=this.get_items(); for(var c=0,g=f.length; c0){g.innerHTML=""; var j=g.firstChild; if(j&&g.removeChild){g.removeChild(j); }}if(h&&h.length>0){for(var d=0; d=g.children.length||d==null||this._isLODEnabled){g.appendChild(f); Array.add(this.get_items(),e); }else{g.insertBefore(f,g.childNodes[d]); Array.insert(this.get_items(),d,e); }if(!this._isLODEnabled){g.style.width=""; g.style.height=""; this.repaint(); }},_doLoadOnDemand:function(d){var c=this._loadNextFrame(); if(this._isLODEnabled&&this._noActiveLODRequest&&c){this._animation.stop(); d.set_cancel(true); this._noActiveLODRequest=false; this._enableDisableAllButtonsUnconditionally(false); this._loadChildrenFromWebService(c); return false; }},_loadNextFrame:function(){var d=this._getCurrentItemIndex(); var c=this._getVisibleItemsCount(); var f=this.get_items().length; var g=null; var e=this.isScrollingForward()?d+c:d-1; if(this.isViewportScrollMode()){e=this.isScrollingForward()?e+c-1:e-c+1; }if(this._isLODEnabled&&!this.get_items()[e]){if(!this._lastLODRequestPassed){g=f; }}return g; },_getInvisibleParent:function(){var c=this.get_element(); while(c&&c!=document){if("none"==$telerik.getCurrentStyle(c,"display","")){return c; }c=c.parentNode; }return null; },isVisible:function(){return(this._getInvisibleParent()==null); },_fixVisibilityProblems:function(c){if(c){var d=this._getInvisibleParent(); if(d){this._onParentVisibilityChangeDelegate=Function.createDelegate(this,this._onParentVisibilityChange); this._invisibleParent=d; 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(f){if($telerik.isIE){f=f.rawEvent; if(!f){return; }if(f.propertyName=="style.display"||f.propertyName=="className"){var c=$telerik.getCurrentStyle(this._invisibleParent,"display"); if(c!="none"){this.repaint(); }}}else{if(f.attrName=="style"||f.attrName=="class"){var d=f.target; if((f.currentTarget==f.originalTarget)&&"none"!=$telerik.getCurrentStyle(d,"display")){window.setTimeout(Function.createDelegate(this,function(){this.repaint(); }),0); }}}this._fixVisibilityProblems(false); },repaint:function(){this._createUI(); this._enableDisableButtons(); },get_webServiceSettings:function(){return this._webServiceSettings; },set_webServiceSettings:function(d){var c=Sys.Serialization.JavaScriptSerializer.deserialize(d); this._webServiceSettings=new a.WebServiceSettings(c); },get_enabled:function(){return this._enabled; },set_enabled:function(c){if(c!=this._enabled){this._enabled=c; if(this.get_isInitialized()){if(c){this.start(); }else{this.stop(); }}}}}; b.registerControlProperties(a.RadRotator,{skin:"Default",pauseOnMouseOver:true,items:null,rotatorType:a.RotatorType.AutomaticAdvance,wrapFrames:true,scrollDirection:a.RotatorScrollDirection.Left+a.RotatorScrollDirection.Right,frameDuration:2000,controlButtons:{},initialItemIndex:0,slideShowAnimationSettings:{},animationDirection:a.RotatorScrollDirection.Left,enableRandomOrder:false}); b.registerControlEvents(a.RadRotator,["itemClicking","itemClicked","mouseOver","mouseOut","itemShowing","itemShown","load","buttonOver","buttonOut","buttonClick","itemsRequested","itemsRequestFailed","itemsRequesting"]); a.RadRotator.registerClass("Telerik.Web.UI.RadRotator",a.RadWebControl); a.RadRotatorEventArgs=function(c){a.RadRotatorEventArgs.initializeBase(this); this._item=c; }; a.RadRotatorEventArgs.prototype={get_item:function(){return this._item; }}; a.RadRotatorEventArgs.registerClass("Telerik.Web.UI.RadRotatorEventArgs",Sys.EventArgs); a.RadRotatorCancelEventArgs=function(c){a.RadRotatorCancelEventArgs.initializeBase(this); this._item=c; }; a.RadRotatorCancelEventArgs.prototype={get_item:function(){return this._item; }}; a.RadRotatorCancelEventArgs.registerClass("Telerik.Web.UI.RadRotatorCancelEventArgs",Sys.CancelEventArgs); a.RadRotatorButtonEventArgs=function(c){a.RadRotatorButtonEventArgs.initializeBase(this); this._button=c; }; a.RadRotatorButtonEventArgs.prototype={get_button:function(){return this._button; }}; a.RadRotatorButtonEventArgs.registerClass("Telerik.Web.UI.RadRotatorButtonEventArgs",Sys.CancelEventArgs); a.RadRotatorErrorEventArgs=function(c){a.RadRotatorErrorEventArgs.initializeBase(this); this._cancelErrorAlert=false; this._errorMessage=c; }; a.RadRotatorErrorEventArgs.prototype={get_errorMessage:function(){return this._errorMessage; },get_cancelErrorAlert:function(){return this._cancelErrorAlert; },set_cancelErrorAlert:function(c){this._cancelErrorAlert=c; }}; a.RadRotatorErrorEventArgs.registerClass("Telerik.Web.UI.RadRotatorErrorEventArgs",Sys.EventArgs); a.RadRotatorItem=function(c){a.RadRotatorItem.initializeBase(this,[c]); this._visible=null; this._cssClass=null; this._index=-1; }; a.RadRotatorItem.prototype={initialize:function(){a.RadRotatorItem.callBaseMethod(this,"initialize"); this._tickers=null; },dispose:function(){a.RadRotatorItem.callBaseMethod(this,"dispose"); },get_index:function(){if(this._index==-1){var d=0; var e=this.get_element(); var c=e.parentNode; if(null!=c){var f=$telerik.getChildrenByTagName(c,"li"); if(null!=f){for(d=0; d