var VSA_scrollAreas=new Array();var VSA_default_imagesPath="images";var VSA_default_btnUpImage="up.gif";var VSA_default_btnDownImage="down.gif";var VSA_default_scrollStep=5;var VSA_default_wheelSensitivity=10;var VSA_default_scrollbarPosition="right";var VSA_default_scrollButtonHeight=11;var VSA_default_scrollbarWidth=20;var VSA_resizeTimer=2000;if(window.addEventListener){window.addEventListener("load",initScrollbars,false)}else{if(window.attachEvent){window.attachEvent("onload",initScrollbars)}}function initScrollbars(){var A=getElements("scrollable","DIV",document,"class");for(var B=0;B<A.length;B++){VSA_scrollAreas[B]=new ScrollArea(B,A[B])}}function ScrollArea(B,C){this.index=B;this.element=C;var A=this.element.getAttribute("imagesPath");this.imagesPath=A?A:VSA_default_imagesPath;A=this.element.getAttribute("btnUpImage");this.btnUpImage=A?A:VSA_default_btnUpImage;A=this.element.getAttribute("btnDownImage");this.btnDownImage=A?A:VSA_default_btnDownImage;A=Number(this.element.getAttribute("scrollStep"));this.scrollStep=A?A:VSA_default_scrollStep;A=Number(this.element.getAttribute("wheelSensitivity"));this.wheelSensitivity=A?A:VSA_default_wheelSensitivity;A=this.element.getAttribute("scrollbarPosition");this.scrollbarPosition=A?A:VSA_default_scrollbarPosition;A=this.element.getAttribute("scrollButtonHeight");this.scrollButtonHeight=A?A:VSA_default_scrollButtonHeight;A=this.element.getAttribute("scrollbarWidth");this.scrollbarWidth=A?A:VSA_default_scrollbarWidth;this.scrolling=false;this.iOffsetY=0;this.scrollHeight=0;this.scrollContent=null;this.scrollbar=null;this.scrollup=null;this.scrolldown=null;this.scrollslider=null;this.scroll=null;this.enableScrollbar=false;this.scrollFactor=1;this.scrollingLimit=0;this.topPosition=0;this.init=VSA_init;this.scrollUp=VSA_scrollUp;this.scrollDown=VSA_scrollDown;this.createScrollBar=VSA_createScrollBar;this.scrollIt=VSA_scrollIt;this.init()}function VSA_init(){this.scrollContent=document.createElement("DIV");this.scrollContent.style.position="absolute";this.scrollContent.innerHTML=this.element.innerHTML;this.scrollContent.style.overflow="hidden";this.scrollContent.style.width=this.element.offsetWidth+"px";this.scrollContent.style.height=this.element.offsetHeight+"px";this.element.innerHTML="";this.element.style.overflow="hidden";this.element.style.display="block";this.element.style.visibility="visible";this.element.style.position="relative";this.element.appendChild(this.scrollContent);this.scrollContent.className="scroll-content";this.element.index=this.index;if(document.all){this.element.onscroll=VSA_handleOnScroll;this.element.onmousewheel=VSA_handleMouseWheel;this.element.onresize=VSA_handleResize}else{this.element.addEventListener("DOMMouseScroll",VSA_handleMouseWheel,false);window.onresize=VSA_handleResize}this.createScrollBar()}function VSA_createScrollBar(){if(this.scrollbar!=null){this.element.removeChild(this.scrollbar);this.scrollbar=null}if(this.scrollContent.scrollHeight<=this.scrollContent.offsetHeight){this.enableScrollbar=false}else{if(this.element.offsetHeight>2*this.scrollButtonHeight){this.enableScrollbar=true}else{this.enableScrollbar=false}}if(this.scrollContent.scrollHeight-Math.abs(this.scrollContent.scrollTop)<this.element.offsetHeight){this.scrollContent.style.top=0}if(this.enableScrollbar){this.scrollbar=document.createElement("DIV");this.element.appendChild(this.scrollbar);this.scrollbar.style.position="absolute";this.scrollbar.style.top="0px";this.scrollbar.style.height=this.element.offsetHeight+"px";this.scrollbar.style.width=this.scrollbarWidth+"px";this.scrollbar.className="vscroll-bar";if(this.scrollbarWidth!=this.scrollbar.offsetWidth){this.scrollbarWidth=this.scrollbar.offsetHeight}this.scrollbarWidth=this.scrollbar.offsetWidth;if(this.scrollbarPosition=="left"){this.scrollContent.style.left=this.scrollbarWidth+5+"px";this.scrollContent.style.width=this.element.offsetWidth-this.scrollbarWidth-5+"px"}else{if(this.scrollbarPosition=="right"){this.scrollbar.style.left=this.element.offsetWidth-this.scrollbarWidth+"px";this.scrollContent.style.width=this.element.offsetWidth-this.scrollbarWidth-5+"px"}}this.scrollup=document.createElement("DIV");this.scrollup.index=this.index;this.scrollup.onmousedown=VSA_handleBtnUpMouseDown;this.scrollup.onmouseup=VSA_handleBtnUpMouseUp;this.scrollup.onmouseout=VSA_handleBtnUpMouseOut;this.scrollup.style.position="absolute";this.scrollup.style.top="10px";this.scrollup.style.zIndex=1000;this.scrollup.style.left="0px";this.scrollup.style.height=this.scrollButtonHeight+"px";this.scrollup.style.width=this.scrollbarWidth+"px";this.scrollup.innerHTML='<img src="'+this.imagesPath+"/"+this.btnUpImage+'" border="0"/>';this.scrollbar.appendChild(this.scrollup);this.scrollup.className="vscroll-up";if(this.scrollButtonHeight!=this.scrollup.offsetHeight){this.scrollButtonHeight=this.scrollup.offsetHeight}this.scrolldown=document.createElement("DIV");this.scrolldown.index=this.index;this.scrolldown.onmousedown=VSA_handleBtnDownMouseDown;this.scrolldown.onmouseup=VSA_handleBtnDownMouseUp;this.scrolldown.onmouseout=VSA_handleBtnDownMouseOut;this.scrolldown.style.position="absolute";this.scrolldown.style.left="0px";this.scrolldown.style.zIndex=1000;this.scrolldown.style.top=this.scrollbar.offsetHeight-this.scrollButtonHeight+-15+"px";this.scrolldown.style.width=this.scrollbarWidth+"px";this.scrolldown.innerHTML='<img src="'+this.imagesPath+"/"+this.btnDownImage+'" border="0"/>';this.scrollbar.appendChild(this.scrolldown);this.scrolldown.className="vscroll-down";this.scroll=document.createElement("DIV");this.scroll.index=this.index;this.scroll.style.position="absolute";this.scroll.style.zIndex=0;this.scroll.style.textAlign="center";this.scroll.style.top=this.scrollButtonHeight+"px";this.scroll.style.left="0px";this.scroll.style.width=this.scrollbarWidth+"px";var A=this.scrollbar.offsetHeight-2*this.scrollButtonHeight;this.scroll.style.height=((A>0)?A:0)+"px";this.scroll.innerHTML="";this.scroll.onclick=VSA_handleScrollbarClick;this.scrollbar.appendChild(this.scroll);this.scroll.style.overflow="hidden";this.scroll.className="vscroll-line";this.scrollslider=document.createElement("DIV");this.scrollslider.index=this.index;this.scrollslider.style.position="absolute";this.scrollslider.style.zIndex=1000;this.scrollslider.style.textAlign="center";this.scrollslider.innerHTML='<div id="scrollslider'+this.index+'" style="padding:0;margin:0;"></div>';this.scrollbar.appendChild(this.scrollslider);this.subscrollslider=document.getElementById("scrollslider"+this.index);this.subscrollslider.style.height=Math.round((this.scrollContent.offsetHeight/this.scrollContent.scrollHeight)*(this.scrollbar.offsetHeight-2*this.scrollButtonHeight))+"px";this.scrollslider.className="vscroll-slider";this.scrollHeight=this.scrollbar.offsetHeight-2*this.scrollButtonHeight-this.scrollslider.offsetHeight;this.scrollFactor=(this.scrollContent.scrollHeight-this.scrollContent.offsetHeight)/this.scrollHeight;this.topPosition=getRealTop(this.scrollbar)+this.scrollButtonHeight;this.scrollslider.style.top=this.scrollButtonHeight+"px";this.scrollslider.style.left="0px";this.scrollslider.style.width="100%";this.scrollslider.onmousedown=VSA_handleSliderMouseDown;if(document.all){this.scrollslider.onmouseup=VSA_handleSliderMouseUp}}else{this.scrollContent.style.width=this.element.offsetWidth+"px"}}function VSA_handleBtnUpMouseDown(){var A=VSA_scrollAreas[this.index];A.scrolling=true;A.scrollUp()}function VSA_handleBtnUpMouseUp(){VSA_scrollAreas[this.index].scrolling=false}function VSA_handleBtnUpMouseOut(){VSA_scrollAreas[this.index].scrolling=false}function VSA_handleBtnDownMouseDown(){var A=VSA_scrollAreas[this.index];A.scrolling=true;A.scrollDown()}function VSA_handleBtnDownMouseUp(){VSA_scrollAreas[this.index].scrolling=false}function VSA_handleBtnDownMouseOut(){VSA_scrollAreas[this.index].scrolling=false}function VSA_scrollIt(){this.scrollContent.scrollTop=this.scrollFactor*((this.scrollslider.offsetTop+this.scrollslider.offsetHeight/2)-this.scrollButtonHeight-this.scrollslider.offsetHeight/2)}function VSA_scrollUp(){if(this.scrollingLimit>0){this.scrollingLimit--;if(this.scrollingLimit==0){this.scrolling=false}}if(!this.scrolling){return }if(this.scrollContent.scrollTop-this.scrollStep>0){this.scrollContent.scrollTop-=this.scrollStep;this.scrollslider.style.top=1/this.scrollFactor*Math.abs(this.scrollContent.scrollTop)+this.scrollButtonHeight+"px"}else{this.scrollContent.scrollTop="0";this.scrollslider.style.top=this.scrollButtonHeight+"px";return }setTimeout("VSA_Ext_scrollUp("+this.index+")",30)}function VSA_Ext_scrollUp(A){VSA_scrollAreas[A].scrollUp()}function VSA_scrollDown(){if(this.scrollingLimit>0){this.scrollingLimit--;if(this.scrollingLimit==0){this.scrolling=false}}if(!this.scrolling){return }this.scrollContent.scrollTop+=this.scrollStep;this.scrollslider.style.top=1/this.scrollFactor*Math.abs(this.scrollContent.scrollTop)+this.scrollButtonHeight+"px";if(this.scrollContent.scrollTop>=(this.scrollContent.scrollHeight-this.scrollContent.offsetHeight)){this.scrollContent.scrollTop=(this.scrollContent.scrollHeight-this.scrollContent.offsetHeight);this.scrollslider.style.top=this.scrollbar.offsetHeight-this.scrollButtonHeight-this.scrollslider.offsetHeight+"px";return }setTimeout("VSA_Ext_scrollDown("+this.index+")",30)}function VSA_Ext_scrollDown(A){VSA_scrollAreas[A].scrollDown()}function VSA_handleMouseMove(B){var A=VSA_scrollAreas[((document.all&&!window.opera)?this.index:document.documentElement.scrollAreaIndex)];var D=0;if(!B){var B=window.event}if(B.pageY){D=B.pageY}else{if(B.clientY){D=B.clientY}}if(document.all&&!window.opera){D+=document.documentElement.scrollTop}var C=D-A.iOffsetY-A.topPosition;C+=A.scrollButtonHeight;if(C<A.scrollButtonHeight){C=A.scrollButtonHeight}if(C>(A.scrollbar.offsetHeight-A.scrollButtonHeight)-A.scrollslider.offsetHeight){C=(A.scrollbar.offsetHeight-A.scrollButtonHeight)-A.scrollslider.offsetHeight}A.scrollslider.style.top=C+"px";A.scrollIt()}function VSA_handleSliderMouseDown(B){var A=VSA_scrollAreas[this.index];if(document.all&&!window.opera){A.scrollslider.setCapture();A.iOffsetY=event.offsetY;A.scrollslider.onmousemove=VSA_handleMouseMove}else{if(window.opera){A.iOffsetY=event.offsetY}else{A.iOffsetY=B.layerY}document.documentElement.scrollAreaIndex=A.index;document.documentElement.addEventListener("mousemove",VSA_handleMouseMove,true);document.documentElement.addEventListener("mouseup",VSA_handleSliderMouseUp,true)}}function VSA_handleSliderMouseUp(){if(document.all&&!window.opera){var A=VSA_scrollAreas[this.index];A.scrollslider.onmousemove=null;A.scrollslider.releaseCapture();A.scrollIt()}else{var A=VSA_scrollAreas[document.documentElement.scrollAreaIndex];document.documentElement.removeEventListener("mousemove",VSA_handleMouseMove,true);document.documentElement.removeEventListener("mouseup",VSA_handleSliderMouseUp,true);A.scrollIt()}}function VSA_handleResize(){if(VSA_resizeTimer){clearTimeout(VSA_resizeTimer);VSA_resizeTimer=0}VSA_resizeTimer=setTimeout("VSA_performResizeEvent()",100)}function VSA_performResizeEvent(){for(var A=0;A<VSA_scrollAreas.length;A++){VSA_scrollAreas[A].createScrollBar()}}function VSA_handleMouseWheel(B){if(!B){B=event}var A=VSA_scrollAreas[this.index];if(A.scrollbar==null){return }A.scrolling=true;A.scrollingLimit=A.wheelSensitivity;if((!window.opera&&(B.wheelDelta>0||B.detail<0))||(window.opera&&!(B.wheelDelta>0||B.detail>0))){A.scrollUp()}else{A.scrollDown()}}function VSA_handleSelectStart(){event.returnValue=false}function VSA_handleScrollbarClick(B){var A=VSA_scrollAreas[this.index];var C=(document.all?event.offsetY:B.layerY);if(C<(A.scrollButtonHeight+A.scrollslider.offsetHeight/2)){A.scrollslider.style.top=A.scrollButtonHeight+"px"}else{if(C>(A.scrollbar.offsetHeight-A.scrollButtonHeight-A.scrollslider.offsetHeight)){A.scrollslider.style.top=A.scrollbar.offsetHeight-A.scrollButtonHeight-A.scrollslider.offsetHeight+"px"}else{A.scrollslider.style.top=C+A.scrollButtonHeight-A.scrollslider.offsetHeight/2+"px"}}A.scrollIt()}function VSA_handleOnScroll(){}function getElements(F,E,G,D){if(!E){E="*"}if(!G){G=document}if(!D){D="name"}var A=[];var B=G.getElementsByTagName(E);for(var C=0;C<B.length;C++){if(B.item(C).className.indexOf(F)!=-1){A.push(B.item(C))}}return A}function getRealTop(B){var A=0;if(B){do{A+=B.offsetTop-B.scrollTop;B=B.offsetParent}while(B)}return A};