function openwin(w_info,fenstername)
{
    var top=screen.height;
    var left=screen.width;
    posx=((left/2)-100);
    posy=((top/2)-180);
    var infowin = window.open(w_info,fenstername,'width=200,height=230,scrollbars=no,screenX='+posx+',screenY='+posy+',left='+posx+',top='+posy+'');
    infowin.focus();
}

var u,t,v,s,w,r;

function chkFormular()
{
    var bform=document.Form;
    if(bform.termin.value>bform.ruecktermin.value)
    {
        alert("Ihr Rückreisedatum liegt vor dem Hinreisedatum");
        return false;
    }        
    return true;
}

var secalter,secdauer,secTxt;
function alterkind(secalter,secTxt)
{
    if(secTxt) {
        strJahr=secTxt;
    }
    else {
        strJahr="Jahre";
    }
    for(i=2;i<=16;i++){
        if(i==secalter){
            document.write('<option value="'+i+'" selected>'+i+' '+strJahr+'</option>');
        }
        else{
            document.write('<option value="'+i+'">'+i+'  '+strJahr+'</option>');
        }
    }
}

function dauert(secdauer)
{
    for(i=2;i<=21;i++){
        if(i==secdauer){
            document.write('<option value="6_'+i+'" selected>'+i+' Tage</option>');
        }
        else{
            document.write('<option value="6_'+i+'">'+i+' Tage</option>');
        }
    }
}

function CRad(val){
    if(val==1) {
        document.Form.zimmer[6].checked=true;
    }
    else {
        document.Form.zimmer2.selectedIndex=0;
    }
}

function BookingAction(detail)
{
    
    return chkFormular();
}

function getUrl() {   
      var bform=document.Form;
      this.baseurl='http://www3.vidado.com/booking/ibe_tt2/index.php?KID='+bform.KID.value + '&formular=4';
      this.bookurl='&showresult=1&quickf=1';
      this.searchurl='&showresult=2&quickf=1';
      
      url='';
      if(bform.rengine[0].checked == true) {
         url += '&engine='+bform.rengine[0].value;
      } else {
         //url += '&engine='+IBE.engine;
      }
      if(bform.region.value == -1) {
      	this.bookurl += '&detail=zielgebiet';
      } else {
      	url += '&zielgebiets_kenner='+bform.region.value.split('|')[0];
      	this.bookurl += '&detail=hotel';
      }
      url += '&termin='+bform.termin.value;
      url += '&ruecktermin='+bform.ruecktermin.value;
      url += '&personen=';      
      if(bform.erwachsene.value == '') {
      	url += '25;25;';
      } else {
      	url += bform.erwachsene.value;
      }
      url += ';'+bform.alter1.value;
      url += ';'+bform.alter2.value;
      url += ';'+bform.alter3.value;
      url += '&dauer='+bform.dauer.value;
      url += '&abflughafen='+bform.abflughafen.value;
      url += '&flugdauer='+bform.ziel.value;      
      url += '&kategorie='+bform.kategorie.value;
      url += '&verpflegung='+bform.verpflegung.value;
      url += '&hbfges='+bform.hbfges.value;
      this.url=url;   
 } 
 
 //&showresult=1&nurflug=&laenderkenner=&abflughafen=-1&ab_g=1&flugdauer=-1&fl_g=1&strand=-1&st_g=1&kategorie=-1&ka_g=1&shotel=&typ=-1&ty_g=1&verpflegung=-1&vp_g=1&zimmer=-1&zi_g=1&sportmoeglichkeiten=-1&sm_g=1&wellness=-1&sportangebot=-1&sp_g=1&familie_kinder=-1&fk_g=1&preis=-1&pr_g=1&termin=1216072800&te_g=1&ruecktermin=1217887200&rute_g=1&dauer=-1&da_g=1&personen=25;25;;;;;&gewichtungs_gruppe=31&anzahl_treffer_seite=200&hotelanzahl=5;150&gebietsanzahl=4;200&Laender_Ref_ID=&engine=lastminute&formular=2&rliste=2&hliste=&gruppe=&utext=&spezial=&nSTART=&top_treffer=&test=&quickf=1&marke=&agent=Eves-Travel&s_ort=&zfilter=&s_offer=&zielgebiets_kenner=93&detail=hotel
