(function(A){A.ui=A.ui||{};A.fn.extend({spinner:function(B){if(!this.is(".ui-spinner")){return new A.ui.spinner(this,B||{})}}});A.ui.spinner=function(E,J){this.anchor=E;var G=AJS.params.staticResourceUrlPrefix||contextPath;this.images=J.images||[G+"/images/ddtree/black spinner/1.png",G+"/images/ddtree/black spinner/2.png",G+"/images/ddtree/black spinner/3.png",G+"/images/ddtree/black spinner/4.png",G+"/images/ddtree/black spinner/5.png",G+"/images/ddtree/black spinner/6.png",G+"/images/ddtree/black spinner/7.png",G+"/images/ddtree/black spinner/8.png",G+"/images/ddtree/black spinner/9.png",G+"/images/ddtree/black spinner/10.png",G+"/images/ddtree/black spinner/11.png",G+"/images/ddtree/black spinner/12.png"];this.width=J.width||"16px";this.height=J.height||J.width||"16px";this.hide=function(){this.anchor.hide();this.stop()};this.show=function(){this.start();this.anchor.show()};this.fadeIn=function(){this.anchor.fadeIn.apply(this.anchor,arguments)};this.fadeOut=function(){this.anchor.fadeOut.apply(this.anchor,arguments)};this.moveTo=function(K,L){this.anchor.css("top",L);this.anchor.css("left",K)};this.putInBox=function(N){var L=N.x||N.x1,O=N.y||N.y1,M=(typeof N.width=="undefined")?N.x2-N.x1:N.width,K=(typeof N.height=="undefined")?N.y2-N.y1:N.height;this.moveTo(L+Math.round((M-this.offsetWidth)/2),O+Math.round((K-this.offsetHeight)/2))};this.start=function(){if(!this.timer){this.timer=setInterval(B,100)}return this.timer};this.stop=function(){clearInterval(this.timer);this.timer=null};this.divs=[];for(var D=0,I=this.images.length;D<I;D++){var C=document.createElement("div");if(!AJS.applyPngFilter(C,this.images[D])){var F=document.createElement("img");F.src=this.images[D];F.style.width=this.width;F.style.height=this.height;C.appendChild(F)}C.style.width=this.width;C.style.height=this.height;this.anchor.append(C);if(!this.offsetWidth){this.offsetWidth=C.offsetWidth;this.offsetHeight=C.offsetHeight}this.divs.push(A(C).hide())}this.frame=0;this.direction=1;var H=this;var B=function(){H.divs[H.frame].hide();H.frame+=H.direction;if(H.frame>=H.divs.length){H.frame=0}if(H.frame<0){H.frame=H.divs.length-1}H.divs[H.frame].show()};this.anchor.css("position","absolute")}})(jQuery);
