SLactualx = 0;
SLmaxx = 3850;
SLschritt = 5;
SLdivbreite = 900;
SLmaxleft = 0+SLdivbreite-SLmaxx;
SLmoving = 0;

/*
function shownumber() {
		try {
		document.getElementById("slideroffset").innerHTML = "Slider-Offset: " + parseInt(document.getElementById('erichswerk').style.marginLeft);
		} catch (e) {
			// do nothing
		}
}
*/

function SLgoleft() {
	SLnewX = SLactualx + SLschritt;
	if (SLnewX > 0-SLschritt) {
		SLmoving = 0;
	} else {
		document.getElementById('erichswerk').style.marginLeft = SLnewX+"px";
		document.getElementById('minime').style.left = SLnewX*-1/12.2+"px";
		//shownumber();
	}
	SLactualx = SLnewX;
	if (SLmoving) window.setTimeout("SLgoleft()",50);
}

function SLgoright() {
	SLnewX = SLactualx - SLschritt;
	if (SLnewX < SLmaxleft) {
		SLmoving = 0;
		SLnewX = SLmaxleft;
	} else {
		document.getElementById('erichswerk').style.marginLeft = SLnewX+"px";
		document.getElementById('minime').style.left = SLnewX*-1/12.2+"px";
		//shownumber();
	}
	SLactualx = SLnewX;
	if (SLmoving) window.setTimeout("SLgoright()",50);
}

function SLgoto(SLwohaere) {
	SLactualx = SLwohaere;
	SLgoright();
}


function oninitslide() {
	new Control.Slider('minime' , 'mini_slide',
		{
			onSlide: function(v) {
				try {
					SLactualx = v*-3000+SLschritt;	
				} catch (e) {
					// do nothing	
				}
				SLgoright();
			},
			onChange: function(v) {
				try {
					SLactualx = v*-3000+SLschritt;	
				} catch (e) {
					// do nothing	
				}
				SLgoright();
			}
		}
	);
	// jumpslide();
}

Event.observe(window,"load", oninitslide);
function jumpslide() {
	if (typeof(jumptoslide) == 'number') {
		ourpicid = 'slidepic'+jumptoslide;
		ourpic = document.getElementById('slidepic'+jumptoslide);
		our_x = parseInt(ourpic.offsetLeft);
		SLgoto(-our_x);
		newsrc = "/images/layout/sliced_header/streifen_hover ("+ jumptoslide + ").jpg";
		ourpic.src = newsrc;
	}
}
