/*  */



var weinziele = new Array();

weinziele["BIO"] = "/de/offers/weinziel_BIO.html";

weinziele["MRS"] = "/de/offers/weinziel_MRS.html";

weinziele["NAP"] = "/de/offers/weinziel_NAP.html";

weinziele["PMO"] = "/de/offers/weinziel_PMO.html";

weinziele["PSA"] = "/de/offers/weinziel_PSA.html";

weinziele["STR"] = "/de/offers/weinziel_STR.html";

weinziele["VLC"] = "/de/offers/weinziel_VLC.html";

weinziele["VCE"] = "/de/offers/weinziel_VCE.html";

var flugziele = new Array();

flugziele["AYT"] = "/de/destinations/antalya.php";


flugziele["BRI"] = "/de/destinations/bari.php";


flugziele["BSL"] = "/de/destinations/basel.php";


flugziele["TXL"] = "/de/destinations/berlin.php";


flugziele["CGN"] = "/de/destinations/bonn.php";


flugziele["BDS"] = "/de/destinations/brindisi.php";


flugziele["CAG"] = "/de/destinations/cagliari.php";


flugziele["CTA"] = "/de/destinations/catania.php";


flugziele["DLM"] = "/de/destinations/dalaman.php";


flugziele["DBV"] = "/de/destinations/dubrovnik.php";


flugziele["DUS"] = "/de/destinations/duesseldorf.php";


flugziele["FRA"] = "/de/destinations/frankfurt_main.php";


flugziele["GRZ"] = "/de/destinations/graz.php";


flugziele["HAM"] = "/de/destinations/hamburg.php";


flugziele["HAJ"] = "/de/destinations/hannover.php";


flugziele["INN"] = "/de/destinations/innsbruck.php";


flugziele["CAI"] = "/de/destinations/kairo.php";


flugziele["FKB"] = "/de/destinations/karlsruhe.php";


flugziele["KLU"] = "/de/destinations/klagenfurt_kaernten.php";


flugziele["CGN"] = "/de/destinations/koeln.php";


flugziele["LEJ"] = "/de/destinations/leipzig.php";


flugziele["MXP"] = "/de/destinations/mailand.php";


flugziele["PMI"] = "/de/destinations/palma_de_mallorca.php";


flugziele["MAN"] = "/de/destinations/manchester.php";


flugziele["FMM"] = "/de/destinations/memmingen.php";


flugziele["MUC"] = "/de/destinations/muenchen.php";


flugziele["FMO"] = "/de/destinations/muenster.php";


flugziele["NDR"] = "/de/destinations/nador.php";


flugziele["NAP"] = "/de/destinations/neapel.php";


flugziele["NCL"] = "/de/destinations/newcastle.php";


flugziele["NUE"] = "/de/destinations/nuernberg.php";


flugziele["OLB"] = "/de/destinations/olbia_sardinien.php";


flugziele["FMO"] = "/de/destinations/osnabrueck.php";


flugziele["PAD"] = "/de/destinations/paderborn.php";


flugziele["PMO"] = "/de/destinations/palermo_sizilien.php";


flugziele["PSA"] = "/de/destinations/pisa_florenz.php";


flugziele["OPO"] = "/de/destinations/porto.php";


flugziele["RJK"] = "/de/destinations/rijeka.php";


flugziele["RMI"] = "/de/destinations/rimini.php";


flugziele["CIA"] = "/de/destinations/rom.php";


flugziele["SZG"] = "/de/destinations/salzburg.php";


flugziele["ARN"] = "/de/destinations/stockholm.php";


flugziele["STR"] = "/de/destinations/stuttgart.php";


flugziele["GWT"] = "/de/destinations/sylt.php";


flugziele["VLC"] = "/de/destinations/valencia.php";


flugziele["VCE"] = "/de/destinations/venedig.php";


flugziele["ZQW"] = "/de/destinations/zweibruecken.php";


function switchLanguage(langURL) {
   //get lang from url
   var siteURL = location.pathname.split("/");
   var siteLang = siteURL[1];
   
   //get lang from next url
   var selURL = langURL.split("/");
   var nextLang = selURL[1];
   
   if(siteLang == "de" && nextLang == "de") {
    if(selURL[2].indexOf("_at.") != -1) document.cookie = "userLang=at;" ;
    else document.cookie = "userLang=de;" ;
   }
   else if(siteLang == "en" && nextLang == "en") {
    if(selURL[2].indexOf("_ire.") != -1) document.cookie = "userLang=ire;" ;
    else document.cookie = "userLang=en;" ;
   }
   
   document.location.href=langURL;
  }
function registerNewsletter(email, sex, firstname, lastname, country, airport, language, source)
{
  var newsletterPixel = new Image();
  var pixelURL = '/cgi-bin/newsletter.pl?'
  pixelURL = pixelURL + "email=" + encodeURI(email);
  pixelURL = pixelURL + "&sex=" + encodeURI(sex);
  pixelURL = pixelURL + "&firstname=" + encodeURI(firstname);
  pixelURL = pixelURL + "&lastname=" + encodeURI(lastname);
  pixelURL = pixelURL + "&country=" + encodeURI(country);
  pixelURL = pixelURL + "&airport=" + encodeURI(airport);
  pixelURL = pixelURL + "&language=" + encodeURI(language);
  pixelURL = pixelURL + "&source=" + encodeURI(source);
  
  newsletterPixel.src = pixelURL;
}
function gotoInterrent() 
{
 var linkurl = "http://www.interrent.de/innsbruck/TUIfly.com/Homepage.do";
  
 window.open(linkurl,"blank");
}
function showFlugziel(kuerzel) {
 if(flugziele[kuerzel]) {
  top.location.href = flugziele[kuerzel];
 }
else {
    alert("Zu diesem Flugziel gibt es keine Übersichtsseite.")}
}
function showWeinziel(kuerzel) {
 if(weinziele[kuerzel]) {
  top.location.href = weinziele[kuerzel];
 }
else {
    alert("Zu diesem Flugziel gibt es keine Weinseite.")}
}
function popup(url,name,param) {
 var sizeX = 0;
 var sizeY = 0;
 var winX=screen.availWidth;
 var winY=screen.availHeight;
 
 var tmpArray = param.split(",");
 for(i=0;i<tmpArray.length;i++) {
  if(tmpArray[i].indexOf("width") != -1) { tmpArray2 = tmpArray[i].split("="); sizeX = tmpArray2[1];}
  if(tmpArray[i].indexOf("height") != -1) { tmpArray2 = tmpArray[i].split("="); sizeY = tmpArray2[1];}
 }
  
 var centerX=eval(winX/2-sizeX/2);
 var centerY=eval(winY/2-sizeY/2);
 
 param +=',top='+centerY+',left='+centerX;
 var winChild = window.open(url,name,param+',dependent=yes');
 if(winChild != null && winChild.focus)
    winChild.focus();
}
function switchFormToDynamic(form) {
 return;
}
function buildLink(link, isDynamic) {
 var newLink = link;
 var m =
 document.location.href.match(/^(http[s]?):\/\/([^\/]*)(\/.*)$/i);
 if (m != null) {
  var protocol = m[1];
  var host = m[2];
  var path = m[3];
  var i = path.lastIndexOf('/');
  var dir=path.substring(0,i+1);
  // check port
  m = host.match(/^([^:]*):[0-9]*$/);
  if (m != null) {
   host = m[1];
  }
                
  m = newLink.match(/^(http[s]?):\/\/([^\/]*)(\/.*)$/i);
  if (m != null) {
   // full url extract protocol
   protocol = m[1];
   newLink = m[3];
  }
  if (newLink.charAt(0) != '/') {
   newLink = dir + newLink;
  }
  if (protocol == 'https') {
   if (isDynamic) {
    host = document.dynamic_server_ssl;
   } else {
    host = document.static_server_ssl;
   }
  } else {
   if (isDynamic) {
    host = document.dynamic_server;
   } else {
    host = document.static_server;
   }
  }
  newLink = host + newLink;
 }
        return newLink;
}
//function switchFormToDynamic(form) {
//        if (!form) {
//                return;
//        }
//        var m = document.location.href.match(/^(http[s]?):\/\/([^\/]*)(\/.*)$/i);
//        if (m != null) {
//                var protocol = m[1];
//                var host = m[2];
//                var path = m[3];
//                var i = path.lastIndexOf('/');
 //               var dir=path.substring(0,i+1);
