function show_recommend () {
	document.getElementById("recommend").style.display = "block";
}

function hide_recommend () {
	stop_hide_recommend = false;

	window.setTimeout(function() {
		if(!stop_hide_recommend) document.getElementById("recommend").style.display = "none";
	}, 1000);

}

function anfrage (page, from_plz, to_plz) {

	if (page == '/web/Deutsch/Online_Angebotserstellung/') {
		var error = false;
		var error_from = false;
		var error_to = false;

		
		from_plz_int = parseInt(from_plz, 10);
		to_plz_int = parseInt(to_plz, 10);

		if( from_plz.length != 5 || from_plz_int <= 0 || from_plz_int > 99999 || isNaN(from_plz_int)) {
			error = true;
			error_from = true;
		}
		
		if ( to_plz.length != 5 || to_plz_int <= 0 || to_plz_int > 99999 || isNaN(to_plz_int)) {
			error = true;
			error_to = true;
		}

		if(error_from) {
			document.getElementById("from_plz").style.backgroundColor = "#ff0000";
			document.getElementById("from_plz").style.color = "#ffffff";
		} else {
			document.getElementById("from_plz").style.backgroundColor = "#F1F1EE";
			document.getElementById("from_plz").style.color = "#4b4b4b";
		}

		if(error_to) {
			document.getElementById("to_plz").style.backgroundColor = "#ff0000";
			document.getElementById("to_plz").style.color = "#ffffff";
		} else {
			document.getElementById("to_plz").style.backgroundColor = "#F1F1EE";
			document.getElementById("to_plz").style.color = "#4b4b4b";
		}

		if(error) return;
		
		if( (from_plz_int >= 60000 && from_plz_int <= 65999 || from_plz_int >= 55100 && from_plz_int <= 55299) || 
			(to_plz_int >= 60000 && to_plz_int <= 65999 || to_plz_int >= 55100 && to_plz_int <= 55299) ) {
			page = '/ugl2/?from_plz='+from_plz_int+'&to_plz='+to_plz_int;
		} else {
			page = '/ugl/?from_plz='+from_plz_int+'&to_plz='+to_plz_int; // standard
		}
		location = page;
	} else if (page == '/neptun/neptun.php/oktopus/page/1/236') {
		window.open(page,'blitzanfrage','width=370,height=426');
	} else if (page != '') {
		location = page;
	}
}

function showPLZs(url) {
	if(url == '/web/Deutsch/Online_Angebotserstellung/') {
		document.getElementById('from_plz').style.display = 'inline-block';
		document.getElementById('to_plz').style.display = 'inline-block';
	} else {
		document.getElementById('from_plz').style.display = 'none';
		document.getElementById('to_plz').style.display = 'none';
	}
}

