var speed = 20;
var txt_x_coord = 0;
var laufrichtung = "links";

var x;
var ticker_width;
var stepping = 1;
var text_width;

function Init() {
	text = eval(document.getElementById("ticker_text"));
	text.style.position = "absolute";
	text.style.top = 0;
	text.style.left = 0;
	text_width = text.offsetWidth;
	text.onmouseover=function(){change_stepping(0)};
	text.onmouseout=function(){change_stepping(1)};
	
	var ticker = eval(document.getElementById("ticker"));
	var ticker_height = ticker.offsetHeight;
	ticker_width = parseInt(ticker.style.width);
	ticker.style.clip = 'rect(0px,'+ticker_width+'px,'+ticker_height+'px,0px)';
	/*
	ticker_width = ticker.style.clip.split(",");
	ticker_width = parseInt(ticker_width[1].replace(/px/, ""));
	*/
	move();
}

function move() {
	if (laufrichtung == "links"){
		txt_x_coord -= stepping;
		if(txt_x_coord < -text_width) txt_x_coord = ticker_width;
		text.style.left = txt_x_coord;
	}else{
		txt_x_coord += stepping;
		if(txt_x_coord > ticker_width) txt_x_coord = 0;
		text.style.left = txt_x_coord;
	}
	window.setTimeout("move()",speed);
}

function change_stepping(num) {
	stepping = num;
}

