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&H_Name='+part[6]+'&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){
    part=regionen_2[0].split('#');
    window.location.href=uebergabe+'&sortierung='+sortierung+'&detail=hotel&startposition=0&zielgebiets_kenner='+part[10]+'&showresult='+part[11]+'&s_ort='+escape(ort);
}

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,cookie_userid)
{
   var n_AltFlag=0; var n_TopFlag=0;
   var c_strOL,c_strOR,c_strL,c_strM,c_strM2,c_strR,alt_txt;
   var kenner_userid='';
   if (cookie_userid!="")
   {
      var tmpcook=cookie_userid.split('=');
      kenner_userid=tmpcook[1];
   }
   if(regionen_2.length <= 0) {}
   else
   {
        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";
                    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";
                    alt_txt="&nbsp;(alternativ)";
                    if(parts[0]==1){
                        document.write('<tr>');
                        document.write('<td colspan="4" 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="4" class="alttxt">Alternative Reiseangebote die Ihren W&uuml;nschen nahe kommen:</td>');
                    document.write('</tr>');
                    n_AltFlag=1;
                }
            }

            document.write('<tr class="'+c_strTR1+'">');
            document.write('<td id="offer'+i+'" class="'+c_strOL+'" colspan="3">');
            document.write(parts[0]+'. Angebot '+alt_txt);
            document.write('</td>');
            document.write('<td class="'+c_strOR+'">');
            document.write('<a class="'+c_strLink+'" href="javascript:s_termine('+i+');">ab '+parts[1]+',-&euro;</a>');
            document.write('</td>');
            document.write('</tr>');

            document.write('<tr class="'+c_strTR2+'">');
            //thumbnail
            document.write('<td class="'+c_strL+'" rowspan="2"><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+'" rowspan="2">');
            document.write('<a href="javascript:oHIB(\''+parts[2]+'\',\''+parts[2]+'\',\''+parts[3]+'\',\'1\',\'\',\'\',\''+parts[4]+'\',\''+parts[13]+'\',\'\',\'\',\'\',\'\',\'\',\'hotel\');" title="Hotel- und Leistungsbeschreibungen aufrufen"><b>'+parts[6]+'</b></a>');
            document.write('<br><img src="/images/spacer.gif" height="5" alt="" border="0"><br>');
            nSterne=Math.floor(parts[4]*10);
            document.write(MakeStars(nSterne,pfad_images));
            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>');
            document.write('<td class="'+c_strM2+'" rowspan="2">');
            //Hbwertung
            if(showHbw==1){
                if(parts[15]!=''){

                    hbw_details=parts[15].split("_");
                    var tmplur = "";
                    var tmplur2 = "";
                    if(hbw_details[0]==1)
                    {
                        tmplur = "";
                        tmplur2 = "des Gastes";
                    }
                    else
                    {
                        tmplur = "en";
                        tmplur2 = "der Gäste";
                    }
                    document.write('<a href="javascript:oHIB(\''+parts[2]+'\',\''+parts[2]+'\',\''+parts[3]+'\',\'9\',\'\',\'\',\''+parts[4]+'\',\''+parts[13]+'\',\'\',\'\',\'\',\'\',\'\',\'hotel\');" class="hothbwl">');
                    document.write('<span class="hbwEmpfehlung">'+hbw_details[0]+'</span> Hotelbewertung'+tmplur+'<br>'+tmplur2+' <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('Weiterempfehlung <span class="hbwEmpfehlung">'+hbw_details[1]/10+'%</span>');
                    document.write('</a>');
                }
                else{
                    var strHBWTT = "Bei den Hotelbewertungen handelt es sich um einen neuen Service, damit Sie sich anhand von Beurteilungen anderer Urlauber ein noch besseres Bild von Ihrem Wunschhotel machen können. Damit gewährleistet ist, dass nur tatsächlich gereiste Urlauber ihre Bewertung abgeben, bitten wir ausschließlich Kunden, die seit 2007 bei uns gebucht haben, nach ihrer Rückkehr um ihr Urteil. Bitte haben Sie Verständnis dafür, dass wir deshalb keine Bewertungen von anderen Urlaubern veröffentlichen können. Sollten Sie aber eine Reise über unser Portal buchen, werden wir Sie gerne nach Ihrer Rückkehr anschreiben und um Ihre Beurteilung bitten.<br><br>";
                    document.write('Es liegt noch keine<br>Hotelbewertung der<br>Gäste vor.<img id="ttip_hbw'+i+'" style="cursor:default;margin-left:5px;vertical-align: middle; margin: 0 0 3px 3px;" onmouseover="Tip(\''+strHBWTT+'\',FOLLOWMOUSE,false,BGIMG,\'/kunden_parameter/weg_payback/ibe_v2/images/hbw/bubble_red_ibe_weg.gif\',BGCOLOR,\'\',BORDERWIDTH,0,WIDTH,257,PADDING,9,FIX,[getPosition(document.getElementById(\'ttip_hbw'+i+'\')).x+12,getPosition(document.getElementById(\'ttip_hbw'+i+'\')).y-36],FONTSIZE,\'10px\');" src="/kunden_parameter/weg_payback/ibe_v2/images/info_glh.gif" alt="" border="0">');
                }
            }
            else
            {
                document.write('&nbsp;');
            }
            document.write('</td>');

            //Angebote Merken
            document.write('<td class="'+c_strR+'" valign="top">');
            var str_Hattbut="";
            if(parts[14] & 1)
                str_Hattbut="Familie<br>";
            if(parts[14] & 2)
                str_Hattbut+="Direkte Strandlage<br>";
            if(parts[14] & 4)
                str_Hattbut+="Großes Sportangebot<br>";
            if(parts[14] & 8)
                str_Hattbut+="Wellness-Fitness<br>";
            //str_Hattbut=str_Hattbut.substring(0,(str_Hattbut.length-2));
            document.write(str_Hattbut);

            if(parts[14] & 131072)
                document.write('<span class="fruehtx">Frühbucherermäßigung</span><br>');
            if(parts[14] & 65536)
                document.write('<span class="kindtx">Kinderermäßigung</span><br>');

            document.write('&nbsp;</td>');
            document.write('</tr>');

            document.write('<tr class="'+c_strTR2+'">');
            document.write('<td valign="bottom" height="20">');

            if (kenner_userid!="" && kenner_userid!=0) {
            document.write('<a href="javascript:openmemo('+i+',\''+kenner_userid+'\');"><img src="'+pfad_images+'/angebot_merken.gif" alt="" border="0"></a>');
            }
            document.write('&nbsp;</td>');
            document.write('</tr>');

            if(i!=(regionen_2.length-1))
            {
            document.write('<tr>');
            document.write('<td colspan="4" style="border-bottom: 1px solid #CCCCCC;"><img src="/images/spacer.gif" alt="" border="0" width="1" height="12"></td>');
            document.write('</tr>');
            }

        }
   }
}

