var astr = "toixbb";
readsession ();
var Anreise = new Date();
var Abreise = new Date();
Anreise = zeit;
var curstep = 1;
zimmertitel = [];
zimmertitel["EZ"] = "Einzelzimmer Klassik (1)";
zimmertitel["DZ_A"] = "Doppelzimmer Klassik (2+1)";
zimmertitel["DZ_B"] = "Doppelzimmer Romatik (2)";
zimmertitel["DZ_V"] = "Doppelzimmer Visionen (2+1)";
zimmertitel["JUN_A"] = "Residence Suite Typ A (2+2+1)";
zimmertitel["JUN_B"] = "Residence Suite Typ B (2+2+2)";
zimmertitel["JUN_C"] = "Residence Suite Typ C (2+2)";
zimmertitel["FAM_K"] = "Familienzimmer Klassik (2+1+1)";
zimmertitel["FAM_E"] = "Familienzimmer Exklusive (2+2+1)";
zimmertitel["XSUIT"] = "Suite Exklusive (2+1)";
zimmertitel["SU_FA"] = "Familien Suite Exklusive (4+2)";

function initdates() {
  Abreise.setTime(zeit.getTime() + (document.getElementById('naechte').value * 24 * 60 * 60 * 1000));
  document.getElementById('dated1').options[Anreise.getDate()-1].selected=true;
  document.getElementById('datem1').options[Anreise.getMonth()].selected=true;
  document.getElementById('dated2').options[Abreise.getDate()-1].selected=true;
  document.getElementById('datem2').options[Abreise.getMonth()].selected=true;
//  document.getElementById('datey2').options[document.getElementById('datey1').options.selectedIndex+Abreise.getFullYear()-Anreise.getFullYear()].selected=true;
}

function checkdates() {
  if (document.getElementById('datey1').options[document.getElementById('datey1').options.selectedIndex].value+document.getElementById('datem1').options[document.getElementById('datem1').options.selectedIndex].value+document.getElementById('dated1').options[document.getElementById('dated1').options.selectedIndex].value < 20120324)
  {
    alert('Unsere Saison beginnt erst am 24.03.2012');
    return false;
  }
  else
  {
    return true;
  }
}

function setnaechte()
{
//  var Anreise = new Date();
//  var Abreise = new Date();
  Anreise.setDate(document.getElementById('dated1').options.selectedIndex+1);
  Abreise.setDate(document.getElementById('dated2').options.selectedIndex+1);
  Anreise.setMonth(document.getElementById('datem1').options.selectedIndex);
  Abreise.setMonth(document.getElementById('datem2').options.selectedIndex);
  Anreise.setFullYear(document.getElementById('datey1').options[document.getElementById('datey1').options.selectedIndex].value);
  Abreise.setFullYear(document.getElementById('datey2').options[document.getElementById('datey2').options.selectedIndex].value);
  var help = (Abreise.getTime() - Anreise.getTime())/(24 * 60 * 60 * 1000);
  if (help < 1)
  {
    help = 5;
  }
  document.getElementById('naechte').value = parseInt(help);
  initdates();
}

function zurueck(step)
{
  if (step < curstep)
  {
    buchung(step);
  }
}

function verfuegbarkeit(zimmer)
{
  if (zimmer)
  {
    document.getElementById('zimmer'+zimmer+'_erwachsene').options.selectedIndex = 0;
    document.getElementById('zimmer'+zimmer+'_kinder').options.selectedIndex = 0;
    document.getElementById('z'+zimmer+'kind_1').style.display = 'none';
    document.getElementById('z'+zimmer+'kind_2').style.display = 'none';
    document.getElementById('z'+zimmer+'kind_3').style.display = 'none';
    document.getElementById('z'+zimmer+'kind_4').style.display = 'none';
    document.getElementById('zimmer'+zimmer+'_alter_kind_1').options.selectedIndex = 0;
    document.getElementById('zimmer'+zimmer+'_alter_kind_2').options.selectedIndex = 0;
    document.getElementById('zimmer'+zimmer+'_alter_kind_3').options.selectedIndex = 0;
    document.getElementById('zimmer'+zimmer+'_alter_kind_4').options.selectedIndex = 0;
  }
  verfuegbar.location.replace('/cgi-bin/custom/verfuegbarkeit.pl?tan='+document.getElementById('dated1').options[document.getElementById('dated1').options.selectedIndex].value+'&man='+document.getElementById('datem1').options[document.getElementById('datem1').options.selectedIndex].value+'&jan='+document.getElementById('datey1').options[document.getElementById('datey1').options.selectedIndex].value+'&tab='+document.getElementById('dated2').options[document.getElementById('dated2').options.selectedIndex].value+'&mab='+document.getElementById('datem2').options[document.getElementById('datem2').options.selectedIndex].value+'&jab='+document.getElementById('datey2').options[document.getElementById('datey2').options.selectedIndex].value+'&naechte='+document.getElementById('naechte').value+'&typ='+document.getElementById('zimmer1sel').options[document.getElementById('zimmer1sel').selectedIndex].value+','+document.getElementById('zimmer2sel').options[document.getElementById('zimmer2sel').selectedIndex].value+','+document.getElementById('zimmer3sel').options[document.getElementById('zimmer3sel').selectedIndex].value);
}

