function Fenster (Dateiname,Hoehe)
{
 win = window.open(Dateiname, "Zweitfenster", 'width=700, height='+Hoehe+', top=50, resizable=1, scrollbars=auto');
 win.focus();
}

function FensterLeer (Text,Hoehe)
{
 win = window.open('', "Zweitfenster", 'width=700, height='+Hoehe+', top=50, resizable=1, scrollbars=auto');
 win.document.write(Text);
 win.document.close();
 win.focus();
}

function checkAll(field)
{ for (i = 0; i < field.length; i++)
  field[i].checked = true ;
}
function uncheckAll(field)
{ for (i = 0; i < field.length; i++)
  field[i].checked = false ;
}

function checkAllMail()
{ count = document.MailFormular.elements.length;
  for (i=0; i < count; i++)
  document.MailFormular.elements[i].checked = 1;
}

function uncheckAllMail()
{ count = document.MailFormular.elements.length;
  for (i=0; i < count; i++)
  document.MailFormular.elements[i].checked = 0;
}


function chkconfirm()
{
if(document.Formular.takepart[0].checked == false &&
   document.Formular.takepart[1].checked == false)
 { alert("Reconfirmation of your participation is missing");
   document.Formular.takepart[0].focus();
   return false; }
}

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)!";
iAntispam    = "Bitte gültigen Antispam Code eingeben";
iKooperation = "Für welche Arten von Kooperation interessieren Sie sich?";
iProfilTyp   = "Bitte den Profiltyp auswählen";
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 languages do you speak?";
iBranche     = "Areas of activities missing!";
iPasswort    = "Passwort missing or to short (min. 4 characters)!";
iAntispam    = "Please insert valid (4 digits) Antispam Code";
iKooperation = "What kind of co-opeartion you are interested in?";
iProfilTyp   = "Type of profile not specified";
iProfilTitel = "Title - About what and with whom you would like to talk about";
iText1       = "Short description about product, technology, service, know-how missing";
iText2       = "Type and qualification of co-operation partner missing";
iText3       = "Short description of company/organisation missing";
iFrage1      = "Frage 1";
iFrage2      = "Frage 2";
iFrage3      = "Frage 3";
iFrage4      = "Frage 4";
iFrage5      = "Frage 5";

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)
{
 if(document.Formular.gjahr.value == "")
  { alert(iGJahr);
    document.Formular.gjahr.focus();
    return false; }
}

if(document.Formular.anzahl)
{
 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[]'];
if(chks)
{
 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 b2b = document.Formular.elements['b2bmeetings[]'];
var B2Bcount = 0;

 if(typeof (b2b.length) == 'undefined') {
    if (b2b.checked) B2Bcount +=1;
 }
 else {
   for (var i=0;i<b2b.length;i++)
      if (b2b[i].checked) B2Bcount +=1;
 }

if(B2Bcount > 0)
{
 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 (d.c7 && (d.c7[0].checked || d.c7[1].checked || d.c7[2].checked) ) ok = true;
 if (d.c8 && (d.c8[0].checked || d.c8[1].checked || d.c8[2].checked) ) ok = true;
 if (d.c9 && (d.c9[0].checked || d.c9[1].checked || d.c9[2].checked) ) ok = true;

 if (!ok)
 { alert(iKooperation);
   document.Formular.c1[0].focus();
   return false;
 }

 if(document.Formular.textorg.value == "")
  { alert(iText3);
    document.Formular.textorg.focus();
    return false; }

 if (document.Formular.type1) {
   var ProfilTyp_ok = false;
   for (var i=0; i<document.Formular.type1.length; i++)
     if (document.Formular.type1[i].checked) ProfilTyp_ok = true;
   if (!ProfilTyp_ok) { alert(iProfilTyp);
                        document.Formular.type1[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; }

} //  Ende B2B Meetings


var anzahl_ok = false;
if(document.Formular.radio1 && document.Formular.radio1_mandatory) {
 for (var i=0; i<document.Formular.radio1.length; i++)
    if (document.Formular.radio1[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage1);
                   document.Formular.radio1[0].focus();
                   return false; }
}

var anzahl_ok = false;
if(document.Formular.radio2 && document.Formular.radio2_mandatory) {
 for (var i=0; i<document.Formular.radio2.length; i++)
    if (document.Formular.radio2[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage2);
                   document.Formular.radio2[0].focus();
                   return false; }
}

var anzahl_ok = false;
if(document.Formular.radio3 && document.Formular.radio3_mandatory) {
 for (var i=0; i<document.Formular.radio3.length; i++)
    if (document.Formular.radio3[i].checked) anzahl_ok = true;
 if (!anzahl_ok) { alert(iFrage3);
                   document.Formular.radio3[0].focus();
                   return false; }
}

var chks = document.Formular.elements['check1[]'];
if(document.Formular.check1_mandatory == true && chks)
{
 var count = 0;
 for (var i=0;i<chks.length;i++)
    if (chks[i].checked) count +=1;
 if (count == 0) { alert(iFrage4);
                   chks[0].focus();
                   return false;
                 }
}

var chks = document.Formular.elements['check2[]'];
if(document.Formular.check2_mandatory == true && chks)
{
 var count = 0;
 for (var i=0;i<chks.length;i++)
    if (chks[i].checked) count +=1;
 if (count == 0) { alert(iFrage5);
                   chks[0].focus();
                   return false;
                 }
}

if(document.Formular.passkunde.value.length < 4)
 { alert(iPasswort);
   document.Formular.passkunde.focus();
   return false; }

if(document.Formular.antispam && document.Formular.antispam.value != document.Formular.antispam2.value)
 { alert(iAntispam);
   document.Formular.antispam.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;
}