<!--

function showForm() {
  if (document.getElementById)
    document.getElementById('family_form1').style.visibility = "visible";
    document.getElementById('family_form1').style.display = "block";
    document.getElementById('family_form2').style.visibility = "visible";
    document.getElementById('family_form2').style.display = "block";
    document.getElementById('family_button').style.visibility = "visible";
    document.getElementById('family_button').style.display = "none";
}

function javascriptAlert() {
  if (document.getElementById)
    document.getElementById('alert').style.visibility = "visible";
    document.getElementById('alert').style.display = "none";
}

function validateProgram(id)
{
 var pid = 'Programm' + String(id)
/* var uid = 'Unterkunft' + String(id)*/
 var combo = document.getElementById(pid).selectedIndex;
 if(combo == 1) {
 setValues(pid, '15', 'Ja', 'Ja', 'Nein', 'keine');
/* setHousingHidden(uid);*/
 } else if(combo == 2) {
 setValues(pid, '35', 'Ja', '-', 'Ja', 'Sammelunterbringung');
/* setHousingVisible1(uid);*/
 } else if(combo == 3) {
 setValues(pid, '60', 'Ja', '-', 'Ja', 'Jugendherb./Gästeh.');
/* setHousingVisible2(uid);*/
 } else if(combo == 4) {
 setValues(pid, '50', 'Ja', 'Ja', 'Nein', 'keine');
/* setHousingHidden(uid);*/
 } else if(combo == 0) {
 setValues(pid, '0', 'Ja', 'Ja', 'Nein', 'keine');
/* setHousingHidden(uid);*/
 }
 sumOfPrice();
}

function setValues(id, price, program, meals, house, houseInclusive) {
 document.getElementById(id + 'Price').innerHTML = price;
 document.getElementById(id + 'Program').innerHTML = program;
 document.getElementById(id + 'Meals').innerHTML = meals;
 document.getElementById(id + 'House').innerHTML = house;
 document.getElementById(id + 'Houseinclusive').innerHTML = houseInclusive;
}


function sumOfPrice() {
 var sum = 0;
 for (var i = 1 ; i <= 8; i++)
   if(document.getElementById('Programm' + String(i) + 'Price')){
      sum = sum + Number(document.getElementById('Programm' + String(i) + 'Price').firstChild.nodeValue);
     }
 document.getElementById('sumOfPrice').innerHTML = sum;
}

function sumOfHousing() {
 var sum = 0;
 if (document.getElementById('DZ_Spindelhof').value.charAt(0) < "0" ||
        document.getElementById('DZ_Spindelhof').value.charAt(0) > "9"){
    alert("Bitte geben Sie eine Zahl ein!");
    document.getElementById('DZ_Spindelhof').focus();
    return false;}
 if (document.getElementById('EZ_Spindelhof').value.charAt(0) < "0" ||
        document.getElementById('EZ_Spindelhof').value.charAt(0) > "9"){
    alert("Bitte geben Sie eine Zahl ein!");
    document.getElementById('EZ_Spindelhof').focus();
    return false;}
 if (document.getElementById('Jugendherberge').value.charAt(0) < "0" ||
        document.getElementById('Jugendherberge').value.charAt(0) > "9"){
    alert("Bitte geben Sie eine Zahl ein!");
    document.getElementById('Jugendherberge').focus();
    return false;}
 sum = Number(document.getElementById('DZ_Spindelhof').value)*25*3 + Number(document.getElementById('EZ_Spindelhof').value)*30*3 + Number(document.getElementById('Jugendherberge').value)*20*3;
 document.getElementById('sumOfHousing').innerHTML = sum;
 }

/*outdated code*/


function setHousingHidden(id) {
 if (document.getElementById(id).options.length == 2) {
 document.getElementById(id).options[1] = null;
 document.getElementById(id).selectedIndex = 0;
 }
}

function setHousingVisible1(id) {
 var value = "Sammelunterbringung (0 EUR)"
 if (document.getElementById(id).options.length == 1) {
 NeuerEintrag = new Option(value, value, false, true);
 document.getElementById(id).options[1] = NeuerEintrag;
 }
 if (document.getElementById(id).options.length == 2) {
 document.getElementById(id).options[1] = null;
 document.getElementById(id).selectedIndex = 0;
 NeuerEintrag = new Option(value, value, false, true);
 document.getElementById(id).options[1] = NeuerEintrag;
 }
}