function setverfuegbar(para)
{
  document.sendform.frei.value = para;
}

function showkalender()
{
  kalender.location.replace('/cgi-bin/custom/kalender_frei.pl?&mab='+document.getElementById('datem2').options[document.getElementById('datem2').options.selectedIndex].value+'&typ='+document.getElementById('zimmer1sel').options[document.getElementById('zimmer1sel').selectedIndex].value+','+document.getElementById('zimmer2sel').options[document.getElementById('zimmer2sel').selectedIndex].value+','+document.getElementById('zimmer3sel').options[document.getElementById('zimmer3sel').selectedIndex].value)
  document.getElementById('kalender').style.visibility = 'visible';
  document.getElementById('logo').style.display = 'none';
  buchung(1);
}

function buchung(step)
{
  document.getElementById('reply').src = '/leer.htm';
  for(var ist = 1; ist < 4; ist++)
  {
    if (ist < step)
    {
      document.getElementById('anfragenav'+ist).className = "anfragenav";
      document.getElementById('anfrage'+ist).style.display = "none";
    }
    if (ist == step)
    {
      document.getElementById('anfragenav'+ist).className = "anfragenavactive";
      document.getElementById('anfrage'+ist).style.display = "block";
    }
    if (ist > step)
    {
      document.getElementById('anfragenav'+ist).className = "anfragenavinactive";
      document.getElementById('anfrage'+ist).style.display = "none";
    }
  }
  if (step == 2)
  {
    document.getElementById('anreisedisp').innerHTML = document.getElementById('dated1').options[document.getElementById('dated1').options.selectedIndex].value+'.'+document.getElementById('datem1').options[document.getElementById('datem1').options.selectedIndex].value+'.'+document.getElementById('datey1').options[document.getElementById('datey1').options.selectedIndex].value;
    document.getElementById('abreisedisp').innerHTML = document.getElementById('dated2').options[document.getElementById('dated2').options.selectedIndex].value+'.'+document.getElementById('datem2').options[document.getElementById('datem2').options.selectedIndex].value+'.'+document.getElementById('datey2').options[document.getElementById('datey2').options.selectedIndex].value;
    document.getElementById('anreisedisp1').innerHTML = document.getElementById('dated1').options[document.getElementById('dated1').options.selectedIndex].value+'.'+document.getElementById('datem1').options[document.getElementById('datem1').options.selectedIndex].value+'.'+document.getElementById('datey1').options[document.getElementById('datey1').options.selectedIndex].value;
    document.getElementById('abreisedisp1').innerHTML = document.getElementById('dated2').options[document.getElementById('dated2').options.selectedIndex].value+'.'+document.getElementById('datem2').options[document.getElementById('datem2').options.selectedIndex].value+'.'+document.getElementById('datey2').options[document.getElementById('datey2').options.selectedIndex].value;
    verfuegbarkeit();
  }
  if (step == 3)
  {
    if (document.getElementById('zimmer1sel').selectedIndex > 0)
    {
      document.getElementById('zimmer1disp').style.display = 'block';
      document.getElementById('zimmer1bez').innerHTML = zimmertitel[document.getElementById('zimmer1sel').options[document.getElementById('zimmer1sel').options.selectedIndex].value];
      document.getElementById('z1img').innerHTML = '<img src="/images/zimmer/'+document.getElementById('zimmer1sel').options[document.getElementById('zimmer1sel').options.selectedIndex].value+'.png">';
    }
    else
    {
      document.getElementById('zimmer1disp').style.display = 'none';
      document.getElementById('z1img').innerHTML = '';
    }
    if (document.getElementById('zimmer2sel').selectedIndex > 0)
    {
      document.getElementById('zimmer2disp').style.display = 'block';
      document.getElementById('zimmer2bez').innerHTML = zimmertitel[document.getElementById('zimmer2sel').options[document.getElementById('zimmer2sel').options.selectedIndex].value];
      document.getElementById('z2img').innerHTML = '<img src="/images/zimmer/'+document.getElementById('zimmer2sel').options[document.getElementById('zimmer2sel').options.selectedIndex].value+'.png">';
    }
    else
    {
      document.getElementById('zimmer2disp').style.display = 'none';
      document.getElementById('z2img').innerHTML = '';
    }
    if (document.getElementById('zimmer3sel').selectedIndex > 0)
    {
      document.getElementById('zimmer3disp').style.display = 'block';
      document.getElementById('zimmer3bez').innerHTML = zimmertitel[document.getElementById('zimmer3sel').options[document.getElementById('zimmer3sel').options.selectedIndex].value];
      document.getElementById('z3img').innerHTML = '<img src="/images/zimmer/'+document.getElementById('zimmer3sel').options[document.getElementById('zimmer3sel').options.selectedIndex].value+'.png">';
    }
    else
    {
      document.getElementById('zimmer3disp').style.display = 'none';
      document.getElementById('z3img').innerHTML = '';
    }
    checkPreis();
  }
  curstep = step;
}