//                
//                // check port
//                m = host.match(/^([^:]*):[0-9]*$/);
//                if (m != null) {
//                        host = m[1];
//                }
//                
//                var action = form.action;
//                m = action.match(/^(http[s]?):\/\/([^\/]*)(\/.*)$/i);
//                if (m != null) {
//                        // full url extract protocol
//                        protocol = m[1];
//                        action = m[3];
//                }
//                if (action.charAt(0) != '/') {
//                        action = dir + action;
//                }
//                if (host.indexOf('TUIfly.com') >= 0) {
//                        // live
//                        host = 'book.TUIfly.com';
//                } else {
 //                       if (protocol == 'http') {
 //                               host = host + ':9080';
//                        } else {
//                                host = host + ':9443';
 //                       }
 //               }
//                action = protocol + '://' + host + action;
//                form.action = action;
//        }
//}
var autoCodes = new Array();
autoCodes["BRI"] = "BRIT01";
autoCodes["TXL"] = "TXLT01";
autoCodes["BIO"] = "BIOT01";
autoCodes["SZG"] = "SZGT01";
autoCodes["CVT"] = "CVTT01";
autoCodes["DUB"] = "DUBT01";
autoCodes["HHN"] = "HHNT03";
autoCodes["GVA"] = "GVAT01";
autoCodes["KLU"] = "KLUT01";
autoCodes["KTW"] = "KTWT01";
autoCodes["CGN"] = "CGNT01";
autoCodes["HAM"] = "HAMT01";
autoCodes["HAJ"] = "HAJT01";
autoCodes["BGY"] = "BGYT01";
autoCodes["MAN"] = "MANT01";
autoCodes["MRS"] = "MRST01";
autoCodes["MUC"] = "MUCT01";
autoCodes["NAP"] = "NAPT01";
autoCodes["NCL"] = "NCLT01";
autoCodes["OLB"] = "OLBT02";
autoCodes["PMO"] = "PMOT01";
autoCodes["PMI"] = "PMIT01";
autoCodes["PSA"] = "PSAT01";
autoCodes["CIA"] = "CIAT01";
autoCodes["SVQ"] = "SVQT01";
autoCodes["STR"] = "STRT01";
autoCodes["GWT"] = "GWTC01";
autoCodes["VLC"] = "VLCT01";
autoCodes["VCE"] = "VCET01";
autoCodes["WAW"] = "WAWT01";
autoCodes["OPO"] = "OPOT01";
autoCodes["RMI"] = "RMIT01";
autoCodes["CTA"] = "CTAT01";
autoCodes["GOA"] = "GOAT01";
autoCodes["NCE"] = "NCET01";
autoCodes["BHX"] = "BHXT01";
autoCodes["ORY"] = "ORYT02";
function openAuto(code,ecLink)
{
  if(code == "PMI")
  {
    top.location.href = url_auto + "?TUIMietwagen&Land=Spanien&Ort=Mallorca";
  }  
  else if (code == "TURBO"){
    top.location.href= url_auto + "?MCS="+ecLink;
  }
  else
  {
    top.location.href= url_auto + "?locale=DE&MCS=https://microsite.europcar.com/hapaglloydexpress&IATA=0677316&PROMO=41113594&FTPROG=false&CNTRY=DE&STATIONCO=" + autoCodes[code] + "&ACRISS=C";
  }
}
var hotelCodes = new Array();
hotelCodes["BRI"] = "Apulien & Molise";
hotelCodes["TXL"] = "Berlin";
hotelCodes["BIO"] = "Baskenland / País Vasco";
hotelCodes["CVT"] = "England / West Midlands";
hotelCodes["DUB"] = "Osten / Leinster / Dublin & Umgebung";
hotelCodes["EDI"] = "Schottland";
hotelCodes["HAM"] = "Hamburg";
hotelCodes["HAJ"] = "Hannover & Umgebung";
hotelCodes["KLU"] = "Kärnten & Osttirol";
hotelCodes["CGN"] = "Köln";
hotelCodes["BGY"] = "Northern Italy / Milan & environs";
hotelCodes["PMI"] = "Balearen / Mallorca";
hotelCodes["MAN"] = "England / Nordwesten";
hotelCodes["MRS"] = "Provence-Alpes-Côte d'Azur";
hotelCodes["MUC"] = "Bayern / München & Umgebung";
hotelCodes["NAP"] = "Kampanien / Neapel & Umgebung";
hotelCodes["NCL"] = "England / Nordosten / Northumberland";
hotelCodes["OLB"] = "Sardinien (Norden)";
hotelCodes["PMO"] = "Sizilien / Palermo & Umgebung";
hotelCodes["PSA"] = "Toskana";
hotelCodes["CIA"] = "Latium / Rom & Umgebung";
hotelCodes["RJK"] = "Kvarner Bucht / Rijeka";
hotelCodes["SZG"] = "Salzburg Stadt";
hotelCodes["STR"] = "Stuttgart & Umgebung";
hotelCodes["ARN"] = "Stockholm & Umgebung";
hotelCodes["SNN"] = "Süden / Munster";
hotelCodes["VLC"] = "Valencia & Umgebung";
hotelCodes["VCE"] = "Venetien & Friaul-Julisch Venetien";
function openHotel(code) {
 //falls die flugziele nicht angepasst sind
 if(code == "BRI") code = "Apulien & Molise";
 else if(code == "TXL") code = "Berlin";
 else if(code == "BIO") code = "Baskenland / País Vasco";
 else if(code == "CVT") code = "England / West Midlands";
 else if(code == "DUB") code = "Osten / Leinster / Dublin & Umgebung";
 else if(code == "EDI") code = "Schottland";
 else if(code == "HAM") code = "Hamburg";
 else if(code == "HAJ") code = "Hannover & Umgebung";
 else if(code == "KLU") code = "Kärnten & Osttirol";
 else if(code == "CGN") code = "Köln";
 else if(code == "BGY") code = "Northern Italy / Milan & environs";
 else if(code == "PMI") code = "Balearen / Mallorca";
 else if(code == "MAN") code = "England / Nordwesten";
 else if(code == "MRS") code = "Provence-Alpes-Côte d'Azur";
 else if(code == "MUC") code = "Bayern / München & Umgebung";
 else if(code == "NAP") code = "Kampanien / Neapel & Umgebung";
 else if(code == "NCL") code = "England / Nordosten / Northumberland";
 else if(code == "OLB") code = "Sardinien (Norden)";
 else if(code == "PMO") code = "Sizilien / Palermo & Umgebung";
 else if(code == "PSA") code = "Toskana";
 else if(code == "CIA") code = "Latium / Rom & Umgebung";
 else if(code == "RJK") code = "Kvarner Bucht / Rijeka";
 else if(code == "SZG") code = "Salzburg Stadt";
 else if(code == "STR") code = "Stuttgart & Umgebung";
 else if(code == "ARN") code = "Stockholm & Umgebung";
 else if(code == "SNN") code = "Süden / Munster";
 else if(code == "VLC") code = "Valencia & Umgebung";
 else if(code == "VCE") code = "Venetien & Friaul-Julisch Venetien";
 
 //flugziel url-konform codieren
 code = escape(code);
 
 top.location.href = url_hotel +"?Hotelportal&Reiseziel=" + code;
}
function openHotelEn(code) {
 //falls die flugziele nicht angepasst sind
 if(code == "BRI") code = "Apulia";
 else if(code == "TXL") code = "Berlin";
 else if(code == "BIO") code = "Baskenland / País Vasco";
 else if(code == "CVT") code = "England / West Midlands";
 else if(code == "DUB") code = "East / Leinster";
 else if(code == "EDI") code = "Edinburgh";
 else if(code == "HAM") code = "Hamburg";
 else if(code == "HAJ") code = "Hanover";
 else if(code == "KLU") code = "Carinthia & Eastern Tyrol";
 else if(code == "CGN") code = "Cologne";
 else if(code == "BGY") code = "Northern Italy / Milan & environs";
 else if(code == "PMI") code = "Balearic Islands / Majorca";
 else if(code == "MAN") code = "England / North West";
 else if(code == "MRS") code = "Provence-Alpes-Côte d'Azur ";
 else if(code == "MUC") code = "Munich & environment";
 else if(code == "NAP") code = "Naples & environs";
 else if(code == "NCL") code = "England / North East / Northumberland";
 else if(code == "OLB") code = "Sardinia (Northern parts)";
 else if(code == "PMO") code = "Sicily / Palermo & environs";
 else if(code == "PSA") code = "Tuscany";
 else if(code == "CIA") code = "Lazio / Rome";
 else if(code == "RJK") code = "Kvarn Bay / Rijeka";
 else if(code == "SZG") code = "Salzburg City";
 else if(code == "STR") code = "Stuttgart";
 else if(code == "ARN") code = "Stockholm";
 else if(code == "SNN") code = "South / Munster";
 else if(code == "VLC") code = "Valencia";
 else if(code == "VCE") code = "Venice & environs";
 //flugziel url-konform codieren
 code = escape(code);
 
 top.location.href = url_hotel + "?Hotelportal&Locale=en_GB&Reiseziel=" + code;
}
function openFlugHotel(code)
{
  top.location.href = url_flugHotel + "?cid=TUIfly.com.LOC.0001&_cmd=start.locomat.query&_destination=" + code;
}
    interhome = new Array();
    interhome['BRI'] = "&countrycode=I&regioncode=77";
    interhome['TXL'] = "dummyk=1&dummys=D&dummya=50519&dummyc=D&OK";
    interhome['BIO'] = "&countrycode=E&xregioncode=08";
    interhome['CVT'] = "dummyk=333&dummys=D&dummya=50519&dummyc=GB&OK";
    //interhome['DUB'] = "dummyk=1&dummys=D&dummya=50519&dummyc=EI&region_kz=IRL&OK";
    interhome['DUB'] = "dummyk=1&dummys=D&dummya=50519&dummyc=IRL&anlageart=fh&OK";
    interhome['GVA'] = "&countrycode=C&xregioncode=01";
    interhome['HAM'] = "dummyk=1&dummys=D&dummya=50519&dummyc=D&OK";
    interhome['HAJ'] = "dummyk=1&dummys=D&dummya=50519&dummyc=D&OK";
    interhome['KLU'] = "&countrycode=A&regioncode=70";
    interhome['CGN'] = "dummyk=1&dummys=D&dummya=50519&dummyc=D&OK";
    interhome['MXP'] = "dummyk=333&dummys=D&dummya=50519&dummyc=I&OK";
    interhome['MAN'] = "dummyk=1&dummys=D&dummya=50519&dummyc=GB&region_kz=ENG&OK";
    interhome['BHX'] = "dummyk=1&dummys=D&dummya=50519&dummyc=GB&region_kz=ENG&OK";
    interhome['MRS'] = "&countrycode=F&regioncodegrouper=75-77";
    interhome['NAP'] = "&countrycode=I&regioncode=70";
    interhome['NCL'] = "dummyk=1&dummys=D&dummya=50519&dummyc=GB&OK";
    interhome['OLB'] = "&countrycode=I&regioncode=90";
    interhome['PMO'] = "&countrycode=I&regioncode=80";
    interhome['PMI'] = "&countrycode=E&regioncode=90";
    interhome['PSA'] = "&countrycode=I&regioncode=42";
    interhome['FCO'] = "dummyk=333&dummys=D&dummya=50519&dummyc=I&OK";
    interhome['SZG'] = "&countrycode=A&regioncode=30";
    interhome['SVQ'] = "&countrycode=E&xregioncode=48";
    interhome['STR'] = "dummyk=1&dummys=D&dummya=50519&dummyc=D&region_kz=DSW&OK";
    interhome['VLC'] = "&countrycode=E&regioncode=40";
    interhome['VCE'] = "&countrycode=I&regioncode=25";
    interhome['CIA'] = "&countrycode=I&regioncode=60&nrefgrouper=i5602-i5895";
    interhome['MUC'] = "&countrycode=D&regioncode=23";
    interhome['RJK'] = "&countrycode=H&regioncode=30";
    interhome['ARN'] = "dummyk=1&dummys=D&dummya=50519&dummyc=S&region_kz=STK&OK";
    interhome['CAG'] = "&countrycode=I&regioncode=90";
    interhome['CTA'] = "&countrycode=I&regioncode=80";
    interhome['OPO'] = "&countrycode=P&regioncode=01";
    interhome['ORY'] = "&countrycode=F&placecode=1000";
    interhome['LEJ'] = "&countrycode=D&regioncode=D15";
    interhome['DBV'] = "&countrycode=H&regioncode=60";
    interhome['GOA'] = "&countrycode=I&regioncode=41";
    interhome['RMI'] = "&countrycode=I&regioncode=30";
    /* Spezial Link fuer Skiforfree Salzburger Land*/
    interhome['SBL'] = "&countrycode=A&regioncode=30&nrefgrouper=a5020-a5771"; 
    interhome['SUF'] = "&countrycode=I&regioncode=75";
    interhome['MAH'] = "&countrycode=E&regioncode=90&nrefgrouper=e7690-e7785";
    interhome['AGP'] = "&countrycode=E&regioncode=51&nrefgrouper=e5405-e5760";
    interhome['XRY'] = "&countrycode=E&regioncode=52&nrefgrouper=e5800-e5995";
    interhome['FAO'] = "&countrycode=P&regioncode=20";
    interhome['BJV'] = "&countrycode=W&regioncode=05";
    interhome['AYT'] = "&countrycode=W&regioncode=10";
    interhome['HER'] = "&countrycode=X&regioncode=60";
    interhome['CFU'] = "&countrycode=X&regioncode=10";
    interhome['IBZ'] = "&countrycode=E&regioncode=90&nrefgrouper=e7080-e7430";
