<!--


var isDOM = document.getElementById;


d = {
	$: function(id) {
		return document.getElementById(id);
	},
	getByTag: function(tagname) {
		return document.getElementsByTagName(tagname);
	}
}


function getById(id) {
		return document.getElementById(id);
	}


function getParentNodeByType(obj, type) {
		pn = obj.parentNode;
		if (pn.nodeName == type || pn.nodeName == type.toUpperCase()) {
				return pn;
			}
				
		return getParentNodeByType(pn, type);
	}


function removeWhiteSpaceNodes(parobj) {
			var notWhiteSpaceNode = /\S/;
				
			for (i=0;i<parobj.childNodes.length;i++){
				if ((parobj.childNodes[i].nodeType == 3) && (!notWhiteSpaceNode.test(parobj.childNodes[i].nodeValue))) {
					parobj.removeChild(parobj.childNodes[i]);
						i--;
				}
			}
		}

//



function TextScroller() 
{
	
	// @private
	var _d_ = document;
	var _mm_ = "mousemove";
	var _omm_ = "onmousemove";
	var _md_ = "mousedown";
	var _omd_ = "onmousedown";
	var _mu_ = "mouseup";
	var _omu_ = "onmouseup";
	var _omov_ = "onmouseover";
	var _omo_ = "onmouseout";
	var _text = '';
	var aintrvl;
	
	// @public
	this.content = '';
	this.height = '';
	
	
	
	// @private Methods
	this.__init = function() {
				
		removeWhiteSpaceNodes(this.content);
		
		_text = this.content.childNodes[1];
		
		_text.style.height = this.height + 'px';
		_text.style.overflow = 'hidden';
		
		
		//this.__attachHandler(_text, _omov_, __stopScroll);
		//this.__attachHandler(_text, _omo_, this.__startScroll);
		
		this.__startScroll('+');

	}
	
	
	
	this.__startScroll = function() {
		
		
		var dir = '+';
		var y = 0;
		
		aintrvl = setInterval("_animate('+')",50);
		var _tsH = _text.scrollHeight;
		var _tsT = _text.scrollTop;
		
		_animate = function() {
			
			_text.scrollTop = y;
			
			if (dir == '+') {
				y+=1;
				if (y >= (_tsH/1.5)-1) {
					dir = '-';
				}
			} else {
				y-=1;
				if (y <= -20) {
					dir = '+';
					
					//clearInterval(aintrvl)
					//y=0;
					
				}
				
			}
		}	
	
	}
	
	
	this.stopScroll = function() {
		//alert(this);
		clearInterval(aintrvl);
	
	}
	
	this.__attachHandler = function(obj, evt, func) {
			obj.addEventListener(evt, func, false);
	
	}
	
	this.startScroll = function(pnl) {
		this.content = pnl;
		
		this.__init();
		
	}
	
	
	
}



function setTextScroller() {
	pnl = getById("scroll");	
	
	if (pnl) {
		pnl.scroller = new TextScroller();
	
		pnl.scroller.height = 130;
	
		pnl.scroller.startScroll(pnl);
		
	} else {
		return;
	}

}




function domReady()
{
	this.n = typeof this.n == 'undefined' ? 0 : this.n + 1;
	
	if (typeof document.getElementsByTagName != 'undefined' 
		&& (document.getElementsByTagName('body')[0] != null || document.body != null)) {	
		//alert("The DOM is ready!");

	} else if(this.n < 60) {
		setTimeout('domReady()', 250);
	}
};

//domReady();



window.onload = function() {
		setTextScroller();
	};