function showangebot(folder)
{
  var r = 0;
  for(ian = 0; ian < crefarr.length-1; ian++)
  {
    for (var anid in angebotesuch)
    {
      if (angebotesuch[anid].indexOf(crefarr[ian].toLowerCase()) != -1)
      {
        var suchangebot = anid;
      }
    }
  }
  if (angebote[folder][0] == undefined)
  {
    folder = 1;
  }
  r = Math.round(Math.random()*angebote[folder].length-0.4999);
  if (document.getElementById('subsubnavcont') && !document.getElementById('fototab'))
  {
    document.getElementById('subsubnavcont').style.display = 'block';
    if (suchangebot)
    {
      document.getElementById('subsubnavcont').innerHTML += angebotehtml[suchangebot];
    }
    else
    {
      document.getElementById('subsubnavcont').innerHTML += angebotehtml[angebote[folder][r]];
//      document.getElementById('h1inhalt').style.marginLeft="178px";
    }
  }
  if (document.getElementById('angebotehome'))
  {
    r = Math.round(Math.random()*angebotehome.length-0.4999);
    if (suchangebot)
    {
      document.getElementById('angebotehome').innerHTML = angebotehomehtml[suchangebot];
    }
    else
    {
      document.getElementById('angebotehome').innerHTML = angebotehomehtml[angebotehome[r]];
    }
  }
}

function checkkontakt()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.email.value=="" || (pattern.test(document.sendform.email.value))==false)
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  if (document.sendform.telefon.value=="" || document.sendform.telefon.value=="Telefon")
  {
    document.sendform.telefon.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.telefon.style.borderColor = "#909090";
  }
  if (document.sendform.betreff.value=="" || document.sendform.betreff.value=="Betreff")
  {
    document.sendform.betreff.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.betreff.style.borderColor = "#909090";
  }
  if (document.sendform.nachricht.value=="" || document.sendform.nachricht.value=="Nachricht")
  {
    document.sendform.nachricht.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachricht.style.borderColor = "#909090";
  }
  return checked;
}

function checkkatalog()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.email.value=="" || (pattern.test(document.sendform.email.value))==false)
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  if (document.sendform.telefon.value=="" || document.sendform.telefon.value=="Telefon")
  {
    document.sendform.telefon.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.telefon.style.borderColor = "#909090";
  }
  if (document.sendform.strasse.value=="" || document.sendform.strasse.value=="Straße")
  {
    document.sendform.strasse.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.strasse.style.borderColor = "#909090";
  }
  if (document.sendform.plz.value=="" || document.sendform.plz.value=="PLZ")
  {
    document.sendform.plz.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.plz.style.borderColor = "#909090";
  }
  if (document.sendform.ort.value=="" || document.sendform.ort.value=="Ort")
  {
    document.sendform.ort.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.ort.style.borderColor = "#909090";
  }
  return checked;
}

