function Fenster (Dateiname,Hoehe)
{
 win = window.open(Dateiname, "Zweitfenster", 'width=600, height='+Hoehe+', top=50, resizable=1, scrollbars=auto');
 win.focus();
}

function chkformular()
{
/*
iFirma       = "Bitte einen Firmennamen eingeben!";
iStrasse     = "Bitte eine Straße eingeben!";
iPLZ         = "Bitte eine Postleitzahl eingeben!";
iOrt         = "Bitte einen Ort eingeben!";
iRegion      = "Bitte ein Land auswählen";
iTelefon     = "Bitte eine Telefonnummer eingeben!";
iMail        = "E-Mail addresse fehlt oder fehlerhaft!";
iGJahr       = "Bitte Gründungsjahr angeben";
iMitarbeiter = "Bitte Zahl der Mitarbeiter angeben";
iBusinessTyp = "Bitte den Unternehmenstyp angeben";
iAnrede      = "Bitte Anrede Herr/Frau angeben";
iVorname     = "Bitte einen Vornamen angeben!";
iNachname    = "Bitte einen Nachnamen angeben!";
iFunktion    = "Bitte Ihre Position/Funktion angeben!";
iSprache     = "Welche Sprachen sprechen Sie?";
iBranche     = "Bitte eine Branche auswählen";
iPasswort    = "Bitte ein Passwort angeben (min. 4 Zeichen)!";
iKooperation = "Für welche Arten von Kooperation interessieren Sie sich?";
iProfilTitel = "Titel - Über was wollen Sie mit wem reden fehlt.";
iText1       = "Angaben zum Produkt, Service, Know-how fehlen";
iText2       = "Angaben zu Kooperationswunsch fehlen.";
iText3       = "Kurze Firmenbeschreibung fehlt";
iFrage1      = "Frage1";
iFrage2      = "Frage2";
iFrage3      = "Frage3";
iFrage4      = "Frage4";
iFrage5      = "Frage5";
*/

iFirma       = "Organisation name missing!";
iStrasse     = "Street missing!";
iPLZ         = "Postal Code missing!";
iOrt         = "City missing!";
iRegion      = "Region/Country missing";
iTelefon     = "Phone missing!";
iMail        = "E-Mail address missing or wrong!";
iGJahr       = "Year of foundation missing";
iMitarbeiter = "Number of employees missing";
iBusinessTyp = "Organisation Type missing";
iAnrede      = "Gender (Mr/Ms) missing";
iVorname     = "First Name missing!";
iNachname    = "Last Name missing!";
iFunktion    = "Position / Function missing!";
iSprache     = "Which language do you speak?";
iBranche     = "Thematic areas (branch) missing!";
iPasswort    = "Passwort missing or to short (min. 4 characters)!";
iKooperation = "What kind of co-opeartion you are interested in?";
iProfilTitel = "Describe the central aim of your organization in one sentence";
iText1       = "Details about your Expertise / Competences / Technologies / RTD know-how missing";
iText2       = "Type and qualification of co-operation partner missing";
iText3       = "Short description of company/organisation missing";
iFrage1      = "Are you a member of Biogas Forum";
iFrage2      = "Information missing";
iFrage3      = "Do you join the Business Club & Reception event?";
iFrage4      = "Do you join the Golf & Business event?";
iFrage5      = "Turnover";

if(document.Formular.firma.value == "")
 { alert(iFirma);
   document.Formular.firma.focus();
   return false; }

if(document.Formular.strasse.value == "")
 { alert(iStrasse);
   document.Formular.strasse.focus();
   return false; }

if(document.Formular.plz.value == "")
 { alert(iPLZ);
   document.Formular.plz.focus();
   return false; }

if(document.Formular.ort.value == "")
 { alert(iOrt);
   document.Formular.ort.focus();
   return false; }

/* Unterschiedliche Abfrage bei select / radio */
if (document.Formular.region.selectedIndex < 2)
{ alert(iRegion);
  document.Formular.region.focus();
  return false; }

/*
var region_ok = false;
for (var i=0; i<document.Formular.region.length; i++)
   if (document.Formular.region[i].checked) region_ok = true;
if (!region_ok) { alert(iRegion);
                  document.Formular.region[0].focus();
                  return false; }
*/

if(document.Formular.telefon.value == "")
 { alert(iTelefon);
   document.Formular.telefon.focus();
   return false; }
/*
if(document.Formular.fax.value == "")
 { alert("Bitte eine Faxnunmer eingeben!");
   document.Formular.fax.focus();
   return false; }
*/

if(chk_mail(document.Formular.kundenmail.value) == false)
 { alert(iMail);
   document.Formular.kundenmail.focus();
   return false; }


if(document.Formular.gjahr.value == "")
 { alert(iGJahr);
   document.Formular.gjahr.focus();
   return false; }

var anzahl_ok = false;
for (var i=0; i<document.Formular.anzahl.length; i++)
   if (document.Formular.anzahl[i].checked) anzahl_ok = true;
if (!anzahl_ok) { alert(iMitarbeiter);
                  document.Formular.anzahl[0].focus();
                  return false; }

var chks = document.Formular.elements['business[]'];
var count = 0;
for (var i=0;i<chks.length;i++)
 if (chks[i].checked) count +=1;
   //alert(chks[i].value);
if (count == 0) { alert(iBusinessTyp);
                  chks[0].focus();
                  return false;
                }


if(document.Formular.anrede[0].checked == false &&
   document.Formular.anrede[1].checked == false )
 { alert(iAnrede);
   document.Formular.anrede[0].focus();
   return false; }

if(document.Formular.vorname.value == "")
 { alert(iVorname);
   document.Formular.vorname.focus();
   return false; }

if(document.Formular.nachname.value == "")
 { alert(iNachname);
   document.Formular.nachname.focus();
   return false; }

if(document.Formular.position.value == "")
 { alert(iFunktion);
   document.Formular.position.focus();
   return false; }

/*
var chks = document.Formular.elements['sprache[]'];
var count = 0;
for (var i=0;i<chks.length;i++)
 if (chks[i].checked) count +=1;
if (count == 0) { alert(iSprache);
                  chks[0].focus();
                  return false;
                }
*/
var chks = document.Formular.elements['branche[]'];
var count = 0;
for (var i=0;i<chks.length;i++)
   if (chks[i].checked) count +=1;
if (count == 0) { alert(iBranche);
                  chks[0].focus();
                  return false;
                }

/*
var ok = false;
var d = document.Formular;

if (d.c1 && (d.c1[0].checked || d.c1[1].checked || d.c1[2].checked) ) ok = true;
if (d.c2 && (d.c2[0].checked || d.c2[1].checked || d.c2[2].checked) ) ok = true;
if (d.c3 && (d.c3[0].checked || d.c3[1].checked || d.c3[2].checked) ) ok = true;
if (d.c4 && (d.c4[0].checked || d.c4[1].checked || d.c4[2].checked) ) ok = true;
if (d.c5 && (d.c5[0].checked || d.c5[1].checked || d.c5[2].checked) ) ok = true;
if (d.c6 && (d.c6[0].checked || d.c6[1].checked || d.c6[2].checked) ) ok = true;

if (!ok)
{ alert(iKooperation);
  document.Formular.c1[0].focus();
  return false;
}
*/

if(document.Formular.titel1.value == "")
 { alert(iProfilTitel);
   document.Formular.titel1.focus();
   return false; }

if(document.Formular.text1.value == "")
 { alert(iText1);
   document.Formular.text1.focus();
   return false; }
/*
if(document.Formular.text2.value == "")
 { alert(iText2);
   document.Formular.text2.focus();
   return false; }

if(document.Formular.text3.value == "")
 { alert(iText3);
   document.Formular.text3.focus();
   return false; }


var anzahl_ok = false;
if(document.Formular.prog1) {
 for (var i=0; i<document.Formular.prog1.length; i++)
    if (document.Formular.prog1[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage1);
                   document.Formular.prog1[0].focus();
                   return false; }
}

var anzahl_ok = false;
if(document.Formular.prog2) {
 for (var i=0; i<document.Formular.prog2.length; i++)
    if (document.Formular.prog2[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage2);
                   document.Formular.prog2[0].focus();
                   return false; }
}

var anzahl_ok = false;
if(document.Formular.prog3) {
 for (var i=0; i<document.Formular.prog3.length; i++)
    if (document.Formular.prog3[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage3);
                   document.Formular.prog3[0].focus();
                   return false; }
}

var anzahl_ok = false;
if(document.Formular.prog4) {
 for (var i=0; i<document.Formular.prog4.length; i++)
    if (document.Formular.prog4[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage4);
                   document.Formular.prog4[0].focus();
                   return false; }
}

*/

if(document.Formular.passkunde.value.length < 4)
 { alert(iPasswort);
   document.Formular.passkunde.focus();
   return false; }

} // ###############  Ende Check Formular  #############################
  // ###################################################################


function isInt(wert) {
  if (wert == "") return false;
  for (i=0; i<4;i++) {
    if (wert.charAt(i) < "0") { return false; }
    if (wert.charAt(i) > "9") { return false; }
  }
}

function chk_mail(s)
{
 var a = false;
 var res = 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})$');
  res = (reg.test(s));
 }
 else
 {
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
 }
 return(res);
}

function chk_talk_anzahl(maxtalks)
{
var chks = document.ListTalkFormular.elements['selected_host_talks[]'];
var count = 0;
for (var i=0;i<chks.length;i++)
 if (chks[i].checked) count +=1;
   //alert(chks[i].value);
if (count > maxtalks)
{ alert("You can book a maximum of " + maxtalks + " talks, only.");
  return false;
}
return true;
}