function zur_suche(){
    window.location.href=uebergabe+'&showresult=2';
}

function zum_zielgebiet(){
    window.location.href=uebergabe+'&detail=zielgebiet&showresult=1';
}

function s_termine(kenner_id){
    part=regionen_2[kenner_id].split('#');
    window.location.href=uebergabe+'&IFF='+part[2]+'&zielgebiets_kenner='+part[10]+'&detail=termine&showresult='+part[11]+'&startposition_hotel='+part[12];
}
function skippen(zaehler,sortierung){
    part=regionen_2[0].split('#');
    window.location.href=uebergabe+'&sortierung='+sortierung+'&detail=hotel&startposition='+zaehler+'&zielgebiets_kenner='+part[10]+'&showresult='+part[11];
}

function ortsucher(ort, sortierung, mapIffCode){
    part=regionen_2[0].split('#'); 
    var strIffCode = ''; 
    if (typeof(mapIffCode) != 'undefined' && mapIffCode != '') {
        strIffCode = '&mapIffOrt='+mapIffCode;  
    }
    window.location.href=ibeLocation+''+uebergabe+'&sortierung='+sortierung+'&detail=hotel&startposition=0&zielgebiets_kenner='+part[10]+'&showresult='+part[11]+'&s_ort='+escape(ort)+strIffCode;
}

function horder(sortierung)
{
    part=regionen_2[0].split('#');
    window.location.href=uebergabe+'&sortierung='+sortierung+'&detail=hotel&startposition=0&zielgebiets_kenner='+part[10]+'&showresult='+part[11];
}


function MakeStars(nStars,pfad_images)
{
    var strStars="";
    while(nStars>0){
        strStars+='<img src="'+pfad_images+'/'+((nStars>5)?'1stern':'stern_halb')+'.gif" border="0">';
        nStars-=10;
    }
    return strStars;
}

