/*
  The original source code is provided by Michael Maretzke. 
  The code does not contain any copyright constraints.
  Please use and distribute it whenever and for whatever 
  reasons you want to.
*/ 
// speed - the smaller the faster
var speed = 20; 
// vertical - positive values == from top to bottom; 
// vertical - negative values == from bottom to top
var vertical = -1; 
// the size of the scroller
var size_x = 0;
var x = size_x;
var	ppp;
var	fix_w = 0;

var first = 1;
var	t_id;

var stype=1;	// 1- vertical, 2 - horizontal

function scroll() {
	   
	if ((-x) > (fix_w)){			
		x = 0;
	}
	
	if (stype==1){
		document.getElementById("ScrollerText").style.top = (x+=vertical)+"px";
	}
	if (stype==2){
		document.getElementById("ScrollerText").style.left = (x+=vertical)+"px";
	}
	
	document.getElementById("ScrollerText").style.display = "block";
	
	if (first){
		 if (stype==1){			
		//	fix_w = document.getElementById('container').offsetHeight;						
		}
		fix_w = document.getElementById('container').offsetHeight;						
		
		if (stype==2){
			//	fix_w = document.getElementById('container').offsetWidth;
		}
		
		ppp = document.getElementById('container').innerHTML;
		document.getElementById('container').innerHTML += ppp+ppp+ppp;	
		first = 0;		
	}

}

function initScroller() {	
	t_id = setInterval("scroll()", speed);
}

function stop_scroller() {
	clearInterval(t_id);
}