function TextScroll(scrollname, div_name) {

	this.div_name = div_name;
	this.name = scrollname;
	this.scrollCursor = 0;
	this.speed = 10;
	this.timeoutID = 0;
	this.div_obj = null;
	this.navs = null;
	this.up_name = null;
	this.dn_name = null;
	
	{
		if (document.getElementById) {
			div_obj = document.getElementById(this.div_name);
			if (div_obj) {
				this.div_obj = div_obj;
				this.up_name = div_obj.parentNode.getElementsByTagName('a')[1];
				this.dn_name = div_obj.parentNode.getElementsByTagName('a')[0]; 
				
                this.div_obj.style.overflow = 'hidden';
			}
           
			
			this.up_name.onmouseover = function () {allow_wheel = false; eval(scrollname + ".scrollUp();");}
			this.up_name.onmouseout = function () {allow_wheel = true;	eval(scrollname + ".stopScroll();");}
			this.up_name.onclick = function () {return false;}
			
			this.dn_name.onmouseover = function () {allow_wheel = false; eval(scrollname + ".scrollDown();");}
			this.dn_name.onmouseout = function () {allow_wheel = true; eval(scrollname + ".stopScroll();");}
			this.dn_name.onclick = function () {return false;}
			
			
			
			
		
			
			
        }
    }

	this.stopScroll = function() {
		clearTimeout(this.timeoutID);
		//this.up_name.style.visibility = 'hidden';
		//this.dn_name.style.visibility = 'hidden';
		//this.div_obj.removeClass('no_hovers');
	}

	this.scrollUp = function() {
		if (this.div_obj) {
			// this.scrollCursor = (this.scrollCursor - this.speed) < 0 ? 0 : this.scrollCursor - this.speed;
			if(this.scrollCursor - this.speed>0) {
				this.scrollCursor=this.scrollCursor - this.speed; 
				/*if(allow_wheel == false)*/ this.up_name.style.visibility = 'visible';
			}
			else {
				this.scrollCursor=0; 
				/*if(allow_wheel == false)*/ this.up_name.style.visibility = 'hidden';
			}
			
			this.div_obj.scrollTop = this.scrollCursor;
			 this.timeoutID = setTimeout(this.name + ".scrollUp()", 60);
			
			if (this.div_obj.scrollTop == this.scrollCursor) {
				/*if(allow_wheel==false)*/ {this.dn_name.style.visibility = 'visible'; }
			}
			else {this.dn_name.style.visibility = 'hidden';}
		}
		
		//this.div_obj.addClass('no_hovers');
	}

	this.scrollDown = function() {
		if (this.div_obj) {
			this.scrollCursor += this.speed;
			this.div_obj.scrollTop = this.scrollCursor;
			
			if (this.div_obj.scrollTop == this.scrollCursor) {
				 this.timeoutID = setTimeout(this.name + ".scrollDown()", 60);  
				this.dn_name.style.visibility = 'visible';
			}
			else {
				this.scrollCursor = this.div_obj.scrollTop; 
				/*if(allow_wheel==false) */ this.dn_name.style.visibility = 'hidden';
			}
			
			if(this.scrollCursor - this.speed>0) {
				/*if(allow_wheel == false)*/ this.up_name.style.visibility = 'visible';
			}
			else {
				/*if(allow_wheel == false)*/ this.up_name.style.visibility = 'hidden';
			}
			
			
		}

		//this.div_obj.addClass('no_hovers');
	}	

	this.resetScroll = function() {
		if (this.div_obj) {
			this.div_obj.scrollTop = 0;
			this.scrollCursor = 0;
		}
	}}

  