/* This file contains legacy JavaScript functions which are used by included HTML fragments */
// std functions for in-links

function checkBrowser(){
  this.agt = navigator.userAgent.toLowerCase();
  this.dom = document.getElementById?1:0;
  this.nn = ((document.captureEvents) && (!this.dom)) ? 1:0;
  this.mz = (((this.dom) && (!document.all) && (document.documentElement)) && (this.agt.indexOf("safari")==-1)) ? 1:0;
  this.op = ((this.dom) && (this.agt.indexOf('opera')!=-1)) ? 1:0;
  this.kon = ((this.agt.indexOf("konqueror")!=-1) || (this.agt.indexOf("safari")!=-1)) ? 1:0;
  return this;
}
var is = new checkBrowser();

// CSS - Zuweisung
var cssv="ie";
var cssid="id=\"MainStylesheet\"";
if (is.nn){cssv="nn";cssid="";}
else if (is.kon) cssv="kon";
else if (is.op)  cssv="op";
else if (is.mz)  cssv="mz";

var ns = navigator.appName == 'Netscape';
var ie = !ns;
var version = parseInt(navigator.appVersion);
var ie3 = ie && version < 4;
var oscheck = navigator.appVersion;// new for function open_foren();


///////////////////
// Browser Version
///////////////////
var agt=navigator.userAgent.toLowerCase();

var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_ns  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
var is_ns2 = (is_ns && (is_major == 2));
var is_ns3 = (is_ns && (is_major == 3));
var is_ns4 = (is_ns && (is_major == 4));
var is_ns4up = (is_ns && (is_major >= 4));
var is_ns5 = (is_ns && (is_major == 5));
var is_ns5up = (is_ns && (is_major >= 5));

var is_ie   = (agt.indexOf("msie") != -1);
var is_ie3  = (is_ie && (is_major < 4));
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) && (agt.indexOf("msie 5.5")==-1));
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) || (agt.indexOf("msie 5.5")!=-1));
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);

var is_aol   = (agt.indexOf("aol") != -1);
var is_aol3  = (is_aol && is_ie3);
var is_aol4  = (is_aol && is_ie4);

var is_opera = (agt.indexOf("opera") != -1);
var is_webtv = (agt.indexOf("webtv") != -1);


////////////
// Plattform
////////////


var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
var is_win16 = ((agt.indexOf("win16")!=-1) || (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("windows 16-bit")!=-1) );
var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || (agt.indexOf("windows 16-bit")!=-1));

var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
var is_win32 = (is_win95 || is_winnt || is_win98 || ((is_major >= 4) && (navigator.platform == "Win32")) || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

var is_os2   = ((agt.indexOf("os/2")!=-1) || (navigator.appVersion.indexOf("OS/2")!=-1) || (agt.indexOf("ibm-webexplorer")!=-1));

var is_mac= (agt.indexOf("mac")!=-1);
var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) || (agt.indexOf("68000")!=-1)));
var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || (agt.indexOf("powerpc")!=-1)));

var is_ie45mac  = (is_mac && is_ie && (agt.indexOf("msie 5.0")==-1) && (agt.indexOf("msie 5.5")==-1) && (agt.indexOf("msie 4.5")!=-1));


var querystring = typeof(document.location) == "undefined" ? "" : document.location.search;

function openExtLink(url){
  winWin = window.open(url,'EXT','width=800,height=600,scrollbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=yes,location=yes');
}


function openFromSatellite(url){
  if(parent)
  {
    if(parent.opener.closed){
      newWin = window.open(url,'','');
    }else{
      parent.opener.location.href = (url);
      parent.opener.focus();
    }
  }else{
    if(top.opener.closed){
      newWin = window.open(url,'','');
    }else{
      top.opener.location.href = (url);
      top.opener.focus();
    }
  }
}

var popupHandle;

function open_satellite(url, w, h, resizable, name, spec){
  if(typeof(spec) == "undefined"){
      spec = 'directories=no,menubar=no,toolbar=no,status=no';
      if(w>0 && h>0){
         if(! resizable){
           spec += ",scrollbars=no";
           spec += ",resizable=no";
         } else{
           spec += ",scrollbars=yes";
           spec += ",resizable=yes";
         }
         spec += (",width=" + w);
         spec += (",height=" + h);
      }
  }
  else{
      if(w>0 && h>0){
         if(! resizable){
           spec += ",scrollbars=no";
           spec += ",resizable=no";
         } else{
           spec += ",scrollbars=yes";
           spec += ",resizable=yes";
         }
         spec += (",width=" + w);
         spec += (",height=" + h);
      }
  }

  if(typeof(name) != "string"){
    //
    // uniquen Name ermitteln
    //
    var jetzt = new Date();
    name = jetzt.getTime() + "";
  }

  if ((url.indexOf("?") != -1) && (querystring.indexOf("?") != -1)) {
    querystring = querystring.replace(/\?/,"&");
  }

  var win = window.open(url + querystring, name, spec);
  win.focus();

  popupHandle = win;
}

function open_satellite_without_querystring(url, w, h, resizable, name, spec){
  if(typeof(spec) == "undefined"){
      spec = 'directories=no,menubar=no,toolbar=no,status=no,scrollbars=yes';
      if(w>0 && h>0){
         if(! resizable){
           //spec += ",scrollbars=yes";
           spec += ",resizable=no";
         } else{
           spec += ",scrollbars=yes";
           spec += ",resizable=yes";
         }
         spec += (",width=" + w);
         spec += (",height=" + h);
      }
  }
  else{
      if(w>0 && h>0){
         if(! resizable){
           spec += ",scrollbars=yes";
           spec += ",resizable=no";
         } else {
           spec += ",scrollbars=yes";
           spec += ",resizable=yes";
         }
         spec += (",width=" + w);
         spec += (",height=" + h);
      }
  }

  win = window.open(url, name, spec);
  win.focus();

  popupHandle = win;
}

function open_StartES(lang){
  if(typeof(lang) == "undefined"){
    var lang = "eng";
  }
  var url = "http://gebrauchtwagen.audi.de/db_onl/db_onl.dll/?lans="+lang;
    var name = "car_input";
    var spec = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes";

    open_satellite(url, 800, 600, false, name, spec);
}

// needed after relaunch
function open_zubehoerwas(lang){
  open_zubehoer(lang);
}

// needed after relaunch
function open_zubehoer(lang){
/*
    lang        = "de";
    var name    = "zubehoer";
    var width   = 687;
    var height  = 465;
    var spec    = "left=10,top=10,toolbar=yes,location=no,menubar=no,status=yes,menubar=no";
    var url     = "http://www.audi.de/zubehoerwas/ServletManager?wi=Modellwahl";

    open_satellite(url, width, height, false, name, spec);
*/
  var url = "http://www.audi.de/zubehoerwas/zubehoer2/zubehoer.jsp";
  document.location.href = url;
}