function openFerienwohnung(code)
{
    if (interhome[code])
    {
     if (interhome[code].indexOf('countrycode') != -1)
     {
      //   top.location.href = url_ferienwohnungen + "?so=59&userlang=01&partnerid=590794&css_style=partner_css_590794_.css&ihnav=N" + interhome[code];
         top.location.href = url_ferienwohnungen + "?userlang=01&so=59&partnerid=590794&ihnav=N" + interhome[code];
     }
     if (interhome[code].indexOf('dummya=50519') != -1)
     {
         top.location.href = url_ferienwohnungen + "?" + interhome[code];
     }
    }
    else
    {
        top.location.href = url_ferienwohnungen;
    }
}
function submitForm_ferienwohnung()
{
  // alt: http://www.interhome.de/buchung/listcatalog.asp?so=59&userlang=01&partnerid=590794&css_style=partner_css_590794_.css&ihnav=N
  
  formular = document.fewo;
    code = formular.destination[formular.destination.selectedIndex].value;
    if (interhome[code])
    {
        if (interhome[code].indexOf('countrycode') != -1)
        {
           //alt !nur bis 01.02.2007! this.location.href = "http://www.interhome.de/buchung/main_miniprice.asp?userlang=01&so=59&partnerid=590794&css_style=partner_css_590794_.css&ihnav=N" + interhome[code];
           this.location.href = "http://www.interhome.de/buchung/listcatalog.asp?userlang=01&so=59&partnerid=590794&ihnav=N" + interhome[code];
        }
        if (interhome[code].indexOf('dummya=50519') != -1)
        {
            this.location.href = "http://www.ferienhaus-allianz.de/ferienhaeuser.html?" + interhome[code];
        }
    }
}
// Überprüft ein Datum im Format yyyyMMdd
function isValidDate( dateString )
{
 var day = dateString.substring(6,8);
 var month = dateString.substring(4,6);
 var year = dateString.substring(0,4);
 var dteDate;
 dteDate=new Date(year,month-1,day);
  
 return ((day==dteDate.getDate()) && (month==dteDate.getMonth()+1) &&
(year==dteDate.getFullYear()));
}
function openTiefstpreisseite(code)
{
  if (code)
    {
    top.location.href = url_tiefstpreisseite + "&destination=" + code;
    }
  else
    {
    top.location.href = url_tiefstpreisseite;
    }
}
// Zeitungsabo
function addon(){
  var name = document.itinerary_info.contact_name.value.split("|");
  var vorname = unescape(name[1]);
  var nachname = unescape(name[0]);
  var strasse = document.itinerary_info.contact_address1.value;
  var strasse2 = document.itinerary_info.contact_address1.value;
      var str_sub = strasse.lastIndexOf(" ");
      if (str_sub != -1){
          var str_laenge = strasse.length;
          var str = unescape(strasse.substring(0,str_sub));
          ++str_sub;
          var nr = unescape(strasse2.substring(str_sub,str_laenge)); 
      }
      else {
          str = strasse;
          nr = "";
      }
  var plz = document.itinerary_info.contact_zip.value;
  var ort = document.itinerary_info.contact_city.value;
  var phone = document.itinerary_info.contact_phone.value;
  var email = document.itinerary_info.email.value;
  var aboParams = "/de/popup/7392.html?vorname=" + vorname + "&nachname=" + nachname + "&str=" + str + "&nr=" + nr + "&plz=" + plz + "&ort=" + ort + "&phone=" + phone + "&email=" + email;
 popup(aboParams,'popup','width=743,height=560,scrollbars=yes');   
}
var plzArray = new Array (30159,30161,30163,30165,30167,30169,30171,30173,30175,30177,30179,30419,30449,30451,30453,30455,30457,30459,30519,30539,30559,30625,30627,30629,30655,30657,30659,30823,30826,30827,30851,30853,30855,30880,30890,30900,30916,30926,30938,30952,30966,30974,30982,30989,31275,31303,31311,31319,31515,31535,31832,31848,31157);
   
 function checkPlzArray(plz) {
  var i;
  for (i=0;i<plzArray.length;i++) {
    if(plzArray[i] == plz) {
      return true;
    }
  }
  return false;
}


