function showpic(plusminus, max){
	num_now=parseInt(document.getElementById('zahl').firstChild.nodeValue);
	if (plusminus == "plus"){
		plus=num_now+1;
		if (plus > max){
			plus = 1;
		}
	//	alert("plus: "+plus+" num_now: "+num_now);
		hide_all("bgal", max);
		show("bgal"+plus, "block");
		document.getElementById("zahl").firstChild.nodeValue=plus;
		zahl_1=document.getElementById("zahl").childNodes[0].nodeValue;
		if (zahl_1 >= 5 && max > 5 && zahl_1 < 10){
			hide_all("bk", max);
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			for (i=6; i<= 10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 5 && max == 5){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=1; i<6; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 10 && max == 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 10 && max > 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 >10 && max > 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=11; i<16; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else {
			hide_all("bk", max);
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			if (max < 5){
				for (i=1; i<=max; i++){
					bk_full="bk"+i;
					show(bk_full, "block");
				}
			}
			else {
				for (i=1; i<=5; i++){
					bk_full="bk"+i;
					show(bk_full, "block");
				}
			}
		}
	}
	else if (plusminus == "minus"){
		//alert("Nummer: "+nummer+" num_now: "+num_now);
		minus=num_now-1;
		if (minus == 0){
			minus = max;
		}
	//	alert("minus: "+minus+" num_now: "+num_now);
		hide_all("bgal", max);
		show("bgal"+minus, "block");
		document.getElementById("zahl").firstChild.nodeValue=minus;
		zahl_1=document.getElementById("zahl").childNodes[0].nodeValue;
		if (zahl_1 >= 5 && max > 5 && zahl_1 < 10){
			hide_all("bk", max);
			//alert("max: "+max+" Zahl_1:"+zahl_1);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 5 && max == 5){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=1; i<6; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 10 && max == 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 10 && max > 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 >10 && max > 10){
			//alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max);
			for (i=11; i<16; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else {
			hide_all("bk", max);
			//alert("max: "+max+" Zahl_1:"+zahl_1);
			if (max < 5){
				for (i=1; i<=max; i++){
					bk_full="bk"+i;
					show(bk_full, "block");
				}
			}
			else {
				for (i=1; i<=5; i++){
					bk_full="bk"+i;
					show(bk_full, "block");
				}
			}
		}
	}
}
function hide_all(feldname,num){
	//feldname=feld+nummer;
	for (i=1; i<= num; i++){
		feld=feldname+i;
		document.getElementById(feld).style.display='none';
	}
}

function change(Bildname, Dateiname) {

   if (document.images) {
      document.images[Bildname].src = Dateiname }
}
function winopen(url, width, height)
{
	if (height == null)
	{
		height = "550";
	}
	begriff = window.open(url,"_blank","top=30,left=50,toolbar=no,width="+width+",height="+height+",directories=no,status=no,scrollbars=yes,resize=no,menubar=no");
	begriff.focus();
	return;
}
function show(feld, wert){
	//feldname=feld+nummer;
	document.getElementById(feld).style.display=wert;
}
function show_bild(feld, wert, num){
	//feldname=feld+nummer;
	if (num == "null"){
		num_now=parseInt(document.getElementById('zahl').childNodes.nodeValue);
	}
	else{
		num_now=num;
		document.getElementById('zahl').firstChild.nodeValue=num_now;
	}
	document.getElementById(feld).style.display=wert;
	max_j=document.getElementById("max").firstChild.nodeValue;
	zahl_1=document.getElementById("zahl").childNodes[0].nodeValue;
		if (zahl_1 >= 5 && max_j > 5 && zahl_1 < 10){
			hide_all("bk", max_j);
			//alert("max: "+max_j+" Zahl_1:"+zahl_1);
			for (i=6; i< 11; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 5 && max_j == 5){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max_j);
			for (i=1; i<6; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 10 && max_j == 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max_j);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 == 10 && max_j > 10){
		//	alert("max: "+max+" Zahl_1:"+zahl_1);
			hide_all("bk", max_j);
			for (i=6; i<=10; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else if (zahl_1 >10 && max_j > 10){
			//alert("max: "+max_j+" Zahl_1:"+zahl_1);
			hide_all("bk", max_j);
			for (i=11; i<16; i++){
				bk_full="bk"+i;
				show(bk_full, "block");
			}
		}
		else {
			hide_all("bk", max_j);
			//alert("max: "+max_j+" Zahl_1:"+zahl_1);
			if (max_j < 5){
				for (i=1; i<=max_j; i++){
					bk_full="bk"+i;
					show(bk_full, "block");
				}
			}
			else {
				for (i=1; i<=5; i++){
					bk_full="bk"+i;
					show(bk_full, "block");
				}
			}
		}
}
nummer=2;
function wertauslesen(feld){
	alert(document.getElementById(feld).firstChild.nodeValue);
};
function position() {
	var breite_body;
	breite_body=document.body.clientWidth;
	var breite_ganz=parseInt((breite_body-960)/2);
	if (breite_body <= 960){
		var breite = 40;
		var breite2 = 563;
	}
	else{
		var breite = breite_ganz+40;
		var breite2 = breite_ganz+563;
	}
	//alert("Breite "+ breite);
	document.getElementById("kunde").style.left=breite+"px";
}
function position_buttons() {
	var breite_body;
	breite_body=document.body.clientWidth;
	var breite_ganz=parseInt((breite_body-960)/2);
	if (breite_body <= 960){
		var breite = 40;
		var breite2 = 563;
	}
	else{
		var breite = breite_ganz+40;
		var breite2 = breite_ganz+563;
	}
	//alert("Breite "+ breite);
	document.getElementById("formular-buttons").style.left=breite2+"px";
}
function openwin(url)
{
	begriff = window.open(url,"window","top=30,left=50,toolbar=no,width=200,height=300,directories=no,status=no,scrollbars=no,resize=no,menubar=no");
	begriff.focus();
	return;
}
function openwinvideo (url, breite, hoehe){
	begriff = window.open(url,"popup","top=30,left=50,toolbar=no,width="+breite+",height="+hoehe+",directories=no,status=no,scrollbars=no,resize=no,menubar=no");
	begriff.focus();
	return;
}