function s_hotel_tabelle(pfad_images)
{
   var n_AltFlag=0; var n_TopFlag=0;
   var c_strOL,c_strOR,c_strL,c_strM,c_strR,alt_txt;
   if(regionen_2.length <= 0) {}
   else
   {
        if(showHbw==1){
            cols_gesamt=4;
            cols_head_angebot=3;
        }
        else{
            cols_gesamt=3;
            cols_head_angebot=2;
        }

        for(i=0;i<regionen_2.length;i++)
        {
            parts=regionen_2[i].split("#");
            if(parts[9]==0){
                if(n_TopFlag==0){
                    c_strTR1="hottrhead";
                    c_strTR2="hottrsub";
                    c_strOL="hottdOL";
                    c_strOR="hottdOR";
                    c_strL="hottdUL";
                    c_strM="hottdUM";
                    c_strM2="hottdUM2";
                    c_strR="hottdUR";
                    c_strLink="hotlpreis";
                    c_strLinkfW="hotlpreisfw";
                    alt_txt="";
                    //alert('hell');
                    n_TopFlag=1;
                }
            }
            else{
                if(n_AltFlag==0){
                    c_strTR1="hottrheadALT";
                    c_strTR2="hottrsubALT";
                    c_strOL="hottdOLALT";
                    c_strOR="hottdORALT";
                    c_strL="hottdULALT";
                    c_strM="hottdUMALT";
                    c_strM2="hottdUM2ALT";
                    c_strR="hottdURALT";
                    c_strLink="hotlpreisALT";
                    c_strLinkfW="hotlpreisALTfW";
                    alt_txt="&nbsp;(alternativ)";
                    if(parts[0]==1){
                        document.write('<tr>');
                        document.write('<td colspan="'+cols_gesamt+'" class="onlyalt">Es konnten keine Angebote gefunden werden,<br>die zu 100% mit Ihren Wünschen übereinstimmen.</td>');
                        document.write('</tr>');
                    }
                    document.write('<tr>');
                    document.write('<td colspan="'+cols_gesamt+'" class="alttxt">Alternative Reiseangebote, die Ihren Wünschen nahe kommen:</td>');
                    document.write('</tr>');
                    n_AltFlag=1;
                }
            }

            document.write('<tr class="'+c_strTR1+'">');
            document.write('<td class="'+c_strOL+'" colspan="'+cols_head_angebot+'">');
            document.write(''+parts[0]+'. Angebot '+alt_txt);
            document.write('</td>');
            document.write('<td class="'+c_strOR+'">');
            //Schweizer Franken in IBE Basic
            if(ibeCountry==2){
                if(showWaehrung & 1){
                    document.write('<a class="'+c_strLink+'" href="javascript:s_termine('+i+');">p.P. ab '+parts[1]+',-&euro;</a>');
                }
                if(showWaehrung & 2){
                    if(showWaehrung & 1){
                        document.write('&nbsp;&nbsp;&nbsp;&nbsp;');
                    }
                    document.write('<a class="'+c_strLinkfW+'" href="javascript:s_termine('+i+');">');
                    if (uFaktor != 1 && ibeCurrency == '') {
                        document.write('ca ');
                    }
                    if (ibeCurrency == '') {
                        document.write(Math.ceil(uFaktor*parts[1])+'.-CHF</a>');    
                    } else {
                        document.write('p.P. ab '+parts[1]+'.-'+ibeCurrency+'</a>');
                    }
                    
                }
                if(showWaehrung & 4){
                    document.write('&nbsp;&nbsp;&nbsp;&nbsp;<a class="'+c_strLink+'" href="javascript:s_termine('+i+');">p.P. ab '+parts[1]+',-&euro;</a>');
                }
            }
            else{
                document.write('<a class="'+c_strLink+'" href="javascript:s_termine('+i+');">p.P. ab '+parts[1]+',-&euro;</a>');
            }
            document.write('</td>');
            document.write('</tr>');

            document.write('<tr class="'+c_strTR2+'">');
            //thumbnail
            document.write('<td class="'+c_strL+'"><a href="javascript:oHIB(\''+parts[2]+'\',\''+parts[2]+'\',\''+parts[3]+'\',\'1\',\'\',\'\',\''+parts[4]+'\',\''+parts[13]+'\',\'\',\'\',\'\',\'\',\'\',\'hotel\');" title="Hotel- und Leistungsbeschreibungen aufrufen">')
            np=String(parseInt(parts[2]/5000)*5000);
            while(np.length<5)np="0"+np;
            document.write('<img src="'+imgservPfad+'/images/content/booking_thumbs/'+np+'/THB_999_H'+parts[2]+'.jpg" height="65" width="100" alt="Hotel- und Leistungsbeschreibungen abrufen" border="0">');
            document.write('</a></td>');
            //name, sterne,ort,image
            document.write('<td class="'+c_strM+'">');
            document.write('<b>'+parts[6]+'</b>');
            //document.write('<b><a href="javascript:show_iff_hotel(\''+parts[2]+'\');" title="Diesen Hotel auf der Karte anzeigen">'+parts[6]+'</b>');
            document.write('<br>');
            nSterne=Math.floor(parts[4]*10);
            document.write(MakeStars(nSterne,pfad_images));
            if(ortsliste!=""){
            var mort=parts[7].replace(/\'/g,"\\'");
            document.write('<br><a href="javascript:show_iff_ort(\''+parts[16]+'\',\''+mort+'\');" title="Diesen Ort auf der Karte anzeigen">'+parts[7]+parts[8]+'</a><br>');
            }
            else{
            document.write('<br>'+parts[7]+parts[8]+'<br>');
            }
            document.write('<a href="javascript:s_termine('+i+');"><img src="'+pfad_images+'/hotelinfo_buchen.gif" border="0" alt="" vspace="4"></a>');
            document.write('</td>');

            //Hbwertung
            if(showHbw==1){
            document.write('<td class="'+c_strM2+'" onClick="">');
                if(parts[17]!=''){
                    hbw_details=parts[17].split("_");
                    if(hbw_details[0]>1){
                        str_hbw_txt='Hotelbewertungen <br>der Gäste';
                    }
                    else{
                        str_hbw_txt='Hotelbewertung <br>des Gastes';
                    }
                    document.write('<div class="hbwtdlink" onClick="javascript:oHIB(\''+parts[2]+'\',\''+parts[2]+'\',\''+parts[3]+'\',\'9\',\'\',\'\',\''+parts[4]+'\',\''+parts[13]+'\',\'\',\'\',\'\',\'\',\'\',\'hotel\');" title="Hotelbewertungen anzeigen">');
                    document.write('<span class="hbwEmpfehlung">'+hbw_details[0]+'</span> '+str_hbw_txt+' <span class="hothbwlesen">jetzt lesen</span><br>');
                    document.write('<p class="hbwImgline"><img src="'+pfad_images+'/hbw/scale_small/small_scale_'+hbw_details[2]+'.gif" border="0" alt="Gesamtbewertung" title="Gesamtbewertung '+hbw_details[2].substring(0,1)+'.'+hbw_details[2].substring(1,2)+' von 6"><span class="hbwScaletxt">'+hbw_details[2].substring(0,1)+'.'+hbw_details[2].substring(1,2)+'</span></p>');
                    if(hbw_details[0]>1){
                        document.write('<span class="hbwEmpfehlung">Weiterempfehlung '+hbw_details[1]/10+'%</span>');
                    }
                    document.write('</div>');
                }
                else{
                    document.write('Es liegt noch keine<br>Hotelbewertung der<br>Gäste vor.<a href="javascript:void(0);" onmouseover="Tip(hbwTt_infotext,BGIMG,hbwTt_BGIMG,BGCOLOR,hbwTt_BGCOLOR,BORDERWIDTH,hbwTt_BORDERWIDTH,WIDTH,hbwTt_WIDTH,PADDING,hbwTt_PADDING,FONTSIZE,hbwTt_FONTSIZE,FONTFACE,hbwTt_FONTFACE,FONTCOLOR,hbwTt_FONTCOLOR);"><img src="'+pfad_images+'/hbw/info_hotelbewertung.gif" alt="" border="0"></a>');
                }
            document.write('</td>');
            }

            //wunscherfuellung
            document.write('<td class="'+c_strR+'">Übereinstimmung mit<br>Ihren Urlaubswünschen:<br>');
            npw=String(parseInt(parts[15]/5)*5);
            if(npw<80)np=0;
            document.write('<img src="'+pfad_images+'/'+npw+'.gif" alt="" border="0" width="134" height="22" vspace="4"></td>');
            document.write('</tr>');

            if(i!=(regionen_2.length-1))
            {
            document.write('<tr>');
            document.write('<td colspan="'+cols_gesamt+'"><img src="/images/spacer.gif" alt="" border="0" width="1" height="12"></td>');
            document.write('</tr>');
            }

        }
   }
}

function pageSkip(seiten,apage,sortierung){
    for (t=1;t<=seiten;t++)
    {
        zaehler=(t-1)*10;
        if(t!=apage)
           document.write('<a href="javascript:skippen('+zaehler+',\''+sortierung+'\');" class="pageskip" title="Angebote der Seite '+t+' abrufen">'+t+'</a>&nbsp;&nbsp;');
        else
            document.write('<span class="pageaktive">'+t+'</span>&nbsp;&nbsp;');
    }
}

function fillOrte(s_ort, mapIff){ 
    if (typeof(ortsliste) == 'string' && ortsliste != '' && mapIff != '' && mapIff != null && mapIff != 'undefined') { 
        var aIffOrte = ortsliste.split("{");
        for (var t = 0; t < anzahl_treffer_orte; t++) {
            if (mapIff != aIffOrte[t]) {
                document.write('<option value="' + Orte[t] + '">' + Orte[t] + '</option>');     
            } else {
                document.write('<option value="' + Orte[t] + '" SELECTED>' + Orte[t] + '</option>');    
            }
        }
    } else { 
        for (var t = 0; t < anzahl_treffer_orte; t++) {
            if (s_ort != escape(Orte[t])) {
                document.write('<option value="' + Orte[t] + '">' + Orte[t] + '</option>');
            } else {
                document.write('<option value="' + Orte[t] + '" SELECTED>' + Orte[t] + '</option>');
            }
        }
    }
}
//---Karte fuer einen bestimmen Ort anzeigen-----------------
function show_iff_ort(nummer,name){
    //---Testlink
    //var infowin = window.open("../../maps/google/show_iff_ort_google.php?IFF_ORT="+nummer+"&KID="+KID+"&ORTSNAME="+name,"Kartenansicht","width=402,height=447,scrollbars=no");

    //---Onlinelink
    var infowin = window.open("http://www.vidado.com/maps/google/show_iff_ort_google.php?mTStartMod="+mTStartMod+"&KID="+KID+"&IFF_ORT="+nummer+"&ORTSNAME="+name,"Ortsansicht","width=402,height=447,scrollbars=no");

    infowin.focus();
}
//---Kartenauswahl fuer die Orte der Hotelseite anzeigen-----
function select_iff_ort(){
    //---Testlink
    //var infowin = window.open("../../maps/google/select_iff_ort_google.php?url="+encodeURIComponent(url)+"&mTStartMod="+mTStartMod+"&KID="+KID+"&ORTE="+ortsliste,"Kartenansicht","width=730,height=402,scrollbars=no");

    //---Onlinelink
    var infowin = window.open("http://www.vidado.com/maps/google/select_iff_ort_google.php?url="+encodeURIComponent(url)+"&mTStartMod="+mTStartMod+"&KID="+KID+"&ORTE="+ortsliste,"Kartenansicht","width=730,height=402,scrollbars=no");
    
    infowin.focus();
}
/*
function show_iff_hotel(nummer){
    var mTStartMod=1;
    //---Onlinelink
    //var infowin = window.open("http://www.traveltainment2.de/maps/google/show_iff_hotel_google.php?mTStartMod="+mTStartMod+"&IFF="+nummer,"Ortsansicht","width=402,height=447,scrollbars=no");

    //---Testlink intern
    var infowin = window.open("../../googlemaps/show_iff_hotel_google.php?mTStartMod="+mTStartMod+"&IFF="+nummer,"Ortsansicht","width=402,height=447,scrollbars=no");
    infowin.focus();
}
*/
/*
function SearchOrtKarte(ort){
    if(document.searchort){
        var sOrts=document.searchort.elements["s_ort"].options;
        sOrts[sOrts.selectedIndex].value=ort;
        sOrts[sOrts.selectedIndex].text=unescape(ort);
        ortsucher(sOrts[sOrts.selectedIndex].value,document.searchort.sortierung.options[document.searchort.sortierung.options.selectedIndex].value)
    }
    else{
        var sOrts=document.bengine.elements["s_ort"].options;
        var sOrts=document.bengine.elements["s_ort"].options;
        sOrts[sOrts.selectedIndex].value=ort;
        sOrts[sOrts.selectedIndex].text=unescape(ort);
        return BookingAction('hotel');
    }
}
*/
function SearchOrtKarteByIff(ort, code){
    if(document.searchort){
        var valCode = '';
        if (typeof(code) != 'undefined' && code != '' && code != 'undefined' && typeof(document.searchort.mapIffOrt) != 'undefined') {
            document.searchort.mapIffOrt.value = code; 
            valCode = code; 
            if (typeof(ortsliste) != 'undefined' && ortsliste != '') {
                var aIffOrte = ortsliste.split("{");
                for (var t = 0; t < anzahl_treffer_orte; t++) {
                    if (code == aIffOrte[t]) {
                        ort = Orte[t]; 
                        break;        
                    }
                }    
            }                           
        }        
        var sOrts=document.searchort.elements["s_ort"].options;
        sOrts[sOrts.selectedIndex].value=ort;
        sOrts[sOrts.selectedIndex].text=unescape(ort);
        ortsucher(sOrts[sOrts.selectedIndex].value,document.searchort.sortierung.options[document.searchort.sortierung.options.selectedIndex].value, valCode)
    }
    else{        
        if (typeof(code) != 'undefined' && code != '' && code != 'undefined' && typeof(document.bengine.mapIffOrt) != 'undefined') {
            document.bengine.mapIffOrt.value = code;              
            if (typeof(ortsliste) != 'undefined' && ortsliste != '') {
                var aIffOrte = ortsliste.split("{");
                for (var t = 0; t < anzahl_treffer_orte; t++) {
                    if (code == aIffOrte[t]) {
                        ort = Orte[t]; 
                        break;        
                    }
                }    
            }                           
        }
        var sOrts=document.bengine.elements["s_ort"].options;
        sOrts[sOrts.selectedIndex].value=ort;
        sOrts[sOrts.selectedIndex].text=unescape(ort);
        return BookingAction('hotel');
    }
}
