function fotoslider() {
	if (document.getElementById("fotoleiste")) {	
	    // horizontal slider control
	    var fotoslider = new Control.Slider('fotohandle', 'fototrack', {
		sliderValue: 0,
		onChange: function(sli) { 
		    scrollHorizontal(sli, $('abschluss'), fotoslider);
		    if (fotoslider.value == 0 || fotoslider.value==1) {fotostopp()};
		}
	    });
			    
	    // disable horizontal scrolling if content doesn't overflow the window
	    if ($('abschluss').scrollWidth <= $('abschluss').offsetWidth) {
		fotoslider.setDisabled();
	    }

	    // scroll the element horizontally based on its width and the slider maximum value
	    function scrollHorizontal(value, element, slider) {
		element.scrollLeft = Math.round(value/slider.maximum*(element.scrollWidth-element.offsetWidth));
	    }
	} // if
}

function fotoweiter() {
if ($('fotoleiste')) {
if ($('abschluss').scrollWidth > $('abschluss').offsetWidth) {
	if (weiter==1) {fotostopp()}
	else {
		if (fotoslider.value == 1) {
			fotoslider.setValueBy(-2);
		}; 
		clearInterval(window.interval);
		window.interval = window.setInterval('fotoslider.setValueBy(0.001)', 3);
		$('rechts').style.background = 'url(image/buttonspfeile/pause.gif) no-repeat bottom right';	
		weiter = 1;
	};
};
};
}

function fotozurueck() {
if ($('fotoleiste')) {
if ($('abschluss').scrollWidth > $('abschluss').offsetWidth) {
	if (weiter==1) {fotostopp()}
	else {
		if (fotoslider.value == 0) {
			fotoslider.setValueBy(+2);
		}; 
		clearInterval(window.interval);
		window.interval = window.setInterval('fotoslider.setValueBy(-0.001)', 3);
		$('links').style.background = 'url(image/buttonspfeile/pause.gif)	no-repeat bottom right';	
		weiter = 1;
	};
};
};
}

function fotostopp() {
if ($('fotoleiste')) {
	clearInterval(window.interval);
	$('rechts').style.background = 'url(image/buttonspfeile/vollpfeilwere.gif) no-repeat bottom right';
	$('links').style.background = 'url(image/buttonspfeile/vollpfeilweli.gif) no-repeat bottom right';
	weiter = 0;
};
}



