DatArray = new Array("So","Mo","Di","Mi","Do","Fr","Sa","??" );
function Search() {
  with (window.document.GO) {
    Ra = parseInt(ERW.options[ERW.selectedIndex].value)
	  if (KA1.selectedIndex != 0) Ra++
	  if (KA2.selectedIndex != 0) Ra++
	  if (Ra >4) {
	    alert("Es sind nur max. 4 Reisende möglich!")
	    return
    }
    RA.value=Ra
    LMIN.value = xL.options[xL.selectedIndex].value.substr(0,2)
    LMAX.value = xL.options[xL.selectedIndex].value.substr(3,2)	 

    if (LMIN.value == "") MIN=0;  else  MIN = parseInt(LMIN.value);
    if (LMAX.value == "") MAX=28; else  MAX = parseInt(LMAX.value);

    BIS.value = MAX+Tol+Von

    submit()
  }
}

function changeDepDate() {
    var vonVal = document.getElementById('abflug').options[document.getElementById('abflug').selectedIndex].value;    
    document.getElementById('rueckflug').options[parseInt(vonVal)+21].selected = 'selected';
}

function SELECT_VON()
  {
  document.write("<select onchange='changeDepDate()' id='abflug' name='VON' class='lm_select'  size=1>")
  for (var i=1; i<=300; i++)
  {
  document.write('<option value='+i+'>'+GetDatum(i)+'')
  }
  document.write("</select>")
  }
function SELECT_BIS()
  {
  document.write("<select id='rueckflug' name='BIS' class='lm_select'  size=1>")
  
  document.getElementById('abflug').options[document.getElementById('abflug').selectedIndex].value
   
  for (var i=1; i<=365;i++) {
    if (i==21) document.write('<option selected ');
    else document.write('<option ');
  
    document.write('value='+i+'>'+GetDatum(i)+'')
  }
  document.write('</select>')
}


function GetDatum(offset) {
  var time = new Date()
  time.setTime( time.getTime()+offset*86400000)
  return DatArray[time.getDay()]+' '+time.getDate()+'.'+(1+time.getMonth())+'.'+(2000+(time.getYear()%100))
}