// Auto Codes TURBO SOLUTION
var airportCode = new Array();
airportCode["DUB"] = "ECMN,EDMN,CCMN,IDMR,FVMR";
airportCode["SZG"] = "EBMN,EDMR,CDMR,IDMR,FVMR";
airportCode["KLU"] = "EBMN,EDMR,CDMR,IDMR,FVMR";
airportCode["RJK"] = "EBMN,EDMN,CDMR,IVMR,SVMR";
airportCode["MUC"] = "EBMN,CLMR,IDMR,SDMR,FVMR";
airportCode["TXL"] = "EBMN,CLMR,IDMR,SDMR,FVMR";
airportCode["CGN"] = "EBMN,CLMR,IDMR,SDMR,FVMR";
airportCode["HAM"] = "EBMN,CLMR,IDMR,SWMR,FVMR";
airportCode["HAJ"] = "EBMN,CLMR,IDMR,SWMR,FVMR";
airportCode["LEJ"] = "EBMN,CLMR,IDMR,SDMR,FVMR";
airportCode["STR"] = "EBMN,CLMR,IDMR,SDMR,FVMR";
airportCode["DUS"] = "EBMN,CLMR,IDMR,SDMR,FVMR";
airportCode["BIO"] = "ECMR,CCMR,CDMR,IVMR,FVMR";
airportCode["PMI"] = "EBMR,ECMR,CCMR,CDMR,FVMR";
airportCode["VLC"] = "ECMR,CCMR,CDMR,IVMR,FVMR";
airportCode["MRS"] = "EBMR,EDMR,CDMR,IVMR,SWMR";
airportCode["ORY"] = "EBMR,EDMR,CDMR,IVMR,SWMR";
airportCode["CVT"] = "ECMN,EDMN,CDMN,IDMR,FVMN";
airportCode["EDI"] = "EBMN,EDMN,CDMN,IDMR,FVMN";
airportCode["MAN"] = "EBMN,EDMN,CDMN,IVMR,FVMN";
airportCode["NCL"] = "EDMN,EDMN,CDMN,IVMR,FVMN";
airportCode["SNN"] = "ECMN,EDMN,CCMN,IDMR,FVMR";
airportCode["BRI"] = "EBMR,EDMR,CDMR,IVMR,FVMR";
airportCode["CAG"] = "EBMR,EDMR,CDMR,CWMR,IVMR";
airportCode["CTA"] = "EBMR,EDMR,CDMR,IVMR,FVMR";
airportCode["CIA"] = "EBMN,EDMR,CDMR,CWMR,IVMR";
airportCode["MXP"] = "EBMR,EDMR,CDMR,IVMR,FVMR";
airportCode["BGY"] = "EBMR,EDMR,CDMR,CWMR,IVMR";
airportCode["NAP"] = "EBMR,EDMR,CDMR,IVMR,SVMR";
airportCode["OLB"] = "EBMR,EDMR,CDMR,CWMR,IVMR";
airportCode["PMO"] = "EBMR,EDMR,CDMR,IVMR,FVMR";
airportCode["PSA"] = "EBMR,EDMR,CDMR,IVMR,FVMR";
airportCode["VCE"] = "EBMR,EDMR,CDMR,IVMR,FVMR";
airportCode["ARN"] = "ECMN,CCMN,CDMR,IDMN,SVMN";
airportCode["OPO"] = "EBMN,EDMN,CDMR,IDMR,CWMR";
airportCode["DBV"] = "EBMN,EDMN,CDMR,IVMR,IDMR";
airportCode["BHX"] = "EDMN,CCMN,CXMN,IDMR,FVMN";
airportCode["GOA"] = "EBMR,EDMR,CDMR,CWMR,IVMR";
airportCode["RMI"] = "EBMR,EDMR,CDMR,CWMR,IVMR";
airportCode["INN"] = "EBMN,EDMR,CDMR,IDMR,FVMR";
airportCode["LCA"] = "MCMN,ECMR,CDMR,IFMN,FFMR";
airportCode["NCE"] = "EBMN,EDMR,CDMR,IVMR,FVMR";
airportCode["BRE"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["FMO"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["FRA"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["GWT"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["NUE"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["PAD"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["SCN"] = "EBMR,CLMR,IDMR,SDMR,FVMR";
airportCode["CFU"] = "ECMR,EDMR,CDMR,IFMN,PVMR";
airportCode["CHQ"] = "ECMR,EDMR,CDMR,IFMN,PVMR";
airportCode["GPA"] = "MCMR,ECMR,EDMR,CDMR,IFMN,PVAR";
airportCode["HER"] = "ECMR,EDMR,CDMR,IFMN,PVMR";
airportCode["JMK"] = "MCMR,ECMR,EDMR,CDMR,IVMR";
airportCode["KGS"] = "ECMR,EDMR,CDMR,IFMN,PVMR";
airportCode["RHO"] = "ECMR,EDMR,CDMR,IFMN,PVMR";
airportCode["SKG"] = "ECMR,EDMR,CDMR,IFMN,PVMR";
airportCode["SUF"] = "EBMR,EDMR,CDMR,CWMR,FVMR";
airportCode["FAO"] = "EBMN,EDMR,CDMR,SVMR,FVMR";
airportCode["FNC"] = "EBMN,EDMN,EDMR,CDMR,SCAR";
airportCode["XRY"] = "EBMR,CCMR,CDMR,IVMR,FVMR";
airportCode["ACE"] = "EBMR,CCMR,CDMR,IVMR,FVMR";
airportCode["AGP"] = "EBMR,CCMR,CDMR,IVMR,FVMR";
airportCode["BCN"] = "EBMR,CCMR,CDMR,IVMR,FVMR";
airportCode["FUE"] = "EBMR,ECMR,CCMR,CDMR,FVMR";
airportCode["LPA"] = "EBMR,ECMR,CCMR,CDMR,FVMR";
airportCode["MAH"] = "EBMR,CCMR,CDMR,ICMR,SWMR";
airportCode["TFS"] = "EBMR,ECMR,CCMR,CDMR,FVMR";
airportCode["BSL"] = "EBMN,CCMR,IDMR,SDMR,FVMR";
airportCode["ZRH"] = "EBMN,CCMR,IDMR,SDMR,FVMR";
airportCode["MIR"] = "ECMN,EDMN,CDMN,IDMR";
airportCode["ADB"] = "ECMR,CCMR,IDMR,SDMR,SVMR";
airportCode["AGA"] = "ECMR,CCMR,IDMR,SDMR,SVMR";
airportCode["AYT"] = "ECMR,CCMR,IDMR,SDMR,SVMR";
airportCode["BJV"] = "ECMR,CCMR,IDMR,SDMR,SVMR";
airportCode["DLM"] = "ECMR,CCMR,IDMR,SDMR,SVMR";
airportCode["SAW"] = "ECMR,CCMR,IDMR,SDMR,SVMR";
airportCode["LNZ"] = "EBMN,EDMR,CDMR,IDMR,FVMR";
airportCode["QOX"] = "EBMR,CLMR,IDMR,SDMR,FVMR";

var monthName = new Array();
 monthName["01"] = "Jan";
 monthName["02"] = "Feb";
 monthName["03"] = "Mar";
 monthName["04"] = "Apr";
 monthName["05"] = "May";
 monthName["06"] = "Jun";
 monthName["07"] = "Jul";
 monthName["08"] = "Aug";
 monthName["09"] = "Sep";
 monthName["10"] = "Oct";
 monthName["11"] = "Nov";
 monthName["12"] = "Dec";
 
function addTimeToDate(time,diff) {
 var futureDate = "";
 var neuesDatum = new Date(Date.parse(time) + diff);
 futureDate += neuesDatum.getFullYear();
 tempDate = "0" + eval(neuesDatum.getMonth()+1);
 futureDate += tempDate.substr(tempDate.length-2,2);
 tempDate = "0" + neuesDatum.getDate();
 futureDate += tempDate.substr(tempDate.length-2,2);
 tempDate = "0" + neuesDatum.getHours();
 futureDate += tempDate.substr(tempDate.length-2,2);
 tempDate = "0" + neuesDatum.getMinutes();
 futureDate += tempDate.substr(tempDate.length-2,2);
 
 return futureDate;
}
function timeToStandardTime(time) {   
 var tempYear = time.substring(0,4);
 var tempMonth = time.substring(4,6);
 var tempDay = time.substring(6,8);
 var tempHours = time.substring(8,10);
 var tempMinutes = time.substring(10,12); 
 var tempMonthName = monthName[tempMonth];  
 var standardTime = tempDay + " " + tempMonthName + " " + tempYear + " " + tempHours + ":" + tempMinutes;
 
 return standardTime;
}

//Media-Download-Formular

function mediaSubmit() {
 var notyet ="";
 if (document.myForm.first_name.value == "" || document.myForm.last_name.value == "" || document.myForm.email.value == "") {
  notyet = "Es fehlen Angaben zu Ihrer Adresse.\nBitte geben Sie die folgenden Daten an:\n\n";
  if (document.myForm.first_name.value == "") {
   notyet += "Ihren Vornamen\n";
  }
  if (document.myForm.last_name.value == "") {
   notyet += "Ihren Nachnamen\n";
  }
  if (document.myForm.email.value == "") {
   notyet += "Ihre E-Mail Adresse\n";
  }
  alert (notyet);  
 }
 else {
  if(document.myForm.email.value.indexOf("@") == -1 || document.myForm.email.value.indexOf(".") == -1){
   notyet += "Bitte geben Sie eine korrekte E-Mail Adresse ein.";
   alert (notyet);
  }
  else {
   document.myForm.submit();
  }
 }
}

/* cfuchs.sn */
function checkCookieStatus()
{
    if(!document.cookie)
    {
        alert('Cookies scheinen in Ihrem Browser deaktiviert zu sein. Bitte\naktivieren Sie Cookies, um eine Flugbuchung vornehmen zu können.');
        return false;
    }
else {return true;}
}
/* cfuchs.en */

//ivlasic.sn
function calendarFillPulldowns(dateSelected, passedInfo)
{
 var day = dateSelected.getDate()-1;
 var month = dateSelected.getMonth() +1;
 if(month < 10) 
 {
  month = "0"+ month;
 }
 var YearAndMonth = dateSelected.getFullYear() + '-' + month;
 var haveFound = false;
 document.getElementById('AVAILABILITYSEARCHINPUT_DropDownListMarketDay'+passedInfo).selectedIndex = day;
 for(var i=0; i< document.getElementById('AVAILABILITYSEARCHINPUT_DropDownListMarketMonth'+passedInfo).length; i++) {
  if(document.getElementById('AVAILABILITYSEARCHINPUT_DropDownListMarketMonth'+passedInfo)[i].value == YearAndMonth)
  {
   document.getElementById('AVAILABILITYSEARCHINPUT_DropDownListMarketMonth'+passedInfo).selectedIndex = i;
   haveFound = true;
  }
 }
 if(haveFound == false)
 {
  alert("Der von Ihnen gewählte Flugtermin liegt außerhalb unseres Flugplans.");
 }
}
//ivlasic.en

/* Prevent DoubleClick Funktion */
var submitterClickedS2S = false;
function preventDoubleClickS2S()
{
 var ds = document['SkySales'];
 if(ds['CONTROLGROUPPAYMENT:PAYMENTINPUT:DropDownListPaymentMethodCode'].value != 'ExternalAccount:AA') {
  if (!submitterClickedS2S)
  {
   submitterClickedS2S = true;
   return true;
  } 
  return false;
 }
}
/* Prevent DoubleClick Funktion Ende */
/* cfuchs.sn */ 
// Passt das Rückflugdatum dem gewählten Abflugdatum an 
function captureDates() {
 oDay    = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay1").options[document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay1").selectedIndex].value;
 oMonth  = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth1").options[document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth1").selectedIndex].value.substring(5,7);
 oYear   = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth1").options[document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth1").selectedIndex].value.substring(0,4);
 rDay    = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay2").options[document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay2").selectedIndex].value;
 rMonth  = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth2").options[document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth2").selectedIndex].value.substring(5,7);
 rYear   = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth2").options[document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth2").selectedIndex].value.substring(0,4);
} 
function changeReturnDate(elementId) { 
        if(elementId=="AVAILABILITYSEARCHINPUT_DropDownListMarketMonth1" || elementId=="AVAILABILITYSEARCHINPUT_DropDownListMarketDay1") { 
                captureDates(); 
                if ( rDay != 0 ) { 
                        if ( ( rMonth < oMonth && rYear == oYear ) || rYear < oYear ) { 
                                document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth2").options.selectedIndex = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketMonth1").options.selectedIndex;
                document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay2").options.selectedIndex = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay1").options.selectedIndex;
                        } 
                        else if ( rDay < oDay && rMonth == oMonth && rYear == oYear ) { 
                                document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay2").options.selectedIndex = document.getElementById("AVAILABILITYSEARCHINPUT_DropDownListMarketDay1").options.selectedIndex;
                        }
                } 
        } 
} 
// Schränkt die Monatsauswahl ein 
function limitMonth(dropDownList) {               
        var scheduleEndMonth = 4;              // Wert ändern, wenn neuer Flugplan kommt 
        var scheduleEndYear = 2008;     // Wert ändern, wenn neuer Flugplan kommt 
        
        var currentDate = new Date(); 
        var currentMonth = currentDate.getMonth(); 
        var currentYear = currentDate.getYear(); 
        if(currentYear<999)
        {
            currentYear+=1900;
        }
        
        
        if (currentYear < scheduleEndYear) { 
                scheduleEndMonth = scheduleEndMonth+(12*(scheduleEndYear - currentYear)); 
        } 
        
        limit = scheduleEndMonth - currentMonth;                        
        
        if (dropDownList) { 
                if (limit < dropDownList.options.length) { 
                        numDeleteItems = dropDownList.options.length - limit; 
                        for (i=0; i < numDeleteItems; i++) { 
                                dropDownList.remove(dropDownList.options.length-1); 
                        } 
                } 
        }
}
/* cfuchs.en */ 



