// http://www.nachhilfe.com/files/default.js 4.0.6 (9/22/09)
// Copyright (c) Florian Fink http://www.florian-fink.de/
// Alle Rechte vorbehalten.

if ((top.frames.length > 0) || (top.location.href.indexOf("www.nachhilfe.com") == -1)) {
	top.location.replace("http://www.nachhilfe.com/");
}

function open_window(window_url,window_name,window_width,window_height,window_resizable,window_scrollbars) {
	window_name = Math.round(Math.random() * 1000);
	remote_window = window.open(window_url,window_name,"width=" + window_width + ",height=" + window_height + ",resizable=" + window_resizable + ",scrollbars=" + window_scrollbars + ",toolbar=0,status=0,directories=0,location=0,menubar=0");
}

function write_swf(swf_path,swf_movie,swf_width,swf_height,swf_bgcolor) {
	swf_tab = "\t\t\t\t\t\t\t";
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0\" id=\"" + swf_movie + "\" width=\"" + swf_width + "\" height=\"" + swf_height + "\">\n");
	document.write(swf_tab + "\t<param name=\"movie\" value=\"" + swf_path + swf_movie + ".swf\">\n");
	document.write(swf_tab + "\t<param name=\"loop\" value=\"true\">\n");
	document.write(swf_tab + "\t<param name=\"quality\" value=\"high\">\n");
	document.write(swf_tab + "\t<param name=\"wmode\" value=\"transparent\">\n");
	document.write(swf_tab + "\t<param name=\"salign\" value=\"lt\">\n");
	document.write(swf_tab + "\t<param name=\"bgcolor\" value=\"#" + swf_bgcolor + "\">\n");
	document.write(swf_tab + "\t<embed src=\"" + swf_path + swf_movie + ".swf\" loop=\"true\" quality=\"high\" wmode=\"transparent\" salign=\"lt\" bgcolor=\"#" + swf_bgcolor + "\" width=\"" + swf_width + "\" height=\"" + swf_height + "\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">\n");
	document.write(swf_tab + "\t</embed>\n");
	document.write(swf_tab + "</object>");
}

form_submit = 0;

function check_mail() {
	form_valid = 0;
	if ((document.mail_form.schueler1.checked == true) || (document.mail_form.schueler2.checked == true) || (document.mail_form.schueler3.checked == true) || (document.mail_form.schueler4.value != "")) {
		form_valid++;
	}
	if ((form_valid != 1) || (document.mail_form.name.value == "") || (document.mail_form.strasse.value == "") || (document.mail_form.plzort.value == "") || (document.mail_form.email.value == "") || (document.mail_form.email.value.indexOf(" ") != -1) || (document.mail_form.email.value.indexOf(":") != -1) || (document.mail_form.email.value.indexOf("/") != -1) || (document.mail_form.email.value.indexOf("@") == -1) || (document.mail_form.email.value.indexOf(".") == -1)) {
		alert("Bitte fuellen Sie alle Felder korrekt aus. Ihre Nachricht kann sonst nicht bearbeitet werden. Vielen Dank.");
	}
	else {
		if (form_submit == 0) {
			form_submit = 1;
			document.mail_form.id.value = navigator.userAgent;
			document.mail_form.submit();
		}
	}
}

function check_application() {
	form_valid = 0;
	if ((document.application_form.fach1.checked == true) || (document.application_form.fach2.checked == true) || (document.application_form.fach3.checked == true) || (document.application_form.fach4.checked == true) || (document.application_form.fach5.checked == true) || (document.application_form.fach6.checked == true) || (document.application_form.fach7.checked == true) || (document.application_form.fach8.checked == true) || (document.application_form.fach9.checked == true) || (document.application_form.fach10.checked == true) || (document.application_form.fach11.checked == true) || (document.application_form.fach12.checked == true) || (document.application_form.fach13.checked == true) || (document.application_form.fach14.checked == true) || (document.application_form.fach15.checked == true) || (document.application_form.fach16.checked == true) || (document.application_form.fach17.checked == true) || (document.application_form.fach18.checked == true) || (document.application_form.fach19.checked == true)) {
		form_valid++;
	}
	if ((document.application_form.automobil[0].checked == true) || (document.application_form.automobil[1].checked == true) || (document.application_form.automobil[2].checked == true)) {
		form_valid++;
	}
	if ((document.application_form.erfahrung[0].checked == true) || (document.application_form.erfahrung[1].checked == true) || (document.application_form.erfahrung[2].checked == true)) {
		form_valid++;
	}
	if ((form_valid != 3) || (document.application_form.name.value == "") || (document.application_form.strasse.value == "") || (document.application_form.plzort.value == "") || (document.application_form.telefonprivat.value == "") || (document.application_form.email.value == "") || (document.application_form.email.value.indexOf(" ") != -1) || (document.application_form.email.value.indexOf(":") != -1) || (document.application_form.email.value.indexOf("/") != -1) || (document.application_form.email.value.indexOf("@") == -1) || (document.application_form.email.value.indexOf(".") == -1) || (document.application_form.ausbildung.value == "")) {
		alert("Bitte fuellen Sie alle Felder korrekt aus. Ihre Bewerbung kann sonst nicht bearbeitet werden. Vielen Dank.");
	}
	else {
		if (form_submit == 0) {
			form_submit = 1;
			document.application_form.id.value = navigator.userAgent;
			document.application_form.submit();
		}
	}
}
