var StyleInfo={"className":navigator.userAgent.indexOf("MSIE")!=-1?"className":"class","getClass":function(n){var j=n.getAttribute(StyleInfo.className);return j==null?"":j;},"setClass":function(n,G){var j=StyleInfo.getClass(n);if(j!=G){n.setAttribute(StyleInfo.className,G);}},"unsetClass":function(j,k){var G=StyleInfo.getClass(j);if(G.indexOf(k)==-1){return ;}G=G.split(" ");for(var n=0;n<G.length;n++){if(G[n]==k){G.splice(n,1);break;}}StyleInfo.setClass(j,G.join(" "));},"getMeasures":function(k){if(k.getBoundingClientRect){var j=k.getBoundingClientRect();var n=j.right-j.left;var G=j.bottom-j.top;}else{var n=k.clientWidth;var G=k.clientHeight;}return {"width":n,"height":G};}};EventUtils={"addListener":function(G,j,k,n){if(n==null){n=false;}switch(j){case "mousewheel":if(G.addEventListener&&!window.opera){G.addEventListener("DOMMouseScroll",k,n);}else{G.onmousewheel=(function(U){return function(T){if(!T){T=window.event;}if(U){U.call(G,T);}return k(T);};})(G.onmousewheel);}break;default:if(document.addEventListener){G.addEventListener(j,k,n);}else{if(document.attachEvent){G.attachEvent("on"+j,k,n);}else{G["on"+j]=k;}}break;}},"removeListener":function(G,j,k,n){if(n==null){n=false;}if(document.removeEventListener){G.removeEventListener(j,k,n);}else{if(document.attachEvent){G.detachEvent("on"+j,k,n);}else{G["on"+j]=null;}}}};var ScrollUtils={"getComps":function(k){var G={};G.contentHolder=k[0];G.content=k[0].getElementsByTagName("div")[0];for(var n=1;n<k.length;n++){if(StyleInfo.getClass(k[n]).indexOf("scrollbar-hilight-color")!=-1){G.scrollbar=k[n];}if(StyleInfo.getClass(k[n]).indexOf("scroll_bottom")!=-1){G.scroll_bottom=k[n];}if(StyleInfo.getClass(k[n]).indexOf("scroll_top")!=-1){G.scroll_top=k[n];}}G.mainBox=G.scrollbar.parentNode;G.content.measures=StyleInfo.getMeasures(G.content);G.scrollbar.measures=StyleInfo.getMeasures(G.scrollbar);G.contentHolder.measures=StyleInfo.getMeasures(G.contentHolder);var j=G.scrollbar.getElementsByTagName("div");G.button_up=j.length>1&&j[0]!=null?j[0]:null;G.button_track=j[1]!=null?j[1]:j[0];G.button_dw=j.length>1&&j[2]!=null?j[2]:null;if(G.button_up!=null){G.button_up.measures=StyleInfo.getMeasures(G.button_up);}if(G.button_track!=null){G.button_track.measures=StyleInfo.getMeasures(G.button_track);}if(G.button_dw!=null){G.button_dw.measures=StyleInfo.getMeasures(G.button_dw);}return G;},"defineTrackSize":function(T){var U=T.getComponents();var G=T.getProperties();var P=U.content.measures.height;var n=ScrollUtils.trackRange(T);var k=n.max-4;if(U.button_dw!=null){k-=U.button_dw.measures.height;}T.setProperty("maxBarHeight",k);G.ratio=P/(n.max-n.min);var j=Math.round((n.max-n.min)/G.ratio);if(isNaN(j)){j=0;}if(j<G.minBarHeight){G.ratio=P/((n.max-n.min-G.minBarHeight));j=G.minBarHeight;}else{if(j>k){j=k;}}U.button_track.style.height=j+"px";U.button_track.measures.height=j;T.setComponents(U);T.setProperties(G);},"trackRange":function(k){var G=k.getComponents();var j=G.button_up!=null?G.button_up.measures:{"height":0};var n=G.button_dw!=null?G.button_dw.measures:{"height":0};var U=G.scrollbar.measures;return {"min":(0+j.height),"max":(U.height-n.height)};}};function Scroller(j){var U=j;var k=null;var x=0;var G={"minBarHeight":20};var P=false;var T=true;var n=this;this.getControlID=function(){return U;};this.getComponents=function(){return k;};this.getProperties=function(){return G;};this.getProperty=function(v){return G[v];};this.isScrolling=function(){return P;};this.isEnableBar=function(){return T;};this.setComponents=function(v){k=v;};this.setProperties=function(v){G=v;};this.setProperty=function(W,o){G[W]=o;};this.setScrolling=function(v){P=v;};this.init=function(o){var e=document.getElementById(o);var W=e.getElementsByTagName("div");k=ScrollUtils.getComps(W);ScrollUtils.defineTrackSize(n);var v=0;var y=ScrollUtils.trackRange(n);G.trackMin=y.min;G.trackMax=y.max-(k.button_track.measures.height+2);if(k.button_up!=null){v+=k.button_up.measures.height;}k.button_track.style.top=v+"px";k.content.style.top="0px";k.button_track.Controller=n;EventUtils.addListener(k.button_track,"mousedown",n.initCapture);T=k.contentHolder.measures.height<=k.content.measures.height;if(!T){k.scrollbar.style.visibility="hidden";k.scroll_top.style.visibility="hidden";k.scroll_bottom.style.visibility="hidden";}else{if(T&&k.scrollbar.style.visibility=="hidden"){k.scrollbar.style.visibility="inherit";k.scroll_top.style.visibility="inherit";k.scroll_bottom.style.visibility="inherit";}}};this.initCapture=function(v){if(scrollManager.getCurrent()==null){scrollManager.setCurrent(v,n);}};this.moveUpListener=function(v){scrollManager.click(v,"up");};this.moveDownListener=function(v){scrollManager.click(v,"down");};this.finishListeners=function(){EventUtils.removeListener(k.button_track,"mousedown",n.initCapture);};this.verifyAndRelease=function(v){var o=scrollManager.getCurrent();o=o!=null?o.isScrolling():false;if(!o){scrollManager.releaseClick(v);}};this.init(j);}function ScrollManager(){var n={};var k=null;var G=this;var j=null;this.init=function(){var T=arguments.length;for(var U=0;U<T;U++){n[arguments[U]]=new Scroller(arguments[U]);n[arguments[U]].getComponents().mainBox.wheelEnabled=true;EventUtils.addListener(n[arguments[U]].getComponents().mainBox,"mouseover",G.setWheelTarget);EventUtils.addListener(n[arguments[U]].getComponents().mainBox,"mousewheel",G.mouseWheel);}};this.reset=function(U){G.release(null);k=null;if(n[U]!=null){n[U].finishListeners();}n[U]=null;n[U]=new Scroller(U);var T=n[U].getComponents();T.button_track.Controller=n[U];};this.getCurrent=function(){return k;};this.getTargets=function(){return n;};this.getTarget=function(U){return n[U]!=null?n[U]:null;};this.setWheelTarget=function(U){var T=U.target!=null?U.target:U.srcElement;while(T!=null&&T.parentNode!=null){if(T.wheelEnabled!=null){break;}T=T.parentNode;}if(T.wheelEnabled!=null){j=T;}};this.setCurrent=function(U,T){G.release(U);k=n[T.getControlID()];k.setScrolling(true);this.startListener(U);};this.mouseMove=function(P){if(k==null||!k.isEnableBar()){G.release(P);return ;}var W=k.getProperty("offsetY");if(W==null){W=0;}var v=k.getComponents();var x=k.getProperty("trackMin");var T=k.getProperty("trackMax");var U="";var o=(P.clientY+x)-W;if(o<x){o=x;}else{if(o>T){o=T;}}v.button_track.style.top=o+"px";G.move(o);};this.mouseUp=function(U){G.release(U);};this.mouseOut=function(U){var T=U.target!=null?U.target:U.srcElement;if(T==document.body){G.release(U);}};this.mouseWheel=function(U){var o=0;if(U.wheelDelta){o=U.wheelDelta/120;}else{if(U.detail){o=-U.detail/3;}}if(j==null){return ;}k=n[j.id];if(k==null||!k.isEnableBar()){return ;}var v=k.getComponents().content.measures.height;var x=k.getComponents().button_track.measures.height;var P=Math.round(7*(x/v));if(P<=2.5){P=3;}if(P>=5){P=5;}var T=(P*-o);G.moveBy(k,T);k=null;if(U.preventDefault){U.preventDefault();}U.returnValue=false;return false;};this.click=function(U,o){if(k!=null&&k.isScrolling()){return ;}k=n[j.id];var v=k.getComponents().content.measures.height;var x=k.getComponents().button_track.measures.height;var P=Math.round(7*(x/v));if(P<=2.5){P=2.5;}if(P>=5){P=5;}var T=0;if(o=="up"){T=-P;}else{T=P;}G.moveBy(k,T);k.timeout=window.setTimeout("scrollManager.click(null,\""+o+"\")",60);return false;};this.releaseClick=function(U){if(k!=null&&k.timeout!=null){window.clearTimeout(k.timeout);}k=null;};this.moveBy=function(v,P){var T=parseInt(v.getProperty("trackMin"));var U=parseInt(v.getProperty("trackMax"));var o=parseInt(v.getProperty("offsetY"));var x=parseInt(v.getComponents().button_track.style.top);if(isNaN(o)){o=0;}if(isNaN(x)){x=0;}x+=P;if(x<=T){x=T;}else{if(x>=U){x=U;}}v.getComponents().button_track.style.top=Math.round(x)+"px";G.move(x);if(v.getComponents().button_up!=null){x-=v.getComponents().button_up.measures.height;}v.setProperty("offsetY",x);};this.startListener=function(T){var P=T.target!=null?T.target:T.srcElement;P=P.Controller;var U=parseInt(P.getProperty("offsetY"));if(isNaN(U)){U=0;}P.setProperty("offsetY",T.clientY-U);EventUtils.addListener(document,"mousemove",scrollManager.mouseMove);EventUtils.addListener(document,"mouseup",scrollManager.mouseUp);EventUtils.addListener(document.body,"mouseout",scrollManager.mouseOut);};this.release=function(T){if(k!=null&&T!=null){var P=parseInt(k.getComponents().button_track.style.top);if(isNaN(P)){P=0;}var U=isNaN(k.getProperty("offsetY"))?0:parseInt(k.getProperty("offsetY"));k.setProperty("offsetY",T.clientY-U);k.setScrolling(false);}k=null;EventUtils.removeListener(document,"mousemove",scrollManager.mouseMove);EventUtils.removeListener(document,"mouseup",scrollManager.mouseUp);EventUtils.removeListener(document.body,"mouseout",scrollManager.mouseOut);};this.move=function(W){var o=null;var T=k.getProperty("trackMin")*1;var U=k.getProperty("trackMax")*1;W-=T;var x=G.getCurrent().getComponents();var P=x.button_up!=null?x.button_up.measures:{"height":0};var v=Math.round(W*G.getCurrent().getProperty("ratio"));v*=-1;if(window.getSelection){o=window.getSelection();}else{if(document.getSelection){o=document.getSelection();}else{if(document.selection){o=document.selection;}}}if(o!=null&&o.empty){o.empty();}else{if(o!=null&&o.removeAllRanges){o.removeAllRanges();}}x.content.style.top=v+"px";};}