<!--//
function reserveSingleChangeForm() {
  var selectDuration = document.getElementById("selectDuration1");
  if (document.formReserveSingle.selectSport.value == "Squash") {
    var countElements = selectDuration.length;
    for (var i = 0; i < countElements; i++) {
      selectDuration.remove(selectDuration.selectedIndex);
    }
    addEntry("(Dauer)", selectDuration);
    addEntry("0,5 Stunde", selectDuration);
    addEntry("1 Stunde", selectDuration);
    addEntry("1,5 Stunden", selectDuration);
    addEntry("2 Stunden", selectDuration);
  }
  if (document.formReserveSingle.selectSport.value == "Tennis") {
    var countElements = selectDuration.length;
    for (var i = 0; i < countElements; i++) {
      selectDuration.remove(selectDuration.selectedIndex);
    }
    addEntry("(Dauer)", selectDuration);
    addEntry("1 Stunde", selectDuration);
    addEntry("2 Stunden", selectDuration);
    addEntry("3 Stunden", selectDuration);
  }
}
function reserveMultiChangeForm() {
  var selectDuration = document.getElementById("selectDuration2");
  if (document.formReserveMulti.selectSport.value == "Squash") {
    var countElements = selectDuration.length;
    for (var i = 0; i < countElements; i++) {
      selectDuration.remove(selectDuration.selectedIndex);
    }
    addEntry("(Dauer)", selectDuration);
    addEntry("0,5 Stunde", selectDuration);
    addEntry("1 Stunde", selectDuration);
    addEntry("1,5 Stunden", selectDuration);
    addEntry("2 Stunden", selectDuration);
  }
  if (document.formReserveMulti.selectSport.value == "Tennis") {
    var countElements = selectDuration.length;
    for (var i = 0; i < countElements; i++) {
      selectDuration.remove(selectDuration.selectedIndex);
    }
    addEntry("(Dauer)", selectDuration);
    addEntry("1 Stunde", selectDuration);
    addEntry("2 Stunden", selectDuration);
    addEntry("3 Stunden", selectDuration);
  }
}
function addEntry(text, node) {
  var entry = document.createElement("option");
  entry.appendChild(document.createTextNode(text));
  node.appendChild(entry);
}
var noError;
function sendReserveSingle() {
  noError = "true";
  var outputErrors = document.getElementById("outputErrorsSingle");
  if (outputErrors.hasChildNodes()) {
    outputErrors.removeChild(outputErrors.firstChild);
  }
  outputErrors.appendChild(document.createElement("ul"));
  if (document.formReserveSingle.textFirstname1.value == "") {
    reportError("Bitte geben Sie Ihren Vornamen an!", outputErrors);
  }
  if (document.formReserveSingle.textLastname1.value == "") {
    reportError("Bitte geben Sie Ihren Nachnamen an!", outputErrors);
  }
  if ((document.formReserveSingle.textEmail1.value == "") && (document.formReserveSingle.textPhone.value == "")) {
    reportError("Bitte geben Sie Ihre eMail-Adresse oder Ihre Telefonnummer an!", outputErrors);
  }
  if (document.formReserveSingle.selectConfirm1.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Terminbestätigung aus!", outputErrors);
  }
  if (document.formReserveSingle.selectSport1.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Sportart aus!", outputErrors);
  }
  if (document.formReserveSingle.textDate.value == "") {
    reportError("Bitte geben Sie ein Datum an!", outputErrors);
  }
  if (document.formReserveSingle.selectTime1.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Uhrzeit aus!", outputErrors);
  }
  if (document.formReserveSingle.selectDuration1.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Spieldauer aus!", outputErrors);
  }
  if (noError == "true") {
    document.formReserveSingle.submit();
  }
}
function sendReserveMulti() {
  noError = "true";
  var outputErrors = document.getElementById("outputErrorsMulti");
  if (outputErrors.hasChildNodes()) {
    outputErrors.removeChild(outputErrors.firstChild);
  }
  outputErrors.appendChild(document.createElement("ul"));
  if (document.formReserveMulti.textFirstname2.value == "") {
    reportError("Bitte geben Sie Ihren Vornamen an!", outputErrors);
  }
  if (document.formReserveMulti.textLastname2.value == "") {
    reportError("Bitte geben Sie Ihren Nachnamen an!", outputErrors);
  }
  if (document.formReserveMulti.textStreet.value == "") {
    reportError("Bitte geben Sie Ihre Straße an!", outputErrors);
  }
  if (document.formReserveMulti.textStreetnumber.value == "") {
    reportError("Bitte geben Sie Ihre Hausnummmer an!", outputErrors);
  }
  if (document.formReserveMulti.textZipcode.value == "") {
    reportError("Bitte geben Sie Ihre Postleitzahl an!", outputErrors);
  }
  if (document.formReserveMulti.textCity.value == "") {
    reportError("Bitte geben Sie Ihre Stadt an!", outputErrors);
  }
  if ((document.formReserveMulti.textEmail2.value == "") && (document.formReserveMulti.selectConfirm2.selectedIndex == 1)) {
    reportError("Bitte geben Sie Ihre eMail-Adresse an!", outputErrors);
  }
  if (document.formReserveMulti.selectConfirm2.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Art der Angebotszustellung aus!", outputErrors);
  }
  if (document.formReserveMulti.selectSport2.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Sportart aus!", outputErrors);
  }
  if (document.formReserveMulti.selectTimezone.selectedIndex == 0) {
    reportError("Bitte wählen Sie einen Zeitraum aus!", outputErrors);
  }
  if (document.formReserveMulti.selectTime2.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Uhrzeit aus!", outputErrors);
  }
  if (document.formReserveMulti.selectDuration2.selectedIndex == 0) {
    reportError("Bitte wählen Sie eine Spieldauer aus!", outputErrors);
  }
  if (noError == "true") {
    document.formReserveMulti.submit();
  }
}
function reportError(message, node) {
  noError = "false";
  node.firstChild.appendChild(document.createElement("li"));
  node.firstChild.lastChild.appendChild(document.createTextNode(message));
}
//-->

