var img;
var pos = new Array(0, 200, 400, 600, 800);
var stop = false;

function $(id) {
	return document.getElementById(id);
}
function initscroll() {
	$('bilder').style.position = 'relative';
	$('bilder').style.height = '150px';
	var div = $('bilder').getElementsByTagName('div');
	for(var i=0; i<div.length; i++) {
		style = div[i].style;
		style.display = 'block';
		style.width = '1px';
    style.height = '150px';
		if(i<div.length/2) {
			style.left = i+'px';
			proz = 1/(div.length/2+1)*(div.length/2-i);
		}
		else {
			style.right = (div.length-i-1)+'px';
			proz = 1/(div.length/2+1)*(div.length/2-div.length+i+1);
		}
		style.filter = 'Alpha(opacity='+Math.round(proz*100)+')';
		style.MozOpacity = proz;
		style.KhtmlOpacity = proz;
		style.opacity = proz;
	}
	/*style = $('bilder').getElementsByTagName('span')[0].style;
	style.display = 'block';
	style.left = div.length/2+'px';
	style.right = div.length/2+'px';
	style.cursor = 'pointer';*/
	img = $('bilder').getElementsByTagName('img');
	for(var i=0; i<img.length; i++) {
		img[i].style.width = '200px';
		img[i].style.height = '150px';
		img[i].style.position = 'absolute';
		img[i].style.top = '0px';
		img[i].style.left = pos[i]+'px';
	}
	scroll();
}
function scroll() {
	if(!stop) for(var i=0; i<img.length; i++) {
		pos[i]-=2;
		if(pos[i]<=-200) pos[i]+=1000;
		img[i].style.left = pos[i]+'px';
	}
	window.setTimeout('scroll();',50);
}
function mouseover() {
	stop = true;
}
function mouseout() {
	stop = false;
}
