



function printwindow() {
	if (window.print) window.print();
}

/*
-------------------------------
--  tabg hover -----
-------------------------------
*/



function navover(wo,clname) {
	if (document.getElementById) wo.className = clname;
}

function navout(wo,clname) {
	if (document.getElementById) wo.className = clname;

}



/*
-------------------------------
--  gen formfield checker -----
-------------------------------
*/

var formcheckerinfo=""; // global var for alerttext after formcheck

// expects selectlist-obj; returns true if entry != "none"
function checkSelectlist(listobj) {
	var isok = false;

	if (listobj.value != "") isok = true;
	
	return isok;
}

function isEmail(theemail) { // expects inputfield-obj
	var isok = false;
	var a = false;
	if(typeof(RegExp) == 'function'){
		var b = new RegExp('abc');
		if(b.test('abc') == true){a = true;}
	}
	
	if(a == true){
		reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+'(\\@)([a-zA-Z0-9\\-\\.]+)'+'(\\.)([a-zA-Z]{2,4})$');
		isok = (reg.test(theemail.value));
	}
	
	else {
		isok = (theemail.search('@') >= 1 &&
	    theemail.lastIndexOf('.') > emailstring.search('@') &&
	    theemail.lastIndexOf('.') >= emailstring.length-5)
	}
	
	return(isok);
	
}

function isEmpty(textfield) {// expects inputfield-obj
		var isok = true;
	
		if (textfield.value != "") isok = false;
	
		
		return isok;
	}
	

/*
-------------------------------
----      formchecker     -----
-------------------------------
*/


function bookformCheck(bookingform) {
	var isok = false;
	formcheckerinfo = "";
	
	if (!checkSelectlist(bookingform.anrede)) formcheckerinfo += "-> Anrede\n";
	if (isEmpty(bookingform.name)) formcheckerinfo += "-> Name\n";
	if (!isEmail(bookingform.email)) formcheckerinfo += "-> E-Mail\n";
	
	if (formcheckerinfo == "") isok = true;
	else {
		formcheckerinfo = "Bitte überprüfen Sie Ihre Eingabe für folgende Felder:\n\n" + formcheckerinfo;
		alert(formcheckerinfo);
	}
	return isok;
}

function anfrageCheck(anfrageform) {
	var isok = false;
	formcheckerinfo = "";
	
	if (!checkSelectlist(anfrageform.anrede)) formcheckerinfo += "-> Anrede\n";
	if (isEmpty(anfrageform.name)) formcheckerinfo += "-> Name\n";
	if (!isEmail(anfrageform.email)) formcheckerinfo += "-> E-Mail\n";
	
	if (formcheckerinfo == "") isok = true;
	else {
		formcheckerinfo = "Bitte überprüfen Sie Ihre Eingabe für folgende Felder:\n\n" + formcheckerinfo;
		alert(formcheckerinfo);
	}
	return isok;
}

function orderformCheck(anfrageform) {
	var isok = false;
	formcheckerinfo = "";
	
	if (!checkSelectlist(anfrageform.anrede)) formcheckerinfo += "-> Anrede\n";
	if (isEmpty(anfrageform.name)) formcheckerinfo += "-> Name\n";
	if (isEmpty(anfrageform.plz)) formcheckerinfo += "-> PLZ\n";
	if (isEmpty(anfrageform.ort)) formcheckerinfo += "-> Ort\n";
	if (!isEmail(anfrageform.email)) formcheckerinfo += "-> E-Mail\n";
	
	if (formcheckerinfo == "") isok = true;
	else {
		formcheckerinfo = "Bitte überprüfen Sie Ihre Eingabe für folgende Felder:\n\n" + formcheckerinfo;
		alert(formcheckerinfo);
	}
	return isok;
}