//
function KeyDownHandler(btn)
{
	// process only the Enter key
	//var browser = navigator.userAgent.toLowerCase();
	//if (browser.indexOf('msie') > -1)
	//{
		if (event.keyCode == 13)
		{
			// cancel the default submit
			event.returnValue=false;
			event.cancel = true;
			// submit the form by programmatically clicking the specified button
			btn.click();
		}
	//}
}

function JumpToNextField()
{
	if (event.keyCode == 13)
	{
		// cancel the default submit
		event.returnValue=false;
		event.cancel = true;
		document.forms[0].txtVorname.focus();
	}
}

//schliesst die Popups
function PrintThisPage(printPage) 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
         sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 
   
   var winprint=window.open(printPage,"Print",sOption); 
 
    winprint.focus(); 
}

  //schliesst die Popups
  function closePopups()
	{
		//schließt das Parentfenster ab.
		opener.close();
		//schließt selbst ab.
		self.close();
	}

  //setzt die Validierungszeichen
  var zaehler = 0;
  function check(zahl,wert)
	{    
		if (((wert.value != "") && ((wert.id!="email") || ((wert.value.indexOf('@')!=-1) && (wert.value.lastIndexOf('.')>wert.value.indexOf('@'))))) && (wert.selectedIndex!=0))
		{
			eval('document.images.b' + zahl + '.src="/wohngeld.de_neu/images/shared/richtig.gif";');
			zaehler++;
		} 
		else
		{
			eval('document.images.b' + zahl + '.src="/wohngeld.de_neu/images/shared/wrong.gif";');
			if (zaehler >= 2)
			{ zaehler--; }
		}
	}

  //das Auswahlmenü auf der Startseite (redirect)
  function surfto(form) 
	{
		var myindex=form.select1.selectedIndex
		if (form.select1.options[myindex].value != "0")
		{
		location=form.select1.options[myindex].value;
		}
	}

  //Popup-Fenster
  function winPop(url, w, h, myName)
	{
		showme=window.open(url, myName,'width=' + w + ',height=' + h + ',top=50,left=50,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=yes,location=no')
	}
	
  //Video-Popup
  function videoPop(url, w, h, myName)
	{
		showme=window.open(url, myName,'width=' + w + ',height=' + h + ',top=50,left=50,resizable=no,scrollbars=no,menubar=no,toolbar=no,status=no,location=no')
	}

  //setzt den Cursor in das entsprechende Feld
  function setFocus(myTxt)
	{
		document.getElementById(myTxt).focus();
	}		

  //Prüfen der Email
  var zaehler = 0;
  function checkemail(zahl,wert)
	 {  
		if(wert.value.indexOf('@') == -1 || wert.value.indexOf('.') == -1) {
			eval('document.images.b' + zahl + '.src="/wohngeld.de_neu/images/beh_images/falsch.gif";');
			zaehler++; } 
		else {
			eval('document.images.b' + zahl + '.src="/wohngeld.de_neu/images/beh_images/richtig.gif";');
			if (zaehler >= 1) { zaehler--; }
			} 
	  }

   //Die Funktion sollte die Größe des Fensters zur Auflösung anpassen
   function openPopup(url)
	  {
				var w = window.screen.availWidth - 50;
				var h = window.screen.availHeight - 100;
				var fenster = window.open(url,'myPopup','height='+h+',width='+w+',toolbars=no,resizable=yes,scrollbars=yes,top=0,left=0');
				fenster.focus();
	  }
   
   function openPopup800x600(url)
   {
		var w = 795;
		var h = 595;
		var fenster = window.open(url,'myPopup','height='+h+',width='+w+',toolbars=no,resizable=yes,scrollbars=yes,top=0,left=0');
		fenster.focus();
   }
   
   //Festeingestellte Popups
   function openPopupWgcalc(url)
   {
		var w = 550;
		var h = 590;
		var fenster = window.open(url,'myPopup','height='+h+',width='+w+',toolbars=no,resizable=yes,scrollbars=yes,top=50,left=50');
		fenster.focus();
   }
   
   
   
   
   
   
   
   
   
   
   
   
