﻿// JavaScript Document
		function initScrollerText(txtID,endBtns) {
			if ($(txtID).scrollHeight > $(txtID).offsetHeight) {
				initTextBtn("Down",endBtns,txtID)
			}
		}
		 
		function initTextBtn(Dir,endBtns,txtID) {
			if (Dir == "Down") {
				gap = $(txtID).scrollTop
			} else {
				gap = $(txtID).scrollHeight - $(txtID).offsetHeight - $(txtID).scrollTop
			}
			varDuration = gap*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='9px' height='8px' style='font-size:0px;height:8px' src='images/arrow"+Dir+".gif'/>";
				document.getElementById("arrow"+Dir+endBtns).onload = function () {}//correctOnePng($("arrow"+Dir))}
				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() }
				}
				if ($("div"+Dir)!=null) {
					$("div"+Dir).style.visibility = "visible"						
				}
				document.getElementById("btn"+Dir+endBtns).onmouseout = function () { TextScroller.stop() }
			}
		}
		
		function removeScrollerFromDir(Dir,endBtns) {
			$("div"+Dir).style.visibility = "hidden"						
			$("btn"+Dir+endBtns).innerHTML = "" 
			$("btn"+Dir+endBtns).onmouseover = "" 
			$("btn"+Dir+endBtns).onmouseout = "" 
			$("btn"+Dir+endBtns).className = "" 
		}