//cfuchs.sn

function write_control(text) 
{
   document.write(text);
}

function showRabattLayer(show)
{
 if ((self.location.href.indexOf("/de/")>=0) && ((referrerId.indexOf("Select.aspx")>=0)|| (referrerId.indexOf("Contact.aspx")>=0) || (referrerId.indexOf("Payment.aspx")>=0))) 
 {
   //document.getElementById('rabattLayer').style.display = show;
 }
}
//cfuchs.en

if((self.location.href.indexOf("/destinations/")>=0) || (self.location.href.indexOf("/cms/")>=0))
{ 
 googleKey="BQIAAAA_vx1i73R3xWzubaeJt2SGBSJwJTQkv4hfE8btJiaSz6Pjrn_HxSAGKbLavbstkh9hhfJLJXRH_SoNw";
if(self.location.href.indexOf("217.110.104.233")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBTIVhBRjscOwCWRAr-Jt4kMoOMNFBQo_j5rJkU9MpEHV3enaizHBlss7w";
 }
if(self.location.href.indexOf("hase")>=0)
 {
  googleKey="ABQIAAAAmwYbS3zTh6RiXnxizMhFKBRoaK04Lje4Z6ztHDisiNsqM7SyNhTkiH_3j42BaSPhjM7E7FCJJ8ykxg";
 }

if(self.location.href.indexOf("217.110.104.236:10080")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBTGaXyaWMZvSuxTdcoFz6aQ2PuWjhQXRmD4gKYNGm_xxA1xI_Iw2nR6Gw";
 }
if(self.location.href.indexOf("217.110.104.236/de/destinations")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBREriTknoSeu9c0GUduOxs5to6YjBQ_7zQlsFrXMWmBzxhuh8-ugNywtg";
 }
if(self.location.href.indexOf("217.110.104.236/en/destinations")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBSmWRPKUXvBzKEXgtwDFIZtEW5BxRTe8fy9SjSyHuW6JdVPahVxmWWhDA";
 }   
if(self.location.href.indexOf("217.110.104.236/it/destinations")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBQeCkJLXbeoBdHLyf49k5YtpaxTTRRBCQ4-uqFVnRJtjFNmPlsu3I4YEA";
 }     
if(self.location.href.indexOf("217.110.104.236/es/destinations")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBSZPEubs6cvgEl-q4kTZoweYacutBTjKzrdI7NOjJwbPFD0oh9F981miw";
 }   
if(self.location.href.indexOf("217.110.104.236/fr/destinations")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBTo9nI7hLaLZwdfBg2RgP7808-YLRRbVW2v8GS38GJvNfOKbPqWjbKCGA";
 }
 if(self.location.href.indexOf("http://www.tuifly.com/de/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBTaj5gBhx0jK9NYk9u-cuMlyDGV0xTb4nI1dAngxgXRBpJZ_bQlM8I07A";
 }
 if(self.location.href.indexOf("https://www.tuifly.com/de/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBQrD9jtWLUgN3QtepbWmpPGePf1GRQDYI5nTejZBt1SLsnbZAFzxVAkYQ";
 }    
 if(self.location.href.indexOf("tuifly.com/en/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBTKwPsKqiBQm8W6Xf3Jz9BEM4Gj7xRm8Cpb0ZpsGKpOdgp35wC_YqPoGg";
 }
 if(self.location.href.indexOf("tuifly.com/it/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBSUGIJI7TTfuHz6OqqHll9cG969LhTm56Au1BA0Do_-8kwmuJ-ZbVWocg";
 }  
 if(self.location.href.indexOf("tuifly.com/es/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBQjdkaKRkgCc0bUAiDSoLxPAP3mLhRT2LkK3dCupzWtqzMOEcgAxkKfIQ";
 }
 if(self.location.href.indexOf("tuifly.com/fr/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBRFlPPfO5s--I0C9tASWKWElJ9RUBR2iEoYHLpeJmlCFra5EcaMZPJFyQ";
 }
 if(self.location.href.indexOf("tuifly.com/hr/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBQ90SnNG_K98PcLBim0FDKhvisjuhRu-FmM1xUZ16-nrLUGMYuiHEGsSQ";
 }
if(self.location.href.indexOf("tuifly.com/se/destinations/")>=0)
 {
  googleKey="ABQIAAAA_vx1i73R3xWzubaeJt2SGBTtYrv9ASnG0cnXw7kBpf5U0L2AERQSuK7wN17EjUEYyjH2ViD0dAvEeQ";
 }
    
  document.write("<script src=\""+window.location.protocol+"\/\/maps.google.com\/maps?file=api&amp;v=2&amp;key="+googleKey+"\" type=\"text/javascript\"><\/script>");
}

function load(Lng, Lat, icon_url) 
{
 
 if (GBrowserIsCompatible()) 
 {
  if (document.location.host=="217.110.104.233")
  {
   icon_url = "http://www.tuifly.com"+icon_url;
  }

  var map = new GMap2(document.getElementById("map"));
  map.addControl(new GSmallMapControl()); 
  map.setCenter(new GLatLng(Lng, Lat), 8);
  map.setMapType(G_NORMAL_MAP); 
  var icon = new GIcon();
  icon.image = icon_url;
  icon.iconSize = new GSize(20, 24);
  icon.shadowSize = new GSize(22, 20);
  icon.iconAnchor = new GPoint(1, 12);
  icon.infoWindowAnchor = new GPoint(5, 1);   
  var point = new GLatLng(Lng, Lat);
  map.addOverlay(new GMarker(point, icon));  
 }
}

function toggleEntry(obj) {
    if(obj.className == "active")
        obj.className = "";
    else {
        for(var i=0; i<obj.parentNode.childNodes.length; i++) {
            obj.parentNode.childNodes[i].className = "";
        }
        obj.className = "active";
    }
}

//cfuchs.sn
//Weiterleitung zu Zanox mit angehängter bluemiles-Kartenummer
//Funktioniert nur auf statischenSeiten, in denen der Login-iframe eingebunden ist

function gotoZanox(zanoxlink)
 {
  var bmNumber = getBluemilesNumberFromCookie();
  if (bmNumber!=null)
  {
window.open(zanoxlink + bmNumber);
   return false;
  }
  alert('Bitte loggen Sie sich vor Ihrem Einkauf bei bluemiles ein.\n\nDamit Ihnen Ihre bluemiles für Ihre Bestellungen in den Online-Shops gutgeschrieben werden können, melden Sie sich bitte zuerst unter \"Login\" mit Ihrer bluemiles-Kartennummer oder Ihrem Usernamen sowie Ihrem Passwort an.\n\nSollten Sie sich soeben eingeloggt haben, klicken Sie in Ihrem Browser bitte auf \"aktualisieren (F5)\" und versuchen Sie es anschließend erneut.\n\nNicht vergessen: Rufen Sie den Online-Shop auch beim nächsten Einkauf immer über diesen Link auf www.bluemiles.com auf. So verschenken Sie keine Meile.');
  return false;
 }

//cfuchs.en

//cfuchs.sn
//Weiterleitung zu Tradedoubler mit angehängter bluemiles-Kartenummer
//Funktioniert nur auf statischenSeiten, in denen der Login-iframe eingebunden ist
function gotoTradedoubler(tradedoublerlink)
 {
  var bmNumber = getBluemilesNumberFromCookie();
  if (bmNumber!=null)
  {
window.open(tradedoublerlink + bmNumber);
   return false;
  }
  
  alert('Bitte loggen Sie sich vor Ihrem Einkauf bei bluemiles ein.\n\nDamit Ihnen Ihre bluemiles für Ihre Bestellungen in den Online-Shops gutgeschrieben werden können, melden Sie sich bitte zuerst unter \"Login\" mit Ihrer bluemiles-Kartennummer oder Ihrem Usernamen sowie Ihrem Passwort an.\n\nSollten Sie sich soeben eingeloggt haben, klicken Sie in Ihrem Browser bitte auf \"aktualisieren (F5)\" und versuchen Sie es anschließend erneut.\n\nNicht vergessen: Rufen Sie den Online-Shop auch beim nächsten Einkauf immer über diesen Link auf www.bluemiles.com auf. So verschenken Sie keine Meile.');
  return false;
 }
//cfuchs.en
url_auto = "/de/mietwagen.php";
url_hotel = "/de/97.html";
url_flugHotel = "";
url_ferienwohnungen = "/de/ferienwohnung.php";
url_reiseversicherungen = "";
url_tiefstpreisseite = "/de/offers/tiefstpreise.jsp?currency=EUR";
function getCategoryFromURL(path) {
    if(path.lastIndexOf("/") > 0) return path.substring(0,path.lastIndexOf("/"));
    else return false;    
}
// 
//
 
// bluemiles News
function toggleEntry(obj) {
    //alert(obj);
    if(obj.className == "active")
        obj.className = "";
    else {
        for(var i=0; i<obj.parentNode.childNodes.length; i++) {
            obj.parentNode.childNodes[i].className = "";
        }
        obj.className = "active";
    }
}
//CompactSearch
    var boxIDOpen = 'flugsuche';
    var boxIDArrow = 'active';
    
    function openCompactSearch (idOpen, on, idArrow1, idArrow2, idArrow3, idArrow4 ) {
            if ((boxIDOpen != idOpen) && (boxIDOpen != '')) {
            document.getElementById(boxIDOpen).style.display = 'none';
            document.getElementById('anc_flugsuche').className  = idArrow1;
            document.getElementById('anc_webcheckin').className  = idArrow2;
            document.getElementById('anc_umbuchung').className  = idArrow3;
            document.getElementById('anc_zusatzleistungen').className  = idArrow4;
        }
        if(on)
        {
            document.getElementById(idOpen).style.display = 'block';
            document.getElementById('anc_flugsuche').className  = idArrow1;
            document.getElementById('anc_webcheckin').className  = idArrow2;
            document.getElementById('anc_umbuchung').className  = idArrow3;
            document.getElementById('anc_zusatzleistungen').className  = idArrow4;
            
        }
        else
        {
            document.getElementById(idOpen).style.display = 'none';
            document.getElementById('anc_flugsuche').className  = idArrow1;
            document.getElementById('anc_webcheckin').className  = idArrow2;
            document.getElementById('anc_umbuchung').className  = idArrow3;
            document.getElementById('anc_zusatzleistungen').className  = idArrow4;
        }
        boxIDOpen = idOpen;
        boxIDIcon = idArrow1;
        boxIDIcon = idArrow2;
        boxIDIcon = idArrow3;
        boxIDIcon = idArrow4;
    }

try {
      document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

// CompactSearch - DateChange
function captureDates() {
    oDay    = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay1").options[document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay1").selectedIndex].value;
    oMonth  = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth1").options[document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth1").selectedIndex].value.substring(5,7);
    oYear   = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth1").options[document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth1").selectedIndex].value.substring(0,4);
    rDay    = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay2").options[document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay2").selectedIndex].value;
    rMonth  = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth2").options[document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth2").selectedIndex].value.substring(5,7);
    rYear   = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth2").options[document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth2").selectedIndex].value.substring(0,4);
} 
function changeReturnDate(elementId) {
if(elementId=="ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth1" || elementId=="ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay1") { 
    captureDates(); 
    if ( rDay != 0 ) { 
        if ( ( rMonth < oMonth && rYear == oYear ) || rYear < oYear ) { 
            document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth2").options.selectedIndex = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketMonth1").options.selectedIndex;
            document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay2").options.selectedIndex = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay1").options.selectedIndex;
        } 
        else if ( rDay < oDay && rMonth == oMonth && rYear == oYear ) { 
            document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay2").options.selectedIndex = document.getElementById("ControlGroupCompactSearchSSIView_AvailabilitySearchInputCompactSearchSSIView_DropDownListMarketDay1").options.selectedIndex;
        }
    } 
} 
}