function checkberatung()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.telefonnummer.value=="" || document.sendform.telefonnummer.value=="000000")
  {
    document.sendform.telefonnummer.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.telefonnummer.style.borderColor = "#909090";
  }
  if (document.sendform.ortsvorwahl.value=="" || document.sendform.ortsvorwahl.value=="00000")
  {
    document.sendform.ortsvorwahl.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.ortsvorwahl.style.borderColor = "#909090";
  }
  return checked;
}

function checkexpress()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.email.value=="" || (pattern.test(document.sendform.email.value))==false)
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  if (document.sendform.telefon.value=="" || document.sendform.telefon.value=="Telefon")
  {
    document.sendform.telefon.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.telefon.style.borderColor = "#909090";
  }
  if (document.sendform.text.value=="" || document.sendform.text.value=="Text")
  {
    document.sendform.text.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.text.style.borderColor = "#909090";
  }
  if (!document.sendform.datenschutz.checked)
  {
    alert('Bitte akzeptieren Sie die Datenschutzerklärung!');
    checked=false;
  }
  if (!document.sendform.agbs.checked)
  {
    alert('Bitte bestätigen Sie, dass Sie unsere AGBs gelesen haben!');
    checked=false;
  }
  if (document.sendform.sms.checked && (document.sendform.handy.value=="" || document.sendform.handy.value=="Bitte Handynummer eingeben"))
  {
    document.sendform.handy.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.handy.style.borderColor = "#909090";
  }
  return checked;
}

function checkanfrage()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.anrede.options.selectedIndex == 0)
  {
    document.sendform.anrede.style.backgroundColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.anrede.style.backgroundColor = "white";
  }
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.email.value=="" || (pattern.test(document.sendform.email.value))==false)
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  if (document.sendform.email2.value=="" || (pattern.test(document.sendform.email2.value))==false)
  {
    document.sendform.email2.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email2.style.borderColor = "#909090";
  }
  if (document.sendform.telefon.value=="" || document.sendform.telefon.value=="Telefon")
  {
    document.sendform.telefon.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.telefon.style.borderColor = "#909090";
  }
  document.getElementById('zimmer1_erwachsene').style.borderColor = "#909090";
  document.getElementById('zimmer1_kinder').style.borderColor = "#909090";
  if (document.getElementById('zimmer1disp').style.display != 'none')
  {
    if (document.sendform.zimmer1_kinder.options.selectedIndex == 0 && document.sendform.zimmer1_erwachsene.options.selectedIndex == 0)
    {
      document.getElementById('zimmer1_erwachsene').style.borderColor = "red";
      document.getElementById('zimmer1_kinder').style.borderColor = "red";
      checked=false;
    }
    for(var ik = 1; ik <= document.sendform.zimmer1_kinder.options.selectedIndex; ik++)
    {
      document.getElementById('zimmer1_alter_kind_'+ik).style.borderColor = "#909090";
      if (document.getElementById('zimmer1_alter_kind_'+ik).options.selectedIndex == 0)
      {
        document.getElementById('zimmer1_alter_kind_'+ik).style.borderColor = "red";
        checked=false;
      }
    }
  }
  document.getElementById('zimmer2_erwachsene').style.borderColor = "#909090";
  document.getElementById('zimmer2_kinder').style.borderColor = "#909090";
  if (document.getElementById('zimmer2disp').style.display != 'none')
  {
    if (document.sendform.zimmer2_kinder.options.selectedIndex == 0 && document.sendform.zimmer2_erwachsene.options.selectedIndex == 0)
    {
      document.getElementById('zimmer2_erwachsene').style.borderColor = "red";
      document.getElementById('zimmer2_kinder').style.borderColor = "red";
      checked=false;
    }
    for(var ik = 1; ik <= document.sendform.zimmer2_kinder.options.selectedIndex; ik++)
    {
      document.getElementById('zimmer2_alter_kind_'+ik).style.borderColor = "#909090";
      if (document.getElementById('zimmer2_alter_kind_'+ik).options.selectedIndex == 0)
      {
        document.getElementById('zimmer2_alter_kind_'+ik).style.borderColor = "red";
        checked=false;
      }
    }
  }
  document.getElementById('zimmer3_erwachsene').style.borderColor = "#909090";
  document.getElementById('zimmer3_kinder').style.borderColor = "#909090";
  if (document.getElementById('zimmer3disp').style.display != 'none')
  {
    if (document.sendform.zimmer3_kinder.options.selectedIndex == 0 && document.sendform.zimmer3_erwachsene.options.selectedIndex == 0)
    {
      document.getElementById('zimmer3_erwachsene').style.borderColor = "red";
      document.getElementById('zimmer3_kinder').style.borderColor = "red";
      checked=false;
    }
    for(var ik = 1; ik <= document.sendform.zimmer3_kinder.options.selectedIndex; ik++)
    {
      document.getElementById('zimmer3_alter_kind_'+ik).style.borderColor = "#909090";
      if (document.getElementById('zimmer3_alter_kind_'+ik).options.selectedIndex == 0)
      {
        document.getElementById('zimmer3_alter_kind_'+ik).style.borderColor = "red";
        checked=false;
      }
    }
  }
  if (document.getElementById('fruehstueck').checked || document.getElementById('halbpension').checked)
  {
    document.getElementById('verpflegung').style.border = "0px";
  }
  else
  {
    document.getElementById('verpflegung').style.borderColor = "red";
    checked=false;
  }
  if (!checked)
  {
    alert('Bitte geben Sie auch die Informationen in den rot markierten Feldern ein!');
  }
  if (checked)
  {
    if (document.sendform.email2.value==document.sendform.email.value)
    {
      document.sendform.submit();
    }
    else
    {
      alert('Bitte geben Sie zur Kontrolle 2 mal die gleiche E-Mailadresse ein!');
    }
  }
  return checked;
}

