OP.widget.featureCarousel=(function(){var I=null,F=10,M=0,H=1,D=null,N=null,A=0,P=null,B=null,L="verticalscroll";var R=function(){if(F==0){H=parseInt(H)+1>M?1:parseInt(H)+1;K(document.getElementById("op_feature_carousel_links-"+I).getElementsByTagName("li"));G();F=10}else{F--}};var K=function(S){for(i=0;i<S.length;i++){if(S[i].className.split("-")[1]==H){classes=S[i].className.split("s");if(!("selected" in classes)){S[i].className+=" selected"}}else{S[i].className=S[i].className.replace(/(\s)*selected/,"")}}};var G=function(){var S,T;S=document.getElementById("op_feature_carousel_features-"+I).getElementsByTagName("li");if(N){D=N}if(S.length>1){for(T=0;T<S.length;T++){if(!N&&S[T].className.split("-")[1]==1){D=S[T]}if(S[T].className.split("-")[1]==H){N=S[T];if(L=="verticalscroll"){E()}else{J()}return }}}};var J=function(){D.style.zIndex=2;N.style.position="absolute";N.style.top=0;N.style.left=0;N.style.zIndex=1;typeof N.style.opacity=="string"?N.style.opacity=1:N.style.filter="alpha(opacity=100)";A=100;B=setInterval(O,100)};var O=function(){if(A==0){clearInterval(B);B=null;N.style.zIndex=2;D.style.zIndex=0;typeof D.style.opacity=="string"?D.style.opacity=0:D.style.filter="alpha(opacity=0)"}else{A-=5;typeof D.style.opacity=="string"?D.style.opacity=A/100:D.style.filter="alpha(opacity="+A+")"}};var E=function(){var U,T=[];P=N.offsetParent;U=P.getElementsByTagName("li");T.push(N);for(S=0;S<U.length;S++){e=U[S];if(e!=N&&e!=D){T.push(e)}}for(var S=0;S<T.length;S++){P.removeChild(T[S]);P.appendChild(T[S])}A=N.offsetHeight;B=setInterval(C,15)};var C=function(){if(A>0){var S=Math.abs(P.scrollTop-N.offsetTop);P.scrollTop+=S>10?10:S;A-=10}else{Q()}};var Q=function(){var W=P.getElementsByTagName("li"),V,U=[],T,S;N.style.position="relative";N.style.top="";N.style.zIndex=0;for(T=0;T<W.length;T++){V=W[T];if(V!=N){U.push(V)}}for(S in U){P.removeChild(U[S]);P.appendChild(U[S])}P.scrollTop=0;clearInterval(B);B=null};return{construct:function(U){var S,T;S=U.getElementsByTagName("li");M=S.length;for(T=0;T<M;T++){OP.utility.observe(S[T],"click",this.selectFeature)}I=U.id.split("-")[1];L=document.getElementById("featurecarousel_animate_"+I).innerHTML;setTimeout(this.startFeature,Math.random()*10000);return I},startFeature:function(){setInterval(R,500)},selectFeature:function(){var W=H,V=this.id==undefined?event.srcElement:this,S,X,U,T;H=(V.className.split(" ")[0]).split("-")[1];if(H==W){return false}F=15;S=[],current=V.parentNode;while(current&&current!=document){if(current.nodeType==1){S.push(current)}current=current.parentNode}X=OP.widget.collection.getWidgetInstance(S[1].id.split("-")[1]);T=S[0].getElementsByTagName("li");K(T);G();return false}}});OP.widget.collection.add(OP.widget.featureCarousel,"op_feature_carousel_links");