// needed after relaunch
function open_accessoires(version){

  if (typeof(version) == "undefined"){
    version = "live";
  }
  if (version == "prelive"){
    domain = "https://shop-prelive.audi.de";
    store_id            = 10151;
  }else{
    domain = "http://shop.audi.de";
    store_id            = 10051;
  }
  var name                = "";
  var catalog_id          = 10051;
  var lang_id             = -3;
  var commercesuite_base  = "/webapp/wcs/stores/servlet/";
  var url                 = domain+commercesuite_base+"Home?catalogId="+catalog_id+"&storeId="+store_id+"&langId="+lang_id;

  document.location.href = url;

}


// needed after relaunch
function open_foren () {
    var url     = "http://www.audi-foren.de/intro_flash/index2.htm";
    var name    = "fenster1";
    var spec    = "menubar=no,status=yes,toolbars=no";
    var xextra  = 0;
    var yextra  = 0;

    if ( (oscheck.indexOf("Mac") > 0) && (document.all) && (oscheck.indexOf("5.") < 0) ){
        xextra = 0;
        yextra = 16;
    }
    else if ( (oscheck.indexOf("Mac") > 0) && (document.layers) ){
        xextra = 1;
        yextra = 1;
    }
    var x   = 790 + xextra;
    var y   = 523 + yextra;

    open_satellite(url, x, y, false, name, spec);
}

// aufgenommen am 13.11.2001, da es diese Funktion auf der audi.de Seite gab
function open_jobboerse() {
    var url     = "http://www.audi-partnerjobboerse.de/hrms/index.aspx";
    var name    = "AUDI";
    var width   = 800;
    var height  = 622;
    var spec = "toolbar=no,location=no,directories=no,status=no,menubar=no,titlebar=yes,scrollbars=yes";

    open_satellite(url, width, height, true, name, spec);
}

function open_foren_startsite(lang,desturl) {
    if (typeof(lang) == "undefined" || lang == ""){
      var url;
      if (typeof(desturl) == "undefined" || desturl ==""){
        url     = "http://www.museummobile.de/sprache.php";
      }else {
        url = desturl;
      }
    window.open(url);
    } else {

    var name    = "foren_startsite";
    var url     = "http://www.museummobile.de/sprache.php";
    var spec    = "location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no";
    var xextra  = 0;
    var yextra  = 0;

    if ( (oscheck.indexOf("Mac") > 0) && (document.all) && (oscheck.indexOf("5.") < 0) ){
        xextra = 0;
        yextra = 16;
    }
    else if ( (oscheck.indexOf("Mac") > 0) && (document.layers) ){
        xextra = 1;
        yextra = 1;
    }
    var x   = 790 + xextra;
    var y   = 550 + yextra;
    }

    popupwidth=x; popupheight=y;
      newx=(screen.availWidth- popupwidth)/2;
      newy=(screen.availHeight-popupheight)/2;
    fenster2=window.open(url,name,'width='+ popupwidth+',height='+popupheight+', left='+newx+', top='+newy+', ' + spec);
    //fenster2.moveTo(newx, newy);
    //fenster2.resizeTo(x,y);
    fenster2.focus();
    //open_satellite(url, x, y, false, name, spec);
}

function open_foren_startsite_gewinnspiel(){
  var url = "http://www.museummobile.de/gewinnspiel";
  open_foren_startsite("",url);
}

function open_programmkino() {
  var name    = "Programmkino";
  var url = "http://www.museummobile.de/deutsch/01_information/programmkino.php";
    var spec    = "location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no";
    var xextra  = 0;
    var yextra  = 0;

    if ( (oscheck.indexOf("Mac") > 0) && (document.all) && (oscheck.indexOf("5.") < 0) ){
        xextra = 0;
        yextra = 16;
    } else if ( (oscheck.indexOf("Mac") > 0) && (document.layers) ){
        xextra = 1;
        yextra = 1;
    }
    var x   = 790 + xextra;
    var y   = 523 + yextra;

    popupwidth=x; popupheight=y;
      newx=(screen.availWidth- popupwidth)/2;
      newy=(screen.availHeight-popupheight)/2;
    fenster3=window.open(url,name,'width='+ popupwidth+',height='+popupheight+', left='+newx+', top='+newy+', ' + spec);
    fenster3.focus();
    //open_satellite(url, x, y, true, name, spec);
}

function open_a2_colourstorm(){
  var url = "http://62.208.122.40/pages/basis/index.asp";
  window.open(url,"a2_colorstrom","width=750,height=400,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=0,resizable=0");
}

function open_a2_colorstorm(){
  open_a2_colourstorm();
}

function open_a3(){
  var url     = "http://microsites.audi.com/satellite/a3/sniffer.htm";
  window.open(url,"theotherside","width=700,height=420");
}

function open_a6(){
  var url     = "http://microsites.audi.com/satellite/a6_pakete/a6_proLine_MX.html";
  window.open(url,"a6","width=600,height=360");
}

function open_a6leasing(){
  var url = "http://microsites.audi.com/satellite/a6_leasing/loader.html";
  var w = 600;
  var h = 360;
  var l = ( (window.screen.width  - w) / 2 );
  var t = ( (window.screen.height - h) / 2 );
  window.open(url,'a6leasing','leftmargin=0,topmargin=0,marginheight=0,marginwidth=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top='+t+',left='+l+',screenX='+l+',screenY='+t+',copyhistory=no,height='+h+',width='+w+'');
}

function open_a6_meilen(){
  var url     = "http://microsites.audi.com/satellite/a6_meilen/a6lh.html";
  window.open(url,"a6_miles","width=600,height=380,status=0,scrollbars=0,resizable=0");
}

function open_a6meilen(){
        open_a6_meilen();
}

function open_a8w12(){
  var url     = "http://microsites.audi.com/satellite/a8w12/checkflash4.html";

  window.open(url,"a8","width=788,height=323");
}

function open_a8(page) {
  if (typeof(page) == "undefined"){
    page = "";
  }

  if(page =="anmelden"){
    page = "_an";
  } else if(page =="abmelden"){
    page = "_ab";
  }

  var url = "http://microsites.audi.com/satellite/a8/flashsite/index" + page + ".htm";

  var name = "a8";
  if (is_ie45mac) {
    window.open(url,name,'width=734,height=436');
  } else if (is_ie && is_mac) {
    window.open(url,name,'width=734,height=434');
  } else if (is_ns4up && is_mac) {
    window.open(url,name,'width=750,height=444');
  } else {
    window.open(url,name,'width=750,height=450');
  }
}