function pageSkip(seiten,apage,sortierung,css_classZusatz){
    for (t=1;t<=seiten;t++)
    {
        zaehler=(t-1)*10;
        if(t!=apage)
           document.write('<a href="javascript:skippen('+zaehler+',\''+sortierung+'\');" class="pageskip'+css_classZusatz+'" title="Angebote der Seite '+t+' abrufen">'+t+'</a>&nbsp;&nbsp;');
        else
            document.write('<span class="pageaktive'+css_classZusatz+'">'+t+'</span>&nbsp;&nbsp;');
    }
}

function fillOrte(s_ort, mapIff){   
    if (typeof(ortsliste) == 'string' && ortsliste != '' && mapIff != '' && mapIff != null) {
        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>');
        }
    }
}

function openmemo(eintrag,kenner_userid) {
    part=regionen_2[0].split('#');
    hotelmerken=regionen_2[eintrag].replace(/#/g,"§");
    window.location.href=uebergabe+'&detail=hotel&zielgebiets_kenner='+part[10]+'&showresult='+part[11]+'&kenner_userid='+kenner_userid+'&hotelmerken='+hotelmerken+'#offer'+eintrag;
}

//---Aufruf Kartentool Google
function select_iff_ort(){
    //---entwicklung
    //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");

    //---Online
    var infowin = window.open("http://www.vidado.com/maps/google/select_iff_ort_google.php?url=http://"+document.domain+"/&mTStartMod="+mTStartMod+"&KID="+KID+"&ORTE="+ortsliste,"Kartenansicht","width=730,height=402,scrollbars=no");
    infowin.focus();
}
//---Aufruf der Seite ueber Kartentool
function SearchOrtKarteByIff(ort, code){ 
    var aIffOrte = ortsliste.split("{");
    for (var t = 0; t < anzahl_treffer_orte; t++) {
        if (code == aIffOrte[t]) {
            ort = Orte[t];
            break;        
        }
    }
    document.bengine.s_ort.value     = ort;
    document.bengine.mapIffOrt.value = code; 
    return BookingAction('hotel');
    document.getElementById('tt_ortsauswahlOpacBox').style.display = 'none';
}
//---Aufruf der Seite ueber Kartentool
function SearchOrtKarte(ort){
    var sOrts=document.bengine.elements["s_ort"].options;
    sOrts[sOrts.selectedIndex].value=ort;
    sOrts[sOrts.selectedIndex].text=unescape(ort);
    return BookingAction('hotel');
}
