function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function pre(){

MM_preloadImages('pic/l_zurueck_f2.gif','pic/l_lageplan_f2.gif','pic/l_sitemap_f2.gif','pic/l_home_f2.gif','pic/l_mieter_f2.gif')

}

function auf(url)

{var para = "resizable=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,toolbar=0,width=350,height=550,top=0,left=0";
Fenster = window.open(url,'',para);

Fenster.focus();
}
if (document.referrer.indexOf("xn--rheinhfe-dsseldorf-i3b8j.de")!= -1) {window.location.href="http://www.rheinhöfe.de/"}

if (document.referrer.indexOf("rheinhöfe-düsseldorf.de")!= -1) {window.location.href="http://www.rheinhöfe.de/"}
if (document.referrer.indexOf("rheinhoefe.de")!= -1) {window.location.href="http://www.rheinhöfe.de/"}


function Druck(theWindow) {
  if (!theWindow) theWindow = self;
  var nn = navigator.appName, nv = navigator.appVersion.charAt(0);
  var nw = navigator.appVersion.indexOf('Win');
  if (nn.indexOf('Netscape')!=-1 && nv>='4') theWindow.print();
  else if (nn.indexOf('Microsoft')!=-1 && nv>='4' && nw >= 0) {
    theWindow.focus();
	theWindow.print();
   
  }
  else alert('Auf ihren Rechner funktioniert dieser Befehl nicht. Bitte druecken Sie STRG+P bzw. Apfel+P beim MAC');
}




function formcheck() {
	formarray = new Array("name","firma","email","qm");
	var emtycheck = 0;
	
	for (i=0;i<formarray.length;i++){
		if ((document.FormName[formarray[i]].value == "") ||(document.FormName[formarray[i]].value == "BITTE AUSFUELLEN")){
			emtycheck+=1;
			document.FormName[formarray[i]].value = "BITTE AUSFUELLEN";
		}
	}
	if (emtycheck > 0){
			alert ("Bitte f\xFCllen Sie die Felder mit Sternchen aus.");
			return false;
		}else{
			return true;
	}
	}


var Leerstring = " ist leer. Bitte f\xFCllen Sie dieses Feld aus."

function ueberpruefeForm(form) {
	return 	(pruefeString(document.forms[0].name, "Name") &&
                 pruefeString(document.forms[0].firma, "Firma") &&
                 pruefeString(document.forms[0].email, "E-Mail") &&
				 pruefeString(document.forms[0].qm, "Fl\xE4chenbedarf"))}

function KontrolleNull(eingabe) {
	if ( eingabe.length == 0 ) {
   	return false
	}
	else {
 	return NurSpace(eingabe)
	}
}

function NurSpace(eingabe) {
	for ( var i=0; i<eingabe.length; i++ ) {
   	if ( eingabe.charAt(i) != " " ) {
	   	return true
		}
	}
	return false
}

function zaehleZeichen(eingabe, anz) {
	if ( eingabe.length == anz ) {
		return true
	}
	else {
		return false  
	}
}


function ZahlinBereich(eingabe, unten, oben) {
	var zahl = parseInt(eingabe);
	return ((zahl >= unten) && (zahl <= oben))
}


function pruefeString(eingabe, str) {
	if ( KontrolleNull(eingabe.value) && NurSpace(eingabe.value)) {
		return true
	}	
	else {
		eingabe.focus()
		alert("Das Feld " + str + Leerstring)
		return false
	}
}