function setHousingVisible2(id) {
 var value = "Jugendherb./Gästehaus"
 if (document.getElementById(id).options.length == 1) {
 NeuerEintrag = new Option(value, value, false, true);
 document.getElementById(id).options[1] = NeuerEintrag;
 }
 if (document.getElementById(id).options.length == 2) {
 document.getElementById(id).options[1] = null;
 document.getElementById(id).selectedIndex = 0;
 NeuerEintrag = new Option(value, value, false, true);
 document.getElementById(id).options[1] = NeuerEintrag;
 }
}




function setHousingHidden(id) {
 if (document.getElementById(id).options.length == 5) {
 document.getElementById(id).options[4] = null;
 document.getElementById(id).selectedIndex = 0;
 }
}

function setHousingVisible(id) {
 var value = "Sammelunterbringung (0 EUR)"
 if (document.getElementById(id).options.length == 4) {
 NeuerEintrag = new Option(value, value, false, true);
 document.getElementById(id).options[4] = NeuerEintrag;
 }
}

function makeNET(o) { o.innerHTML = "15 EUR</td><td>Ja</td> <td>Ja</td><td></td>";}

function makeJugendliche(o) { o.innerHTML = "35 EUR </td><td>Ja</td><td></td><td>Ja</td>";}

function makeJunge(o) { o.innerHTML = "60 EUR: Teilnahme am Programm, Vollverpflegung, Sammelunterbringung";}

function makeErwachsene(o) { o.innerHTML = "50 EUR: Teilnahme am Programm, Hauptmahlzeiten"; }

function makeKind(o) { o.innerHTML = "0 EUR: Teilnahme am Programm, Hauptmahlzeiten";}


function AjaxRequestNET() { makeNET(document.getElementById('programDetails1')); }

function AjaxRequestJugendliche() { makeJugendliche(document.getElementById('programDetails1')); }

function AjaxRequestJunge() { makeJunge(document.getElementById('programDetails1')); }

function AjaxRequestErwachsene() { makeErwachsene(document.getElementById('programDetails1')); }

function AjaxRequestKind() { makeKind(document.getElementById('programDetails1')); }



function checkFormular () {
  if (document.anmeldeformular.Nachname1.value == "") {
    alert("Bitte Ihren Namen eingeben!");
    document.anmeldeformular.Nachname1.focus();
    return false;
  }
  if (document.anmeldeformular.Vorname1.value == "") {
    alert("Bitte Ihren Vornamen eingeben!");
    document.anmeldeformular.Vorname1.focus();
    return false;
  }
  if (document.anmeldeformular.Geburtsdatum1.value == "") {
    alert("Bitte Ihr Geburtsdatum eingeben!");
    document.anmeldeformular.Geburtsdatum1.focus();
    return false;
  }
  if (document.anmeldeformular.Strasse.value == "") {
    alert("Bitte Ihre Stra�e eingeben!");
    document.anmeldeformular.Strasse.focus();
    return false;
  }
  if (document.anmeldeformular.PLZ.value == "") {
    alert("Bitte Ihr PLZ eingeben!");
    document.anmeldeformular.PLZ.focus();
    return false;
  }
  var chkZ = 1;
  for (i = 0; i < document.anmeldeformular.PLZ.value.length; ++i)
    if (document.anmeldeformular.PLZ.value.charAt(i) < "0" ||
        document.anmeldeformular.PLZ.value.charAt(i) > "9")
      chkZ = -1;
  if (chkZ == -1) {
    alert("PLZ keine Zahl!");
    document.anmeldeformular.PLZ.focus();
    return false;
  }
  if (document.anmeldeformular.Ort.value == "") {
    alert("Bitte Ihren Ort eingeben!");
    document.anmeldeformular.Ort.focus();
    return false;
  }
  if (document.anmeldeformular.Land.value == "") {
    alert("Bitte Ihre Land eingeben!");
    document.anmeldeformular.Land.focus();
    return false;
  }
  if (document.anmeldeformular.Email.value == "") {
    alert("Bitte Ihre E-Mail-Adresse eingeben!");
    document.anmeldeformular.Mail.focus();
    return false;
  }
  if (document.anmeldeformular.Email.value.indexOf("@") == -1) {Familienprogramm
    alert("Keine E-Mail-Adresse!");
    document.anmeldeformular.Email.focus();
    return false;
  }
  if (document.anmeldeformular.Telefon.value == "") {
    alert("Bitte Ihre Telefonnummer eingeben!");
    document.anmeldeformular.Telefon.focus();
    return false;
  }

}

//-->