function validfields(theform) {
	var element_plz = theform.plz;
	var element_plz_value = element_plz.value;
	
	var element_ort = theform.ort;
	var element_ort_value = element_ort.value;

	var ErgebnisPLZ = true;
	var ErgebnisOrt = true;
	var error = 0;
	var Texthinweis = '';

	if (element_plz_value == '' && element_ort_value == '')  {
		element_plz.style.backgroundColor='#FFB9B9';
		element_ort.style.backgroundColor='#FFB9B9';
		document.getElementById('error_box').innerHTML = '';
		document.getElementById('error_box').innerHTML = 'Bitte geben Sie eine PLZ und /<br />oder einen Ort ein';
		return false;
	}
	else document.getElementById('error_box').innerHTML = '&nbsp;';

	if  (element_plz_value != '') {
		if (isNaN(element_plz_value)) {
			ErgebnisPLZ = false;
			Texthinweis = 'Bitte geben Sie nur Zahlen für die PLZ ein!';
		}
		if ((element_plz_value.length) <= 2 && !isNaN(element_plz_value)) {
			ErgebnisPLZ = false;
			Texthinweis = 'Bitte mindestens 3 Zahlen ein!';
		}
		
		if ((element_plz_value.length) > 5 && !isNaN(element_plz_value)) {
			ErgebnisPLZ = false;
			Texthinweis = 'Bitte maximal 5 Zahlen ein!';
		}
	}
	
	if (element_ort_value != '') {
		if ((element_ort_value.length) <= 2) {
			ErgebnisOrt = false;
			if (Texthinweis != '') Texthinweis = Texthinweis+'<br />Bitte mindestens 3 Buchstaben ein!';
			else Texthinweis = 'Bitte mindestens 3 Buchstaben ein!';
		}
		else if (!isNaN(element_ort_value)) {
			ErgebnisOrt = false;
			if (Texthinweis != '') Texthinweis = Texthinweis+'<br />Bitte geben Sie nur Buchstaben für den Ort ein!';
			else Texthinweis = 'Bitte geben Sie nur Buchstaben für den Ort ein!';
		}
	}
	
	if (ErgebnisPLZ == false) {
		element_plz.style.backgroundColor='#FFB9B9';
		error = 1;
	}
	else if (ErgebnisPLZ == true) {
		element_plz.style.backgroundColor='#FFFFFF';
	}
	
	if (ErgebnisOrt == false) {
		element_ort.style.backgroundColor='#FFB9B9';
		error = 1;
	}
	else if (ErgebnisOrt == true) {
		element_ort.style.backgroundColor='#FFFFFF';
	}
	if (Texthinweis != '') document.getElementById('error_box').innerHTML = Texthinweis;
	else document.getElementById('error_box').innerHTML = '';
	
	if (error == 1) return false;
	else return true;
}

function fenster(path){
	var win;
	win=window.open(path,"HPOL","width=650,height=420,resizeable=no,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,left=100,top=100");
}
 
function fenster2(path){
	var win2;
	win2=window.open(path,"HPOL","width=250,height=160,resizeable=no,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,left=100,top=100");
}

function switchColor(id,color,type) {
	//if (color == '#7EC3FF' && type='3') 
	var value = document.getElementById(id).style.backgroundColor;
	var colorclick = '#7EC3FF';

	switch (type) {
		default: break;
		case 'click':
			document.getElementById(id).style.backgroundColor = color;
			break;
		case 'over':
			 document.getElementById(id).style.backgroundColor = color;
			break;
		
		case 'out':
			document.getElementById(id).style.backgroundColor = color;
			break;
	}
}