function open_a8_preview(page) {
  /*
    if (typeof(page) == "undefined"){
        page = "";
    }
    var url = "http://microsites.audi.com/satellite/a8news/index.htm"; // default

    if(page =="anmelden"){
        url = "http://microsites.audi.com/satellite/a8news/newsletter_A8_an.htm";
    }
    if(page =="abmelden"){
        url = "http://microsites.audi.com/satellite/a8news/newsletter_A8_ab.htm";
    }
    url += querystring;

    var win =
    window.open(url,"a8_preview","status=0,scrollbars=0,resizable=0,width=800,height=470")
  */
  open_a8(page);
}

function open_altauto() {
  window.open("http://www.vw-service.de/altauto/annahme_suche.htm","suche","width=500,height=530,scrollbars=yes");
}

// nedded after relaunch
function open_esp_experience(lang) {
    var url     = "http://microsites.audi.com/satellite/esp/fr_index_" + lang + ".html";
    var name    = "ESP_game";
    var spec    = "toolbar=no,location=no,directories=no,status=no,menubar=no";

    open_satellite(url, 640, 443, false, name, spec);
}

function open_multitronic(lang) {
    if(typeof(lang) != "string"){
        lang = "en";
    }
    var url         = "http://microsites.audi.com/satellite/multitronic/fr_index_" + lang + ".html";
    var name        = "multitronic";
    window.open(url,name,"width=580,height=390");

}

function open_quattro(lang) {
    if(typeof(lang) != "string"){
        lang = "english";
    }
  if (lang == "de"){
    lang = "deutsch";
  } else if (lang == "en"){
    lang = "english";
  }

    var url     = "http://microsites.audi.com/satellite/quattro/" + lang + "/qm_index.html";
    var name    = "quattro";
    var spec    = "screenX=0,screenY=0,top=0,left=0";

    open_satellite(url, 588, 473, false, name, spec);
}

function open_motorsport(lang) {
    if(lang.length > 1){
        lang = lang.substr(0,1);
    }

    if(lang == "d"){
        lang = "de";
        }
    else{
        lang = "com";
    }
    var url     = "http://www.audi." + lang + "/motorsport/";
    document.location.href = url;
    }

// needed after relaunch
function open_motorsport_subpage(lang, page) {
    open_motorsport(lang);
    }

// needed after relaunch
function open_extranet() {
    var url         = "http://extranet.audi.de";
    var name        = "defaultWin";
    var w           = 740;
    var h           = 350;
    var spec        = "location,menubar,personalbar,scrollbars=yes,status,toolbar,resizable=yes";

    open_satellite_without_querystring(url, w, h, true, name, spec);
}

// needed after relaunch
function open_eu_gwb(){
    //var w     = 693;
    //var h      = 515;
    //var spec  = "location=0,menubar=0,personalbar=0,scrollbars=yes,status=0,toolbar=0,resizable=yes";
    //var name  = "defaultWin";
    //var url   = "http://gebrauchtwagen.audi.de/aegwb/aegwb.dll/?act=1";

    //open_satellite(url, w, h, false, name, spec);
    //open_satellite("http://gebrauchtwagen.audi.de/aegwb/aegwb.dll/?act=1", 693, 515, false, 'defaulWin');
  var optionen ="resizable=no,scrollbars=yes,menubar=no,toolbar=no,left=0,top=0,screenX=0,screenY=0";
     var height = "641";
    var width = "710";
    var attrString = ("width=" + width + ",height=" + height +",optionen=" + optionen);
    var url = "http://gebrauchtwagen.audi.de/aegwb/aegwb.dll/?act=1";
    var winname = "AUDI_eu_gwb";

    var satellit = window.open(url,winname,attrString);
    satellit.focus();
}