function checkPreis()
{
  var params = "fruehstueck="+document.getElementById('fruehstueck').checked+"&zimmer1_erwachsene="+document.getElementById('zimmer1_erwachsene').options.selectedIndex+"&zimmer1_kinder="+document.getElementById('zimmer1_kinder').options.selectedIndex+"&zimmer1_alter_kind_1="+document.getElementById('zimmer1_alter_kind_1').options.selectedIndex+"&zimmer1_alter_kind_2="+document.getElementById('zimmer1_alter_kind_2').options.selectedIndex+"&zimmer1_alter_kind_3="+document.getElementById('zimmer1_alter_kind_3').options.selectedIndex+"&zimmer1_alter_kind_4="+document.getElementById('zimmer1_alter_kind_4').options.selectedIndex;
  params += "&zimmer2_erwachsene="+document.getElementById('zimmer2_erwachsene').options.selectedIndex+"&zimmer2_kinder="+document.getElementById('zimmer2_kinder').options.selectedIndex+"&zimmer2_alter_kind_1="+document.getElementById('zimmer2_alter_kind_1').options.selectedIndex+"&zimmer2_alter_kind_2="+document.getElementById('zimmer2_alter_kind_2').options.selectedIndex+"&zimmer2_alter_kind_3="+document.getElementById('zimmer2_alter_kind_3').options.selectedIndex+"&zimmer2_alter_kind_4="+document.getElementById('zimmer2_alter_kind_4').options.selectedIndex;
  params += "&zimmer3_erwachsene="+document.getElementById('zimmer3_erwachsene').options.selectedIndex+"&zimmer3_kinder="+document.getElementById('zimmer3_kinder').options.selectedIndex+"&zimmer3_alter_kind_1="+document.getElementById('zimmer3_alter_kind_1').options.selectedIndex+"&zimmer3_alter_kind_2="+document.getElementById('zimmer3_alter_kind_2').options.selectedIndex+"&zimmer3_alter_kind_3="+document.getElementById('zimmer3_alter_kind_3').options.selectedIndex+"&zimmer3_alter_kind_4="+document.getElementById('zimmer3_alter_kind_4').options.selectedIndex;
  params += "&tan="+document.getElementById('dated1').options[document.getElementById('dated1').options.selectedIndex].value+"&man="+document.getElementById('datem1').options[document.getElementById('datem1').options.selectedIndex].value+"&jan="+document.getElementById('datey1').options[document.getElementById('datey1').options.selectedIndex].value+"&tab="+document.getElementById('dated2').options[document.getElementById('dated2').options.selectedIndex].value+"&mab="+document.getElementById('datem2').options[document.getElementById('datem2').options.selectedIndex].value+"&jab="+document.getElementById('datey2').options[document.getElementById('datey2').options.selectedIndex].value+"&naechte="+document.getElementById('naechte').value+"&typ1="+document.getElementById('zimmer1sel').options[document.getElementById('zimmer1sel').selectedIndex].value+"&typ2="+document.getElementById('zimmer2sel').options[document.getElementById('zimmer2sel').selectedIndex].value+"&typ3="+document.getElementById('zimmer3sel').options[document.getElementById('zimmer3sel').selectedIndex].value;
  var jsHttp = false;
/*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest) function XMLHttpRequest() { return new ActiveXObject('Microsoft.XMLHTTP')}@end @*/

  if (typeof XMLHttpRequest != 'undefined'){jsHttp = new XMLHttpRequest()}
  if (jsHttp)
  {
    jsHttp.open('POST', '/cgi-bin/custom/showprice.pl',true);
    jsHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    jsHttp.setRequestHeader("Content-length", params.length);
    jsHttp.setRequestHeader("Connection", "close");
    jsHttp.onreadystatechange = function ()
    {
      if (jsHttp.readyState == 4)
      {
        eval(jsHttp.responseText);
      }
    }
    jsHttp.send(params);
  }
}

