﻿// JavaScript Document
		function initScrollerText(txtID,endBtns) {
			if ($(txtID).scrollHeight > $(txtID).offsetHeight) {
				initTextBtn("Down",endBtns,txtID)
			}
		}
		 
		function initTextBtn(Dir,endBtns,txtID) {
			varDuration = ($(txtID).scrollHeight-$(txtID).offsetHeight)*30
			TextScroller = new Fx.Scroll(txtID, {
				wait: false,
				duration: varDuration,
				transition: Fx.Transitions.linear
					,onComplete: function() {
						if ($(txtID).scrollTop >0) {
							removeScrollerFromDir("Down",endBtns)
						} else {
							removeScrollerFromDir("Up",endBtns)
						}
					}
			});

			if ($("btn"+Dir+endBtns).innerHTML == "" || $("btn"+Dir).innerHTML == null) {
				$("btn"+Dir+endBtns).innerHTML ="<img border='0' id='arrow"+Dir+endBtns+"' width='7px' height='6px' style='font-size:0px;height:6px' src='images/arrow"+Dir+".png'/>";
				document.getElementById("arrow"+Dir+endBtns).onload = function () {correctOnePng($("arrow"+Dir+endBtns))}
				if (Dir == "Down") {
					document.getElementById("btn"+Dir+endBtns).onmouseover = function () {initTextBtn("Up",endBtns,txtID); TextScroller.toBottom() }
				} else {
					document.getElementById("btn"+Dir+endBtns).onmouseover = function () {initTextBtn("Down",endBtns,txtID); TextScroller.toTop() }
				}
				document.getElementById("btn"+Dir+endBtns).onmouseout = function () { TextScroller.stop() }
			}
		}
		
		function removeScrollerFromDir(Dir,endBtns) {
			$("btn"+Dir+endBtns).innerHTML = "" 
			$("btn"+Dir+endBtns).onmouseover = "" 
			$("btn"+Dir+endBtns).onmouseout = "" 
			$("btn"+Dir+endBtns).className = "" 
		}
