function PopupImage (breite, hoehe) {
	x=screen.availWidth/2-breite/2;
	y=screen.availHeight/2-hoehe/2;

	window.open ('popup1.html', '', 'width=' + breite + ', height=' + hoehe + ', left=' +x + ', top=' + y + ', screenX=' + x + ',screenY=' + y + ', toolbar=' + 0 + ', scrollbars=' + 0 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 0 + ', statusbar=' + 0);
}

function PopupKonfigurator (breite, hoehe) {
	x=screen.availWidth/2-breite/2;
	y=screen.availHeight/2-hoehe/2;

	window.open ('http://www.mazda.de/konfigurator/konfiguratorsl.aspx', '', 'width=' + breite + ', height=' + hoehe + ', left=' +x + ', top=' + y + ', screenX=' + x + ',screenY=' + y + ', toolbar=' + 0 + ', scrollbars=' + 1 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 1 + ', statusbar=' + 0);
}

function PopupGebrauchtwagen (breite, hoehe) {
	x=screen.availWidth/2-breite/2;
	y=screen.availHeight/2-hoehe/2;

	window.open ('http://home.mobile.de/AUTOHAUSLUEDERS', '', 'width=' + breite + ', height=' + hoehe + ', left=' +x + ', top=' + y + ', screenX=' + x + ',screenY=' + y + ', toolbar=' + 0 + ', scrollbars=' + 1 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 1 + ', statusbar=' + 0);
}

function PopupVorfuehrWagen (breite, hoehe) {
	x=screen.availWidth/2-breite/2;
	y=screen.availHeight/2-hoehe/2;

	window.open ('popup2.html', '', 'width=' + breite + ', height=' + hoehe + ', left=' +x + ', top=' + y + ', screenX=' + x + ',screenY=' + y + ', toolbar=' + 0 + ', scrollbars=' + 1 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 1 + ', statusbar=' + 0);
}

function PopupGalerie (breite, hoehe) {
	x=screen.availWidth/2-breite/2;
	y=screen.availHeight/2-hoehe/2;

	window.open ('popup3.html', '', 'width=' + breite + ', height=' + hoehe + ', left=' +x + ', top=' + y + ', screenX=' + x + ',screenY=' + y + ', toolbar=' + 0 + ', scrollbars=' + 0 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 0 + ', statusbar=' + 0);
}

function PopupGalerie1 (breite, hoehe) {
	x=screen.availWidth/2-breite/2;
	y=screen.availHeight/2-hoehe/2;

	window.open ('popup4.html', '', 'width=' + breite + ', height=' + hoehe + ', left=' +x + ', top=' + y + ', screenX=' + x + ',screenY=' + y + ', toolbar=' + 0 + ', scrollbars=' + 0 + ', location=' + 0 + ', menubar=' + 0 + ', resizable=' + 0 + ', statusbar=' + 0);
}

function resetDiv(element) {
	var allElems = document.getElementsByTagName('div');

	for (var i = 0; i < allElems.length; i++) {
		var thisElem = allElems[i];

		if (thisElem.className == 'items') {
			if (thisElem.id != element) {
				thisElem.style.display = 'none';
			}
		}
	}
}
  
function toggleDiv(element) {
	if (document.getElementById(element).style.display == 'none')
		document.getElementById(element).style.display = 'block';
}

function PruefungFormularAnfrage () {
	var check = true;

	if (document.form1.Name.value == "") {
		check = false;

		alert ("Hinweis: Bitte geben Sie Ihren Namen an.");

		document.form1.Name.focus ();

		return false;
	}

	else

	if (document.form1.Telefon.value == "") {
		check = false;

		alert ("Hinweis: Bitte geben Sie eine Telefon an.");

		document.form1.Telefon.focus ();

		return false;
	}

	if (check == true) {
		document.form1.submit ();
	}
}

function PruefungFormularCallBack () {
	var check = true;

	if (document.form2.Name.value == "") {
		check = false;

		alert ("Hinweis: Bitte geben Sie Ihren Namen an.");

		document.form2.Name.focus ();

		return false;
	}

	else

	if (document.form2.Telefon.value == "") {
		check = false;

		alert ("Hinweis: Bitte geben Sie eine Telefon an.");

		document.form2.Telefon.focus ();

		return false;
	}

	if (check == true) {
		document.form2.submit ();
	}
}