function getBluemilesNumberFromCookie()
{
    var allcookies = document.cookie;
    var cookieName = "bluemiles";
    var pos = allcookies.indexOf(cookieName+"=");
    if (pos < 0)
    {
        return null;
    }
    var start = pos + cookieName.length + 1;
    var end = allcookies.indexOf(";", start);
    if (end < start)
    {
        end = allcookies.length
    }
    if (end == start)
    {
        return null;
    }
    return allcookies.substring(start, end);
}

/*Beginn Tracking Cookie*/
function set_cookie ( name, value, exp_days, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );
 
  if ( exp_days )
  {
    var expires = new Date ();
            var inXTagen = expires.getTime() + (exp_days * 24 * 60 * 60 * 1000);
            expires.setTime(inXTagen);
    cookie_string += "; expires=" + expires.toGMTString();
  }
 
  if ( path )
        cookie_string += "; path=" + escape ( path );
 
  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}
 
function parsHttpParams()
{
    var s = window.location.search.substring(1).split('&');
    if(!s.length) return;
    var c = {};
    for(var i  = 0; i < s.length; i++)
    {
        var parts = s[i].split('=');
        c[unescape(parts[0])] = unescape(parts[1]);
    }
    window.param = function(name){return name ? c[name] : c;}
}
                        
                        
function SetTUIFlyTrackingCookie()
{           
            parsHttpParams();
            var adValue = param('AD');                     
            
            if(adValue !=null){
                        set_cookie("TUIFlyTrackingCookie",adValue,5,"/");          
            } 
            
}

 
SetTUIFlyTrackingCookie();
/*End Tracking Cookie*/