// needed after relaunch
function open_wap(){
    var linken = "http://wap.audi.de/";
    var wapwindow;
    if(document.layers || document.all || navigator.userAgent.indexOf("Mozilla/5")!=-1){
        var width = 200;
        var height = 418;
        var script = 'http://www.audi.de/cgi-bin/wapalize/wapalize.cgi';
        wapwindow = window.open('','vindu','width='+width+',height='+height+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0');
        wapwindow.document.write('<html><head><title>Fetching site...</title>');
        wapwindow.document.write('</head>');
        wapwindow.document.write('<body bgcolor="#FFFFFF"><font face="Arial" size="2">Loading page...<br><p>');
        wapwindow.document.write('</font>');
        wapwindow.document.write('</body></html>');
        wapwindow.document.close();
        wapwindow.document.location.href = script+'?url='+linken;
    }
    else{
        alert('Sorry!\nUnknown browser...\nCan\'t view the WAP sites.');
    }
}

function open_forum() {
  var name    = "forum";
  var url     = "http://my.audi.com/Auditorium/auditorium_home";
  var spec    = "location=yes,directories=yes,menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,height=600,width=810;";
//  var url     = "http://www.audi.de/in-links/fehler/auditorium.html";
//  var spec    = "location=no,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,height=400,width=470;";

  open_satellite(url, '', '', true, name, spec);
}

/* alte kontakt function - auskommentiert am 18.12.01
//////////////////////////////////////////////

function_open_kontakt(profile){
    if (typeof(profile) == "undefined"){
        profile = "homepage";
    }
    var url = "http://www.audi.de/audi-kontakt/index.html?profile=" + profile;
    //alert ("URL " + url);
    open_satellite_without_querystring(url, 450, 550, false, "kontakt_sat");
}
*/

// neu eingefgt am 18.12.01
function openKontakt()
{
  var win=window.open("http://www.audi.com/de/de/kontakt/kontakt.jsp","Kontakt","width=800,height=600,left=50,top=50")
}

function open_help (sprache, fromwhere) {
    var url="http://www.audi.de/helpsatellit/f_help_"+sprache+".html?from="+fromwhere;

    if (navigator.appName == "Netscape") {
        satellite_fenster = window.open(url,"jpk","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,WIDTH=350,HEIGHT=200");
        satellite_fenster.focus();
    } else {
        satellite_fenster = window.open(url,"jpk","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,WIDTH=350,HEIGHT=200");
    }
}


function open_sms(){
    var intro = "intro";
    lang = "de";
    var url = "http://www.audi.de/sms";
    open_satellite(url, 447, 550, false, "smsversand");
}

/* Die Funktion "teaser_einstieg()" wird fuer den Homepage Banner "a2_konfigurator" verwendet, da der Teaser mit den Konigurationen des A2 voreingestellt ist.
Der Aufruf "teaser_einstieg()" wird in der Datei homepage/banners/a2_konfigurator/doc.ins gesetzt.*/
function teaser_einstieg(){
    var konfig = '8Z0014\\0|F14 5B5B|'+'F56     YA|GP15P15|'+'GRBKRBK|GPBAPBA|GPBDPBD';
    var phase  = 1;
    var pdatum = '10.05.2001';
    var name_kurz = 'Audi A2';
    var features = 'width=700,height=568';

    // Abfrage NS / IE ist notwendig, da NS Probleme mit der Laenge der Verkettung der Parameter hat.
    if (ns){ //Die url fuer NS entpricht dem, was IE nach der Verkettung ausgibt.
        var url= "http://konfigurator.audi.de/intro-direkt_de.html?konfig=8Z0014%5C0%7CF14%205B5B%7CF56%20%20%20%20%20YA%7CGP15P15%7CGRBKRBK%7CGPBAPBA%7CGPBDPBD&phase=1&preislisten_datum=10.05.2001&auto_name_kurz=Audi%20A2";
    } else{
        var url= "http://konfigurator.audi.de/intro-direkt_de.html" + "?konfig=" + escape(konfig) + "&phase=" + phase + "&preislisten_datum=" + pdatum + "&auto_name_kurz=" + name_kurz;
    }

    window.open(url,'teaser_satellit_de',features);
}

function direkt_einsprung(modell, phase, preislistendatum, auto_name_kurz, come_from) {
  var params = "pr=" + modell + "&phase=" + phase + "&preislistendatum=" + preislistendatum + "&auto_name_kurz=" + auto_name_kurz + "&come_from=" + come_from;
  var lang = "de";
  open_konfigurator_with_params(params, lang);
}

// *** Wichtig AK4 LIVE URL ***
var base_AK4_Url = "http://ak4-de.audi.de/entry.html";

function open_konfigurator(lang, model){
    var url = base_AK4_Url;
    if(model){
        if(model.indexOf("allroad") != -1){
          model = "aaq";
        }
        url += "?carline="+model;
    }
    open_satellite(url, 800, 600, true, "AK4SATELLIT","status=yes");
}

function open_konfigurator_with_params(params, lang, model){
  var url = base_AK4_Url;
  if (params) {
    url+="?"+params;
    if (model) {
        if(model.indexOf("allroad") != -1){
          model = "aaq";
        }
      url += "&carline="+model;
    }
  }
    open_satellite_without_querystring(url, 800, 600, true, "AK4SATELLIT","status=yes")
}

function open_personalsatellit(lang){
    if(typeof(lang) == "undefined"){
        lang = "de";
    }
    open_satellite("http://www.audi.de/personalsatellit/index_" + lang + ".html", 600,421,false, "personal");
}

function open_iaa(lang){
    lang = "de";
    open_satellite("http://www.audi.de/iaa/index_de.html",430,480,false);
}

function open_personalsatellit_step(lang){
    open_satellite("http://www.audi.de/personalsatellit/index_de.html?init=step", 600,421,false, "personal");
}

function open_newsletter(lang){
    lang = "de";
    open_satellite("http://listen.audi.de/cgi-bin/news_sat.cgi", 600,421,false);
}

function open_karriere(lang){
  open_personalsatellit(lang);
}

//needed after relaunch
function open_gwb_Suche(type){
  var width = "792";
  var height = "588";
  var optionen = "resizable=no,scrollbars=yes,status=yes,menubar=no,toolbar=no,left=0,top=0,screenX=0,screenY=0";
  var attrString = ("width=" + width + ",height=" + height + ",optionen=" + optionen);
  var winname = "AUDI";

  if (type == 'pro'){
  var url = "http://gebrauchtwagen.audi.de/agwb/agwb.dll/?search="+type;
  } else {
    if (type == 'nav'){
    var url = "http://gebrauchtwagen.audi.de/agwb/agwb.dll/?act=1&t_eq_i=B&search="+type;
    } else {
    var url = "http://gebrauchtwagen.audi.de/agwb/agwb.dll/?act=10&search="+type;
    }
  }
  var gwb_Suche = tc_open_window(winname,url,'',attrString);
    gwb_Suche.focus();
}

function open_sErleben(theURL,winName,features) {
  //***********Variablendeklaration********************************************
  var userScreenWidth = screen.availWidth;
  var userScreenHeight = screen.availHeight;
  var settings = features.split(",");
  var setXposTo;
  var setYposTo;
  var targetWidth;
  var targetHeight;
  var extendedFeatures;

  //***********feature-Argument aus Funktionsaufruf auswerten*******************
  for (i = 0; i <= settings.length-1; i++) {
    if(settings[i].indexOf("width") != -1){
      //alert(settings[i]);
      targetWidth = settings[i].substring(6,settings[i].length);
    }
    if(settings[i].indexOf("height") != -1){
      //alert(settings[i]);
      targetHeight = settings[i].substring(7,settings[i].length);
    }
  }

  //***********Berechnung Fensterposition***************************************
  if (userScreenWidth >= targetWidth) {
    setXposTo = (userScreenWidth - targetWidth)/2;
  } else {
    setXposTo = 0;
    alert("The current screen-resolution of " + screen.width + " x " + screen.height + " is too low!");
  }

  if (userScreenHeight >= targetHeight) {
    setYposTo = (userScreenHeight - targetHeight)/2;
  } else {
    setYposTo = 0;
    alert("The current screen-resolution of " + screen.width + " x " + screen.height + " is too low!");
  }

  extendedFeatures = features.concat(",top="+setYposTo+",left="+setXposTo);

  window.open(theURL,winName,extendedFeatures);
}

//needed after relaunch
function open_gebrauchtwagen(lang){
    if (typeof(lang) == "undefined" || lang == ""){
        lang = "de";
    }
    var width = "792";
    var height = "588";
    var optionen = "resizable=no,scrollbars=yes,status=yes,menubar=no,toolbar=no,left=0,top=0,screenX=0,screenY=0";
    var attrString = ("width=" + width + ",height=" + height + ",optionen=" + optionen);
    var url = "http://gebrauchtwagen.audi.de/agwb/agwb.dll/?";
    var winname = "AUDI";

    var satellit = window.open(url,winname,attrString);
    satellit.focus();
}
//needed after relaunch

function open_gebrauchtwagen_mit_query(lang){
    open_gebrauchtwagen(lang);
// identische Funktion wie open_gebrauchtwagen(lang), daher diese Aufrufen
// DBaD 28.11.2001
}

// needed after relaunch
function open_gebrauchtwagen_subpage(page) {
    if(ns){
        var width = "772";
        var height = "600";
    } else{
        var width = "800";
        var height = "625";
    }
    var optionen = "resizable=no,scrollbars=yes,status=yes,menubar=no,toolbar=no,left=0,top=0,screenX=0,screenY=0";
    var attrString = ("width=" + width + ",height=" + height + ",optionen=" + optionen);
    var url = "http://gebrauchtwagen.audi.de/index/html/";
    var winname = "AUDI";

  url = url + page + ".html";

    var satellit = window.open(url,winname,attrString);
    satellit.focus();
}

// erstellt von divine
function open_gwb_sub(which){
    if(ns){
        var width = "772";
        var height = "600";
    } else{
        var width = "800";
        var height = "625";
    }
    var optionen = "resizable=no,scrollbars=yes,status=yes,menubar=no,toolbar=no,left=0,top=0,screenX=0,screenY=0";
    var attrString = ("width=" + width + ",height=" + height + ",optionen=" + optionen);
    var url = "http://gebrauchtwagen.audi.de/index/html/" + which + ".html";
    var winname = "AUDI";

    var satellit = window.open(url,winname,attrString);
    satellit.focus();
}

//needed after relaunch
function open_preownedcars(lang) {
    if(typeof(lang) == "undefined"){
            lang = "en";
        }
    var url = "http://microsites.audi.com/satellite/preownedcars/" + lang + "/startseite/intro.html";
    var name    = "preowndcars";
    var w       = 693;
    var h       = 515;

    open_satellite(url, w, h, false, name);

}

//needed after relaunch
function open_auditorium() {
    open_forum();
}


/* Die Funktion "StartEgwb()" wird fuer den Homepage Banner "egwb" zum Aufruf der Europaeischen Gebrauchtwagenboerse verwendet.
1.4          (selsner  17-Apr-01): Der Aufruf "StartEgwb()" wird in der Datei homepage/banners/egwb/doc.ins gesetzt. */

/*
// auskommentiert am 28.11.2001 DBaD
function StartEgwb(){//WICHTIG!!! Der Link muss aktualisiert werden, sobald die offizielle Version der Seite online ist!
    open_satellite("http://gebrauchtwagen.audi.de/egwb/egwb.dll/?lan=deu&act=1", 693, 515, false, 'egwb');
}
*/
//
// Kompatibilit?funktion, falls diese Funktion referenziert wird
//
function StartEgwb(){//WICHTIG!!! Der Link muss aktualisiert werden, sobald die offizielle Version der Seite online ist!
    open_egwb('deu');
}

//
// neue Funktion von Divine, erstellt am 27.11.2001
//
function open_egwb(lang){
    if (typeof(lang) == "undefined" || lang == ""){
        lang = "deu";
    }
    if(lang == "de"){
        lang = "deu";
    }
    if(lang == "en"){
        lang = "eng";
    }
    if(lang != "deu" && lang != "eng"){
        lang = "deu";
    }
    var url = "http://gebrauchtwagen.audi.de/aegwb/aegwb.dll/?lan=" + lang + "&act=1";
  var name = "egbw";
  var width = "660";
  var height = "660";

    open_satellite_without_querystring(url, width, height, true, name);
}

function openDWB(params) {
        if(typeof(params) == "undefined"){
            params = "";
        }
        if(params == "op=intro"){
            params = "partner=&app_kind=default";
        }
        var url = "http://dienstwagen.audi.de/dienstwagenboerse/controller?" + params;
        var name = "DWBSATELLIT";
        var width = "792";
        var height = "600";
        var spec = "scrollbars=yes,resizable=yes";

        open_satellite_without_querystring(url, width, height, true, name, spec);
}

function open_dienstwagen(params){
  openDWB(params);
}

function open_gwb(modell,preis){
  var modell = indicateModell(modell);
  modell = '?Hersteller='+modell;

  var preis = indicatePreis(preis);
  preis ='&Euro='+preis;

  var url = 'http://gebrauchtwagen.audi.de/agwb/suma.asp'+modell+preis;
  var optionen ="resizable=no,scrollbars=yes,menubar=no,toolbar=no,left=0,top=0,screenX=0,screenY=0";
  var height = "515";
  var width = "710";
  var attrString = ("width=" + width + ",height=" + height +",optionen=" + optionen);
  var winname = "AUDI_GWB";

  document.location.href = url;
}

function indicateModell(modell){
  switch(modell){
    case "audi":
      modell = '1';
      return modell;
      break;
    case "a2":
      modell = '1;9';
      return modell;
      break;
    case "a3":
      modell = '1;10';
      return modell;
      break;
    case "a4":
      modell = '1;13';
      return modell;
      break;
    case "a4avant":
      modell = '1;16';
      return modell;
      break;
    case "a6":
      modell = '1;14';
      return modell;
      break;
    case "a6avant":
      modell = '1;17';
      return modell;
      break;
    case "a8":
      modell = '1;15';
      return modell;
      break;
    case "cabrio":
      modell = '1;28';
      return modell;
      break;
    case "tt":
      modell = '1;31';
      return modell;
      break;
    case "vw":
      modell = '40';
      return modell;
      break;
    case "bmw":
      modell = '3';
      return modell;
      break;
    case "fiat":
      modell = '8';
      return modell;
      break;
    case "ford":
      modell = '9';
      return modell;
      break;
    case "mercedes":
      modell = '19';
      return modell;
      break;
    case "opel":
      modell = '22';
      return modell;
      break;
    default:
      modell = '1';
      return modell;
      break;
  }
}

function indicatePreis(preis){
  switch(preis){
    case "alle":
      preis = '-1;-1';
      return preis;
      break;
    case "klasse1":
      preis = '0;1';
      return preis;
      break;
    case "klasse2":
      preis = '1;2';
      return preis;
      break;
    case "klasse3":
      preis = '2;3';
      return preis;
      break;
    case "klasse4":
      preis = '3;4';
      return preis;
      break;
    case "klasse5":
      preis = '4;5';
      return preis;
      break;
    case "klasse6":
      preis = '5;6';
      return preis;
      break;
    case "klasse7":
      preis = '6;7';
      return preis;
      break;
    case "klasse8":
      preis = '7;8';
      return preis;
      break;
    case "klasse9":
      preis = '8;1';
      return preis;
      break;
    default:
      preis = '-1;-1';
      return preis;
      break;
  }
}

function openNWB (params) {
  open_neuwagenboerse(params);
}

function open_neuwagenboerse(params) {
        if(typeof(params) == "undefined"){
            params = "";
        }
        var url = "http://neuwagenboerse.audi.de/neuwagenboerse/controller?" + params;
        var name = "NWBSATELLIT";
        var width = "792";
        var height = "600";
        var spec = "scrollbars=yes,resizable=yes";

        open_satellite_without_querystring(url, width, height, true, name, spec);
}

function open_rs6(){
  var url = "http://microsites.audi.com/satellite/rs6/pages/audi.htm";
  var name = "rs6";
  var spec = "width=600,height=360,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";

  window.open(url, name, spec);
}

function open_lemans(lang)
{
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  var url  = "http://microsites.audi.com/satellite/lemans/lemans_"+lang+".html";
  var name = "lemans";

  window.open(url, name, "width=770,height=380,directories=no,menubar=no,toolbar=no,status=no,scrollbars=no");
}

function open_leman(nr)
{
  open_lemans();
/*
  var name = "win_leman" + nr;
  var url = "http://www.audi-sportpress.com/lemans2002/" + nr + ".jpg";
  window.open(url, name, "width=360,height=280,status=no,scrollbars=no,resizable=no");
*/
 }

function open_fsi()
{
  window.open("http://microsites.audi.com/satellite/fsi/fsi_micro.html","fsi","width=600,height=360,status=no,scrollbars=no,resizable=no");
 }

function open_security(lang)
{
  var url = "http://microsites.audi.com/satellite/security/"+lang+"/index.html";
  if(typeof(lang) == "undefined"){
    url = "http://microsites.audi.com/satellite/security/a6_a8_weiche.html";
  }
  var name = "security";
  var spec = "width=600,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no";

  window.open(url,name,spec);
}

function open_a6security(lang)
{
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  var url = "http://microsites.audi.com/satellite/security/a6_security/"+lang+"/a6_start_"+lang+".html";
  var name = "security";
  var spec = "width=600,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no";

  window.open(url,name,spec);
}

function open_a8security(lang)
{
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  var url = "http://microsites.audi.com/satellite/security/a8_security/"+lang+"/bin/a8_start_"+lang+".html";
  var name = "security";
  var spec = "width=600,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no";

  window.open(url,name,spec);
}

function openAK(params){
    if(typeof(params) == "undefined"){
      params = "";
    }
  var lang = "de";
  open_konfigurator_with_params(params, lang)
}

function openAKModel(model, params){
      if(typeof(params) == "undefined"){
        params = "";
      }
    var lang = "de";
    open_konfigurator_with_params(params, lang, model)
}

function openRoutenplaner(id){
   if(typeof(id) == "undefined"){
     id = "1";
   }
   var url = "http://194.25.187.67/Audi/eingabe.asp";
   url += "?ID=" + id;

   open_satellite_without_querystring(url, 639, 545, false, "routenplaner");
}

function open_cabrio(){
    window.open("http://microsites.audi.com/satellite/cabrio/index.htm", "A4_Cabriolet","width=600,height=360,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,fullscreen=no")
}

function open_dienstjahreswagen(){
   open_satellite("http://www.audi.de/gebrauchtwagen/audi/gfz1/f_dienst.html", 600,400,false,'dienstjahres');
}

function gebraucht_a8(){
    window.open("http://gebrauchtwagen.audi.de/aa8gwb/aa8gwb.dll/", "A8_Gebrauchtwagen","width=800,height=600,resizable=no,scrollbars=yes,fullscreen=no")
}

function open_segelsport(){
    window.open("http://www.audi.com/segelsport/start_de.html","Segelsport","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=724,height=352")
}

function open_s4() {

  window.open('http://microsites.audi.com/satellite/s4/s4.html', 'Audi_S4', 'status=0,scrollbars=0,resizable=0,width=600,height=360');
}

function open_weihnacht(){
  kontakt = window.open("http://shop.audi.de/webapp/wcs/stores/servlet/accessoires/cristmas/weihnacht.html","Weihnachtsspecial","width=660,height=468");
}

function open_wintersport(lang) {
    if(typeof(lang) == "undefined"){
        lang = "de";
    }
    window.open("http://microsites.audi.com/satellite/wintersport/html/" + lang  + "/index.html","Wintersport","width=770,height=600,menubar=no,location=no,resizable=no,scrollbars=no")
}

function open_wintersport_de(lang) {
  open_wintersport('de');
}

function open_wintersports(lang) {
  open_wintersport('de');
}

function open_wintersports_de(lang) {
  open_wintersport('de');
}

function open_finanzierung(lang){
    lang = "de";
    open_satellite("http://www.audi.de/finanzierung/de/ct_start_"+lang+".html", 400,250,false,'finanz');
}

function open_fus(lang){
   lang = "de";
   open_satellite("http://www.audi.de/fus_excel/index_"+lang+".html" + querystring, 600, 402, false);
}

function open_sonderfahrzeuge(lang){
  lang = "de";
  open_satellite("http://www.audi.de/sonderfahrzeuge/index_"+lang+".html",600,420,false);
}

function load_homepage(lang){
    lang = "de";
    // es gibt zur zeit nur eine deutschen homepage
    var s = "http://www.audi.de/index_"+lang+".html" + querystring;
    document.location.href = s;
}

function open_ipix(ipix, lang){
    lang = "de";
    var url = "http://www.audi.de/ipix-sat/any_ipix_"+lang+".html?ipix="+ipix;
    open_satellite(url, 520, 252, false);
}
function open_ipix_help(lang){
    lang = "de";
    var url = "http://www.audi.de/ipix-sat/ipix_help_"+lang+".html";
    open_satellite(url, 520, 252, false);
}

function open_aussen(url){
    lang = "de";
    open_satellite(url,527,230);
}

//erstellt von divine
function open_vwportal(){
    neuesFenster=window.open('http://www.vwgroupsupply.com/VWPortal/Navigation','VWGroup','toolbar=yes,status=yes,scrollbars=yes,location=yes,menubar=yes,resizable=yes');
}

function open_mmi()
{
  var optionen = 'toolbar=no,width=400,height=500,directories=no,status=no,scrollbars=no,resize=no,menubar=no,top=20,left=80';
  var url = 'http://microsites.audi.com/satellite/mmi/emulation.html';

  if (is_ns4up) {
    mmiFenster = open(url,'mmiFenster',optionen);
    mmiFenster.focus();
  }

  if (is_ie4up) {
    mmiFenster = open(url,'mmiFenster',optionen);
    // Verzoegerung, da IE eine Fehelermeldung abgibt, wenn ein gerade geoeffnetes Fenster fokussiert wird
      setTimeout('mmiFenster.focus();',250);
  }
}

function open_mmi_en()
{
  var optionen = 'toolbar=no,width=400,height=500,directories=no,status=no,scrollbars=no,resize=no,menubar=no,top=20,left=80';
  var url = 'http://microsites.audi.com/satellite/mmi_en/emulation.html';

  if (is_ns4up) {
    simFenster = open(url,'mmiFenster',optionen);
    simFenster.focus();
  }

  if (is_ie4up) {
    simFenster = open(url,'mmiFenster',optionen);
    // Verzoegerung, da IE eine Fehelermeldung abgibt, wenn ein gerade geoeffnetes Fenster fokussiert wird
      setTimeout('simFenster.focus();',250);
  }
}

// ---------------------------------------------------------------------------------

function open_peakcard(lang){
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  url = "http://microsites.audi.com/satellite/pikespeak/ecard/"+lang+ "/formular.html";
  window.open(url,"ECard","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=501,height=558");
}

function open_pikespeak(lang){
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  url = "http://microsites.audi.com/satellite/pikespeak/swf/intro_"+lang+ ".html";
  window.open(url,"Pikespeak","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=740,height=420");
}

function open_nuvolari(lang){
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  url = "http://microsites.audi.com/satellite/nuvolari/"+lang+"/html/intro.html";
  window.open(url,"Nuvolari","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=740,height=400");
}

function open_nuvocard(lang){
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  url = "http://microsites.audi.com/satellite/nuvolari/ecard/"+lang+ "/formular.html";
  window.open(url,"ECard","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=501,height=558");
}

function open_ttcard(lang){
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  url = "http://microsites.audi.com/satellite/tt/ecard/"+lang+"/formular.html";
  window.open(url,"ECard","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=501,height=558");
}

function open_tt(){
  url = "http://microsites.audi.com/satellite/tt/start.htm";
  window.open(url,"Nuvolari","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=600,height=360");
}

function open_xmas2003(lang){
  if(typeof(lang) == "undefined"){
    lang = "de";
  }
  url = "http://microsites.audi.com/satellite/xmas2003/"+lang+ "/formular.html";
  window.open(url,"ECard","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=501,height=558");
}

function open_guidedtour (tour,locationbar,menubar,toolbar,resizable,scrollbars,width,height) {
    config = "width=" + width + ",height=" + height + ",location=" + locationbar +",";
    config+= "menubar=" + menubar + ",toolbar=" + toolbar + ",resizable=" + resizable + ",scrollbars=" + scrollbars;
    TourWindow = window.open("http://tour.datango.de/navigator/?tour=" + tour, "tour",config);
}

function open_guidedtour_neuwagen (tour,locationbar,menubar,toolbar,resizable,scrollbars,width,height) {
        config = "width=" + width + ",height=" + height + ",location=" + locationbar +",";
        config+= "menubar=" + menubar + ",toolbar=" + toolbar + ",resizable=" + resizable + ",scrollbars=" + scrollbars;
    var TourWindow = window.open("http://tour.datango.de/navigator/?tour=" + tour, "tour",config);
}

function open_audibank(){
  url = "http://services.volkswagenbank.de/xml/cc/default.asp?BRAND=A";
  window.open(url,"ECard","toolbar=no,location=no,directories=no,menubar=no,scrollbars=1,resizable=no,width=550,height=580");
}

function open_dienstwagenrechner(){
  url = "http://finanzen.focus.msn.de/D/DA/DAR/DARB/v02.htm";
  window.open(url,"ECard","toolbar=no,location=no,directories=no,menubar=no,scrollbars=1,resizable=no,width=595,height=600");
}

function open_wertberechnung(){
  url = "http://gebrauchtwagen.audi.de/index/html/gw_wert_start.html";
  window.open(url,"Gebrauchtwagenwertberechnung","toolbar=no,location=no,directories=no,menubar=no,scrollbars=0,resizable=no,width=479,height=547");
}

function open_gwb_wertberechnung(type){

  if (type == 'mitfs'){
    var url = "http://dat.de/gr_dat.audi.v2/index.php3?appID=gwb&f_art=5&redirect=0&text_link=Fenster+schlie%DFen&view=kba";
  }
  if (type == 'ohnefs'){
    var url = "http://dat.de/gr_dat.audi.v2/index.php3?appID=gwb&f_art=5&redirect=0&text_link=Fenster+schlie%DFen&view=marktspiegel";
  }
  if (!type){
    var url = "http://dat.de/gr_dat.audi.v2/index.php3?redirect=0&text_link=Fenster+schlie%DFen";
  }
  var gwb_wertberechnung = window.open(url,"Gebrauchtwagenwertberechnung","screenX=0,screenY=0,toolbar=no,status=no,location=no,directories=no,menubar=no,scrollbars=0,resizable=no,width=565,height=570");

  gwb_wertberechnung.focus();
}
//
// erstellt von divine
// ge?ert am 16.12.2003
// wie Funktion "open_audibank()"

function open_vers_finanz(which){
  url = "http://services.audibank.de/CalculatorFE/audi/ConfiguratorNewCars.aspx";
  window.open(url,"calculate","toolbar=no,location=no,directories=no,menubar=no,scrollbars=1,resizable=yes,width=760,height=590");
}

//erstellt von divine am 05.03.2002
function open_allroad(){
    var url     = "http://microsites.audi.com/satellite/aaq/pages/intro.htm";
    var name    = "allroad";
    var spec        = "status=no,scrollbars=no,resizable=no";
    var w           = 600;
    var h           = 360;

    open_satellite_without_querystring(url, w, h, true, name, spec);

}

//erstellt von divine am 05.03.2002
function open_journalisten(){
    var url     = "https://journalisten.audi.de/journalisten/DCO";
    var name    = "journalisten";
    var spec        = "status=yes";
    var w           = 782;
    var h           = 585;

    open_satellite_without_querystring(url, w, h, false, name, spec);

}

// needed after relaunch
function open_press(lang, page) {
    var url     = "http://www.audi-press.com";
    var name    = "audi_press";
    if(typeof(lang) == "string"){
        if(typeof(page) == "string"){
            if(page == "akk"){
                url += "/online/akkreditierung.php3?lan=" + lang;
            }
        }
    }
    var spec        = "location,menubar,personalbar,scrollbars=yes,status,toolbar,resizable=yes";
    var w           = 740;
    var h           = 350;

    open_satellite_without_querystring(url, w, h, true, name, spec);

}

// needed after relaunch
function open_shop(lang){
    lang = "de";
    open_satellite("http://shop.audi.de/webapp/wcs/stores/servlet/Home?catalogId=10051&storeId=10051&langId=-3",687,465,false,'shop');
}

// needed after relaunch
//
// Nach dem Relaunch der neuen audi.com Site
// braucht es das Target nicht mehr
// Es besteht die Gefahr eines Access denied
// bei unterschiedlichen Domains
function load_auditorium(target){
    var s = "http://195.126.205.250:8080/auditorium/html/home.html";
    if (target != ''){  // Es wird ein Parameter mit bergeben, wenn der Aufruf von einem PopUp stammt.
        top.opener.top.location.href = s;
        top.opener.focus();

    } else{
        document.location.href = s;
    }
}

function open_panorama(modell){
    var url = "http://www.audi.de/sat_panorama/"+modell+"/index.html";
    open_satellite(url, 440, 550, false);
}

function load_universal(url){
    document.location.href = url;
}

function load_wap(lang){
    lang = "de";
    // es gibt zur zeit nur eine deutschen homepage
    var s = "http://www.audi.de/index_"+lang+".html?startpage=audi_service/multimedia_"+lang+".html&start=multimedia/wap/start_"+lang+".html";
    document.location.href = s;
}

function load_telematics(lang){
    lang = "de";
    var s = "http://www.audi.de/index_"+lang+".html?startpage=audi_service/service_"+lang+".html&start=service/telematik/telematics_"+lang+".html";
    document.location.href = s;
}

function load_foren(lang){
    lang = "de";
    var s = "http://www.audi.de/index_"+lang+".html?startpage=vor_ort/vorort_"+lang+".html&start=vorort/foren/ingolstadt_"+lang+".html";
    document.location.href = s;
}

function load_welcomeservice(lang){
    lang = "de";
    var s = "http://www.audi.de/index_"+lang+".html?startpage=vor_ort/vorort_"+lang+".html&start=vorort/welcome/intro_"+lang+".html";
    document.location.href = s;
}

function load_museummobile(lang){
    open_foren_startsite(lang)
    //lang = "de";
    //var s = "http://www.audi.de/index_"+lang+".html?startpage=vor_ort/vorort_"+lang+".html&start=vorort/foren/museummobile_"+lang+".html";
   // document.location.href = s;
}

function open_exclusive(){
  var url = "http://microsites.audi.com/satellite/exclusive/start.htm";
  var name = "exclusive";
  var spec = "width=750,height=450,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}

function open_gewinnspiel(){
  var url = "http://microsites.audi.com/satellite/iaa2003/eingabe.jsp";
  var name = "gewinnspiel";
  var spec = "width=479,height=536,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}

function open_iaaspecial(lang){
    if(typeof(lang) == "undefined"){
      lang = "dt";
    }

    var url = "http://microsites.audi.com/satellite/iaaspecial/"+lang+"/index_lmq_"+lang+".html";
    breite = screen.availWidth - 10;
    hoehe = screen.availHeight - 28;
    px = breite/2-380;
    py = hoehe/2-235;
    popw = 760;
    poph = 470;
    wndProps = "top="+py+",left="+px+",width="+popw+",height="+poph+",scrollbars=no,rezisable=no";
    iaawindow=window.open(url,"iaawindowmain",wndProps);
}

function open_a4_style()
{
  var url = "http://microsites.audi.com/satellite/a4_style/a4.html";
  newwindow=window.open(url,'popup','height=345,width=599,scrollbars=no');
  if (window.focus) {newwindow.focus()}
}

/*function open_programmkino(){
  var url = "http://www.museummobile.de/deutsch/01_information/programmkino.php";
  var name = "programmkino";
  var spec = "width=790,height=550,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}*/

function open_volkswagenbank(){
  var url = "http://services.volkswagenbank.de/services/calcserver/iaa2003/default.asp";
  var name = "iaamicrosite";
  var spec = "height=324,width=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}

function calc_vw(CALCMODE,MODELID,CLIENTID,MODELYEAR,MODELTEXT,PRICE,CURRENCY,BRAND,KMJ,LZ,ANZAHLUNG,ZINS,RVS){

  var url = "http://microsites.audi.com/satellite/finance/vw_calc/calc_redirect.html?" +

            "CLIENTID="+CLIENTID+
            "&MODELID="+MODELID+
            "&MODELYEAR="+MODELYEAR+
            "&PRICE="+PRICE+
            "&MODELTEXT="+MODELTEXT+
            "&PRESET_MILEAGE="+KMJ+
            "&PRESET_DURATION="+LZ+
            "&PRESET_DOWNPAYMENT="+ANZAHLUNG+
            "&PRESET_RSV="+RVS+
            "&PRESET_PRODUCT="+CALCMODE+
            "&DEALERDATA="+
            "&SHOWNAV=yes";

  window.open(url, "Calculator", "screenX=0, screenY=0,resizable=no, scrollbars=no, toolbar=no, status=no, directories=no,menubar=no, location=no, width=700, height=540");
}

function openTechnik(){
  var url = "http://microsites.audi.com/satellite/technik/html/sniffer.htm";
  var name = "technik";
  var spec = "height=420,width=700,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}

function open_makingofa8(){
  var url = "http://microsites.audi.com/satellite/a8_makingof/index.htm";
  var name = "makingofa8";
  var spec = "height=432,width=720,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}

function open_carlifeplus(){
  var url = "http://www.audi.com/carlifeplus/clp.jsp";
  var name = "CarLifePlus";
  var spec = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=319,height=657";
  window.open(url, name, spec);
}

function open_makingofa8_en(){
  var url = "http://microsites.audi.com/satellite/a8_makingof_en/index.htm";
  var name = "makingofa8";
  var spec = "height=432,width=720,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no";
  window.open(url, name, spec);
}


// alert("/in-links/std.js gefunden")


// Integrate the popups into link onclick attribute to work around popup blockers
MODE_EQUALS = 0;
MODE_CONTAINS = 1;
MODE_STARTS_ENDS_WITH = 2;

popups = new Array();

popups[0] = new PopupItem(
                                "/de/de/neuwagen/a4/a4.jsp",
                                "",
                                MODE_EQUALS,
                                function() { openPopUp('http://microsites.audi.com/campaigns/a4_microsite/de_DE/index.html','name=a4_micro','height=500','width=800','bmp=1'); return true; }
                            );
popups[1] = new PopupItem(
                                "/de/de/neuwagen/a6/limousine/limousine.jsp",
                                "",
                                MODE_STARTS_ENDS_WITH,
                                function() { openPopUp('http://microsites.audi.com/satellite/a6_microsite/index.html','name=a6_micro','height=383','width=693','bmp=1'); return true; }
                            );
popups[2] = new PopupItem(
                                "/com/en/new_cars/new_cars.jsp",
                                "",
                                MODE_EQUALS,
                                function() { open_makingofa8_en(); return true; }
                            );
popups[3] = new PopupItem(
                                "/de/de/neuwagen/",
                                "/audi_exclusive/audi_exclusive.jsp",
                                MODE_STARTS_ENDS_WITH,
                                function() { PopUpManager('open_exclusive'); return true; }
                            );

function PopupItem(url0, url1, mode, popupFunction) {
    this.url0 = url0;
    this.url1 = url1;
    this.mode = mode;
    this.popupFunction = popupFunction;
}

function addPopupsToLinks() {
    thisHost = window.location.protocol + "//" + window.location.host;
    linkCount = document.links.length;

    for (i = 0; i < linkCount; i++) {
        linkOnclick = document.links[i].onclick;
        if (!linkOnclick) {
            linkUrl = String(document.links[i]);
            hostIdx = linkUrl.indexOf(thisHost);
            if (hostIdx > -1) {
                linkUrl = linkUrl.substring(hostIdx + thisHost.length);
            }

            for (q = 0; q < popups.length; q++) {
                switch (popups[q].mode) {
                    case MODE_EQUALS:
                        if (linkUrl == popups[q].url0) {
                            document.links[i].onclick = popups[q].popupFunction;
                        }
                    break;
                    case MODE_CONTAINS:
                        if (linkUrl.indexOf(popups[q].url0) > -1) {
                            document.links[i].onclick = popups[q].popupFunction;
                        }
                    break;
                    case MODE_STARTS_ENDS_WITH:
                        if (linkUrl.indexOf(popups[q].url0) == 0 && linkUrl.lastIndexOf(popups[q].url1) == (linkUrl.length - popups[q].url1.length)) {
                            document.links[i].onclick = popups[q].popupFunction;
                        }
                    break;
                }
            }
        }
    }
}