function checknewsletter()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.email.value=="" || (pattern.test(document.sendform.email.value))==false)
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  return checked;
}

function set(bereich,val)
{
  if (bereich == "f")
  {
    document.sendform.familie.value = val;
  }
  if (bereich == "w")
  {
    document.sendform.wellness.value = val;
  }
  if (bereich == "s")
  {
    document.sendform.sport.value = val;
  }
  if (bereich == "k")
  {
    document.sendform.kultur.value = val;
  }
  if (bereich == "e")
  {
    document.sendform.essen.value = val;
  }
  for(var i = 1; i <= val; i++)
  {
    document.getElementById(bereich+''+i).src = "/onTEAM/admin/onteam/images/pazeide_on.png";
  }
  for(var i = val+1; i <= 5; i++)
  {
    document.getElementById(bereich+''+i).src = "/onTEAM/admin/onteam/images/pazeide_off.png";
  }
}

function checkmein()
{
  var checked=true;
  document.sendform.referrer.value = ref;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.nachname.value=="" || document.sendform.nachname.value=="Name")
  {
    document.sendform.nachname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.nachname.style.borderColor = "#909090";
  }
  if (document.sendform.vorname.value=="" || document.sendform.vorname.value=="Vorname")
  {
    document.sendform.vorname.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.vorname.style.borderColor = "#909090";
  }
  if (document.sendform.email.value=="" || (pattern.test(document.sendform.email.value))==false)
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  if (document.sendform.telefon.value=="" || document.sendform.telefon.value=="Telefon")
  {
    document.sendform.telefon.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.telefon.style.borderColor = "#909090";
  }
  if (document.sendform.strasse.value=="" || document.sendform.strasse.value=="Straße")
  {
    document.sendform.strasse.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.strasse.style.borderColor = "#909090";
  }
  if (document.sendform.plz.value=="" || document.sendform.plz.value=="PLZ")
  {
    document.sendform.plz.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.plz.style.borderColor = "#909090";
  }
  if (document.sendform.ort.value=="" || document.sendform.ort.value=="Ort")
  {
    document.sendform.ort.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.ort.style.borderColor = "#909090";
  }
  return checked;
}

function checkgbuch()
{
  var checked=true;
  var pattern=/.*\@.*\..*/;
  if (document.sendform.name.value=="" || document.sendform.name.value=="Name*")
  {
    document.sendform.name.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.name.style.borderColor = "#909090";
  }
  if ((pattern.test(document.sendform.email.value))==false && document.sendform.email.value != "Email")
  {
    document.sendform.email.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.email.style.borderColor = "#909090";
  }
  if (document.sendform.stadt.value=="" || document.sendform.stadt.value=="Stadt*")
  {
    document.sendform.stadt.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.stadt.style.borderColor = "#909090";
  }
  if (document.sendform.text.value=="" || document.sendform.text.value=="Text*")
  {
    document.sendform.text.style.borderColor = "red";
    checked=false;
  }
  else
  {
    document.sendform.text.style.borderColor = "#909090";
  }
  document.sendform.para.value = astr;
  document.sendform.action = "/cgi-bin/";
  document.sendform.action += "cus"+astr+"uch.pl";
  document.sendform.action = document.sendform.action.replace(/ixb/,"m/g");
  return checked;
}

function openImage(file,x,y) {
    var show=window.open(file,"PopUp","width="+x+",height="+y+",top="+(screen.height-y)/2+",left="+(screen.width-x)/2+",location=no,scrollbars=no,resizable=no,menubar=no,toolbar=no,status=no");
    show.focus();
}

function infoLayer(id,visibility) {
    document.getElementById(id).style.visibility=visibility;
}



