/*
BEGIN FROM debitel.js
*/


/* INTERNE HILFSFUNKTION(EN) ***********************************************/
// HAZ fuer die blur und focus input felder /
var focusColor='#EFF0F2';
var blurColor='#FFFFFF';

 
// vb: 041104: analog der php-funktion in_array:
// bool in_array( mixed needle, array haystack )

function in_array( wot, arr ) {
  for (var i = 0; i < arr.length; i++)
    if (arr[ i ] == wot) return true;
  return false;
}

function navClick( url ) {
  window.location.href = url;
}

function naviClick(element) {
  if (element.getElementsByTagName) {
    var a = element.getElementsByTagName( 'a' )[0];
    if (a) navClick(a);
  }
}

// function browserScreenWidth() {
//   return (screen.width);
// }
// function browserScreenHeight() {
//   return (screen.height);
// }
// function browserScreenAvailWidth() {
//   return (screen.availWidth);
// }
// function browserScreenAvailHeight() {
//   return (screen.availHeight);
// }
// function browserWindowWidth() {
//   if (window.outerWidth) return window.outerWidth;
//   if (browser.ie) {
//     /* vb: fixme: beim ie bekomme ich die browser-groessee nur ueber einen workaround: */
//     /* miss deine inneren masse, resize, miss nochmal deine inneren masse & resize zurueck */
//     origX = document.body.offsetWidth;
//     origY = document.body.offsetHeight;
//     window.resizeTo( 500, 500 );
//     tmpX = document.body.offsetWidth;
//     tmpY = document.body.offsetHeight;
//     deltaX = origX - tmpX;
//     deltaY = origY - tmpY;
//     window.resizeTo( 500 + deltaX, 500 + deltaY );
//     return (500 + deltaX);
//   }
//   return 0;
// }
// function browserWindowHeight() {
//   if (window.outerHeight) return window.outerHeight;
//   if (browser.ie) {
//     /* vb: fixme: beim ie bekomme ich die browser-groesse nur ueber einen workaround: */
//     /* miss deine inneren masse, resize, miss nochmal deine inneren masse & resize zurueck */
//     origX = document.body.offsetWidth;
//     origY = document.body.offsetHeight;
//     window.resizeTo( 500, 500 );
//     tmpX = document.body.offsetWidth;
//     tmpY = document.body.offsetHeight;
//     deltaX = origX - tmpX;
//     deltaY = origY - tmpY;
//     window.resizeTo( 500 + deltaX, 500 + deltaY );
//     return (500 + deltaY);
//   }
//   return 0;
// }
// function browserDocumentWidth() {
//   /* vb: ein sinnvoller wert ist hier nur bei einer fertig geladenen seite zu erwarten. */
//   /* wenn der </body>-tag noch aussteht, dann bekommen wir schmarri */
//   if (this.ns) return document.width;
//   if (document.body.scrollWidth) return document.body.scrollWidth;
//   return 0;
// }
// function browserDocumentHeight() {
//   /* vb: ein sinnvoller wert ist hier nur bei einer fertig geladenen seite zu erwarten. */
//   /* wenn der </body>-tag noch aussteht, dann bekommen wir (margin-top + margin-bottom) */
//   if (this.ns) return document.height;
//   if (document.body.scrollHeight) return document.body.scrollHeight;
//   return 0;
// }
// function browserVisibleWidth() {
//   if (window.innerWidth) return window.innerWidth;
//   if (document.body.clientWidth) return document.body.clientWidth;
//   return 0;
// }
// function browserVisibleHeight() {
//   if (window.innerHeight) return window.innerHeight;
//   if (document.body.clientHeight) return document.body.clientHeight;
//   return 0;
// }
// function browserScrollTest() {
//   /* hier sollte der default-wert true sein, oder? */
//   /* da diese funktion documentHeight aufruft, liefert sie ohne </body> ebenfalls nonsense */
//   return (this.documentHeight() > this.visibleHeight());
// }
// 
function browserTest() {
  /* vb: fuer erweiterungen und anregungen: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html */
  this.klient  = navigator.userAgent.toLowerCase();
  this.version = parseInt( navigator.appVersion );
  this.ver     = parseFloat( navigator.appVersion );

  /* vb: da fehlen natuerlich noch amiga, c64, unix &&& */
  this.win   = ((this.klient.indexOf( "win" ) != -1) || (this.klient.indexOf( "16bit" ) != -1));
  this.mac   = (this.klient.indexOf( "mac" ) != -1);
  this.linux = (this.klient.indexOf( "inux" ) != -1);
  this.sun   = (this.klient.indexOf( "sunos" ) != -1);
  this.bsd   = (this.klient.indexOf( "bsd" ) != -1);

  /* die einzelnen browsers beinhalten keine exakten versionsnummern */
  /* sie sind eher fuer den webdev gedacht und werden je nach funktionalitaetserweiterungen selbiger belegt */
  /* es empfiehlt sich also immer ein >= statt einem ==, da browsers manchmal abwaertskompatibel sind */
  /* vb: beinhaltet die versionsnummer, funktioniert aber auch als wie ein boolean (wenn > 1) */
  this.ie = 0;
  if ((this.klient.indexOf( "msie" ) != -1) && (this.klient.indexOf( "opera" ) == -1)) {
    this.ie = 1;
    if (document.all) this.ie = 4;
    if (document.getElementById) this.ie = 5;
  }
  this.ns = 0;
  if ((this.klient.indexOf( "mozilla" ) != -1) && (this.klient.indexOf( "spoofer" ) == -1) && (this.klient.indexOf( "compatible" ) == -1) && (this.klient.indexOf( "opera" ) == -1) && (this.klient.indexOf( "webtv" ) == -1) && (this.klient.indexOf( "hotjava" ) == -1)) {
    this.ns = 1;
    if (document.layers) this.ns = 4;
    if (document.getElementById) this.ns = 7;
    if (this.klient.indexOf( "netscape6" ) != -1) this.ns = 6;
  }
  this.op = 0;
  if (this.klient.indexOf( "opera" ) != -1) {
    this.op = 1;
    if (document.getElementById) this.op = 5;
  }
  this.co = 0;
  /* vb: meiner schreibt sich mit k: */
  if (this.klient.indexOf( "onqueror" ) != -1) {
    this.co = 1;
  }
  this.aol = 0;
  if (this.klient.indexOf( "aol" ) != -1) {
    this.aol = 1;
  }
// 
//   /* funktionen f?r deine gr??en: */
//   this.screenWidth = browserScreenWidth;
//   this.screenHeight = browserScreenHeight;
//   this.screenAvailWidth = browserScreenAvailWidth;
//   this.screenAvailHeight = browserScreenAvailHeight;
//   this.windowWidth = browserWindowWidth;
//   this.windowHeight = browserWindowHeight;
//   this.documentWidth = browserDocumentWidth;
//   this.documentHeight = browserDocumentHeight;
//   this.visibleWidth = browserVisibleWidth;
//   this.visibleHeight = browserVisibleHeight;
//   this.scrollt = browserScrollTest;
}


/* AUTOSTART (INITIALISIERUNG) ******+**************************************/

/* das browser-objekt hoechstpersoenlich: */
var browser = new browserTest();

/* interne hilfsfunktionen */

/* isObj liefert true, wenn alle uebergebenen strings ein objekt waeren/sind/tun: */
function isObj() {
  for (var i = 0; i < isObj.arguments.length; i++)
    if (eval( "typeof( " + isObj.arguments[ i ] + " );" ) == "undefined")
      return false;
  return true;
}  // function isObj

/* getSrcFromImg gibt das src-attribut des kompletten img-elements zurueck, */
/* falls ein solches uebergeben worden ist. wenn nicht, dann nicht. */
/* dies macht nur sinn, wenn unser liebes cms nps die links verwaltet */
function getSrcFromImg( url ) {
  /* vb: fixme: das ist noch nicht der src, */
  /* sondern einfach das erste doppelt gequotete attribut: */
  return (url.indexOf( "<img" ) == 0) ? url.split( "\"" )[ 1 ] : url;
}

/* get the layer-object: */
function div( divID ) {
  if (document.getElementById) {
    return (document.getElementById( divID )) ? document.getElementById( divID ) : false;
  }
  if (document.layers) {
    return (document.layers[ divID ]) ? document.layers[ divID ] : false;
  }
  if (document.all) {
    return (document.all[ divID ]) ? document.all[ divID ] : false;
  }
  return false;
}
/* get the css-properties: */
function divStyle( divID ) {
  if (document.getElementById || document.all) {
    return (div( divID ).style) ? div( divID ).style : false;
  }
  if (document.layers) {
    return div( divID );
  }
  return false;
}
function divShow( ) {
  if (divShow.arguments.length>= 1) {
    divID = divShow.arguments[ 0 ];
  }
  sichtbarkeit = (document.layers) ? "show" : "visible";
  if (divShow.arguments.length >= 2) {
    sichtbarkeit = (document.layers) ? "hide" : "hidden";
  }
  if (divStyle( divID )) {
    divStyle( divID ).visibility = sichtbarkeit;
  }
}
function divHide( divID ) {
  // alert ( 'hide!');
  if (divID == 'powerlayer') {
    /* vb: 050621: sonderfall, damit alles, */
    /* was unter einem (ausgeblendeten) powerlayer liegt, */
    /* klickbar bleibt: */
    divDisplayHide( 'powerlayer' );
  } else {
    divShow( divID, false );
  }
}

/* divDisplay uses the crazy display-feature: */
function divDisplay() {
  if (isObj( "browser", "divDisplay" )) {
    if (divDisplay.arguments.length > 0) {
      /* der 1te parameter ist der name vom div */
      var divID = divDisplay.arguments[ 0 ];
      /* der 2te parameter ist die display-angabe, ansonsten display it einfach mal: */
      var divThen = (divDisplay.arguments.length > 1) ? divDisplay.arguments[ 1 ] : "block";
      if (browser.ie > 4 || browser.op > 4) {
        /* vb: mit divStyle( divID ).display kann ich hier nicht arbeiten, */
        /* weil der ie hier nicht auf document.getElementById sondern auf document.all anspricht, */
        /* ich sonst aber document.getElementById bevorzuge (weil browserunabh?ngiger) */
        //alert( "man glaubt es nicht" );
        if (document.all[ divID ]) {
          document.all[ divID ].style.display = divThen;
        }
      }
      /* alert( browser.op ); */
      if ( (browser.ns > 4 || browser.op >= 5) && (document.getElementById( divID )) )  {
        //alert("yep");
        document.getElementById( divID ).style.display = divThen;
      }
      /* vb: fixme: netscape4 (zumindest hidden), opera, conqueror? */
    }
  } else {
    window.status = "JavaScript-Error!";
  }
}
function divDisplayHide( divID ) {
  divDisplay( divID, "none" );
}
function divDisplayToggle( divID ) {
  divThen = (divStyle( divID ).display == "block") ? "none" : "block";
  // alert( divID + " " + divThen );
  divDisplay( divID, divThen );
}

function divWrite( divID, newHTML ) {
  if (div( divID )) {
    if (document.layers) {
      divThing = div( divID );
      divThing.document.open();
      divThing.document.write( newHTML );
      divThing.document.close();
    } else {
      div( divID ).innerHTML = newHTML;
    }
  }
}

function imgInit( imgName, imgTag ) {
  eval( imgName + " = new Image();" );
  eval( imgName + ".src = \"" + getSrcFromImg( imgTag ) + "\"" );
}  // function imgInit
function imgOn() {
  /* vb: wenn nur ein parameter uebergeben worden ist, dann mach das on-bild hin: */
  if (imgOn.arguments.length == 1)
    if (document.images)
      if (document[ imgOn.arguments[ 0 ] ])
        document[ imgOn.arguments[ 0 ] ].src = eval( imgOn.arguments[ 0 ] + "On.src" );
  /* vb: wenn 2 parameters kommen, dann soll ich wohl das 1te durch das 2te ersetzen: */
  if (imgOn.arguments.length == 2)
    if (document[ imgOn.arguments[ 0 ] ])
      document[ imgOn.arguments[ 0 ] ].src = eval( imgOn.arguments[ 1 ] + ".src" );
}  // function imgOn
function imgOff( imgName ) {
  imgOn( imgName, imgName + "Off" );
}  // function imgOff


/* FLASH-ABFRAGE */
/* GLOBALE VARIABLE(N) *****************************************************/

/* diese variablen sind die globalen default-werte fuer die function flashDisplay */
/* sollten sie nicht explizit vor dem aufruf von flashDisplay ueberschrieben werden, */
/* kommts zumindest nicht zu einem javascript-fehler */
var addonParams = '';
var pastloadSwf = '';
var preloadedSwf=false;
var swfATag = '<a href="internallink:12961869">NPSLinkOnly</a>';
var swfBgcolor = '#ffffff';
var swfFallbackHTML = '';
var swfHeight = '300';
var swfLiveConnect = 'false';
var swfName = 'Flash';
var swfPreload = '';
var swfScriptAccess = 'always';
var swfVersion = '6';
var swfWidth = '400';
var swfWmode = 'transparent';
var targetUrl = [];
// Ende.

 
/************ÖFFENTLICHE FUNKTIONEN**************************************/

function limitText($limitField, $limitCount, limitNum) {
	if ($limitField.val().length > limitNum) {
		$limitField.val($limitField.val().substring(0, limitNum));
	} else {
		$limitCount.text(limitNum - $limitField.val().length);
	}
}

function getMovieObject(movieName) {
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  } else {
    return document[movieName]
  }
}
function loadrealFlash() {
 try { getMovieObject(swfName).GotoFrame(swfPreload);preloadedSwf=true;} catch(e) {}
 if (!preloadedSwf) { window.setTimeout("loadrealFlash()", 1000);}
}

function flashDisplay() {
//<!--
  var swfSrc = swfATag.split( "\"" )[ 1 ];
  var success = false;
  var params = '';
  
  plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : false;
  if (plugin) {
    var d = plugin.description;
    d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
    var playerVersion = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
    plugin = playerVersion >= swfVersion ;
  } else {
    if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
      document.write('<SCRIPT LANGUAGE="VBScript\"> \n');
      document.write('on error resume next \n');
      document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + swfVersion + '")))\n');
      document.write('</SC' + 'RIPT>' );
    } 
  } 
  if (plugin) {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
    if ( document.location.href.substr( 0, 5 ) == 'https' ) {
      document.write(' codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '); 
    } else {
      document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
    }
    // fuer preloader
    if (pastloadSwf != '') {
      params += 'werbemittel=' + pastloadSwf.split('"')[1] + '&';
    }
    for (i = 0; i < targetUrl.length; i++) {
      if (pastloadSwf != '')
        params += targetUrl[i][0] + '=' + escape(encodeURIComponent(targetUrl[i][1].split('"')[1].replace(/\&amp;/g,"&")))+'&';
      else
        params += targetUrl[i][0] + '=' + encodeURIComponent(targetUrl[i][1].split('"')[1].replace(/\&amp;/g,"&"))+'&';
    }
    // sonstige(s)
    if (addonParams != '') {
      params += addonParams;
    }
    
    document.write(' id="'+swfName+'" width="' + swfWidth + '" height="' + swfHeight +'" >');
    document.write(' <param name="movie" value="' + swfSrc + '">');
    document.write(' <param name="quality" value="high">');
    document.write(' <param name="bgcolor" value="' + swfBgcolor + '">');
    document.write(' <param name="wmode" value="' + swfWmode + '">');
    document.write(' <param name="flashvars" value="' + params + '">');
    document.write(' <param name="allowscriptaccess" value="' + swfScriptAccess + '">');
    document.write(' <param name="swLiveConnect" value="' + swfLiveConnect + '">');
    document.write(' <embed name="' + swfName + '" src="' + swfSrc + '" wmode="' + swfWmode + '" quality="high" bgcolor="' + swfBgcolor + '"');
    document.write(' flashvars="' + params + '" width="' + swfWidth + '" height="' + swfHeight + '"');
    document.write(' swLiveConnect="' + swfLiveConnect + '" allowscriptaccess="' + swfScriptAccess + '"');
    document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write(' </embed>');
    document.write(' </object>');
    if (swfPreload != '') { 
      window.onload = function(){ window.setTimeout('loadrealFlash()',500); }
    };
    success = true;
  } 
  if (!success) document.write( swfFallbackHTML );
  return success; // just in case... fallback!
//-->
} 
function go() {
tempUrl = "";
if (typeof( go.arguments[ 0 ] ) != "undefined" && go.arguments.length > 0) {
    if (typeof( go.arguments[ 0 ] ) == "string") {
      tempUrl += go.arguments[ 0 ];
    } else if (typeof( go.arguments[ 0 ] ) == "object") {
      if (typeof( go.arguments[ 0 ].selectedIndex ) == "number") {
        /* aha, du bist wohl eine selectbox */
        box = go.arguments[ 0 ];
        goBlank = (box.options[ box.selectedIndex ].value.indexOf( 'target="' ) == -1) ? false : true;
        if (go.arguments.length >= 2) {
          /* funktionsaufruf mit 2 parametern heisst: prefix */
          tempUrl += go.arguments[ 1 ];
        }
        tempUrl += getHrefFromA( box.options[ box.selectedIndex ].value );
        if (go.arguments.length >= 3) {
          /* funktionsaufruf mit 3 parametern heisst: suffix */
          tempUrl += go.arguments[ 2 ];
        }
      }
    }
    /* vielleicht gibt der 3. parameter das window an... */
    if (tempUrl != "") {
      if (goBlank) {
        goBlankTarget = /target="([^"]*)"/.exec( box.options[ box.selectedIndex ].value )[ 1 ];
        windowOpen( tempUrl, 600, 800, goBlankTarget );
      } else {
        parent.document.location.href = tempUrl;
      }  // if goBlank
      /* was anderes als selectboxen und normale strings werden noch nicht behandelt, */
      /* aber wenn bedarf ist: diese funktion ist noch sehr jung & hat hohe lernbereitschaft! */
    }
  }
}

/* diese Funktionen werden im Skyscraper/Banner selbst aufgerufen - Bitte nicht loeschen! */
function werbemittelHide( wot ) {
  if (document.images['sessionPixel']) {
    document.images['sessionPixel'].src = '/static/session.php?session_name=' + wot + 'Hidden&session_value=true';
  }
  if (div ( wot + 'Div' )) {
    divDisplayHide( 'skyscraperDiv' );
  }
}  // function werbemittelHide
function skyscraperHide() {
  werbemittelHide( 'skyscraper' );
}
/* analog der skyscraper-version fuer banner: */
function bannerHide() {
  werbemittelHide( 'banner' );
}

function teaserLink( number, type, ziel ) {
  number--;
  linkSrc = "";
  switch (type) {
    case "banner":   linkSrc = banlink[ number ]; break;
    case "sky":      linkSrc = skylink[ number ]; break;
    case "aktion":   linkSrc = aktlink[ number ]; break;
    case "topthema": linkSrc = toplink[ number ]; break;
    default:    linkSrc = "/index.php";
  }  // switch type
  linkSrc = getHrefFromA( linkSrc );
  if (linkSrc != "") {
    if (ziel == "popup") {
      windowOpen( linkSrc );
    } else {
      if (ziel == "new") {
        window.open( linkSrc );
      } else {
        document.location.href = linkSrc; 
      }  // if new
    }  // if popup
  }  // if linksrc
}  // function teaserLink

function checkboxChecker( da ){
  if (document.getElementsByName( da )[0] != false && document.getElementsByName( da ) != true) {
    if(document.getElementsByName( da )[0].checked == false)
      document.getElementsByName( da )[0].checked = true;
    else
      document.getElementsByName( da )[0].checked = false;                                
  }
  else
    document.getElementsByName( da )[0].checked = true;
}
function paintFocusSelect( da ) {
  var i = 0;
  da.style.background=focusColor;
  for (i; i < da.options.length; i++)
    da.options[ i ].style.background=focusColor;
}
function paintBlurSelect( da ) {
  var i = 0;
  da.style.background=blurColor;
  for (i; i < da.options.length; i++)
    da.options[ i ].style.background=blurColor;
}

function paintFocusInput( da ) {
  da.style.background=focusColor;
}
function paintBlurInput( da ) {
  da.style.background=blurColor;
}

// weils das window.onload nur 1x gibt, erweitern wir (frm) die funktion ggf.:
function addOnload(f) {
  if (window.onload) {
    var oldOnload = window.onload;
    window.onload = function (evt) { oldOnload(); f(); };
  } else {
    window.onload = f;
  }
}  // function addOnload

// fuer ajax
function createXMLHttpRequest() {
  try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
  try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
  try { return new XMLHttpRequest(); } catch(e) {}
  return null;
}

// fuer bspweise den fall, dass ein formularsubmit aus einem teaser getracked werden soll
function teaserTracking(campaign_id, teaser_id, subscriber_id) {
  var xhReq = new createXMLHttpRequest();
  xhReq.open("get", "/static/teaser_redirect.php?campaign_id=" + campaign_id + "&teaser_id=" + teaser_id + "&subscriber_id=" + subscriber_id, true);
  xhReq.send(null);
}

// fuer den canceler-layer, der bei vvl-abbrechern erscheinen soll
function VVLLayer() {
  var val = new Array();
  var check = window.location.search.substr(1).split("&");
  var xhReq = createXMLHttpRequest();
  for (var i = 0; i < check.length; i++) {
    val = check[i].split("=");
    if ("canceler" == val[0] && "vvl" == val[1]) {
      xhReq.open("get", "/ajax/canceler_vvl.php", true);
      xhReq.onreadystatechange = readyStateHandler;
      xhReq.send(null);
      break;
    }
  }
  
  function createElements(html){
    var overlay = document.createElement("div");
    var attr = document.createAttribute("id");
    attr.nodeValue = "vvl_overlay";
    overlay.setAttributeNode(attr);
    document.getElementsByTagName("body")[0].appendChild(overlay);
    var elem = document.createElement("div");
    var attr = document.createAttribute("id");
    attr.nodeValue = "vvl_canceler";
    elem.setAttributeNode(attr);
    elem.innerHTML = html;
    document.getElementsByTagName("body")[0].appendChild(elem);
    /*var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : false;
    if (plugin) {
      plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".") - 1)) >= 6;
    }
    if (!plugin) {
      var fallback = "<a href="internallink:12961870">";
      fallback += "<img src="internallink:12961871" width="620" height="403">";
      fallback += "</a>";
      fallback += "<a href="internallink:12961872">";
      fallback += "<img src="internallink:12961873">";
      fallback += "</a>";
      document.getElementById("vvl_content").innerHTML = fallback;
    }*/
    document.getElementById("vvl_overlay").onclick = function(){
      var node = document.getElementsByTagName("body")[0].lastChild;
      document.getElementsByTagName("body")[0].removeChild(node);
      document.getElementsByTagName("body")[0].removeChild(this);
    }
    document.getElementById("vvl_closer").onclick = function(){
      var node = document.getElementsByTagName("body")[0].lastChild;
      document.getElementsByTagName("body")[0].removeChild(node);
      node = document.getElementsByTagName("body")[0].lastChild;
      document.getElementsByTagName("body")[0].removeChild(node);
    }
  }
  
  function readyStateHandler(){
    if (xhReq.readyState < 4) {
      return false;
    }
    if (xhReq.status == 200 || xhReq.status == 304) {
      createElements(xhReq.responseText);
    }
  }
}

window.onload = function(){
  var vvl = new VVLLayer();
}
/*
END FROM debitel.js
*/

/*
BEGIN FROM webtrekk.js
*/
var wt_version=177;var wt_va=Array("wt_t1","wt_t2","wt_ln","wt_fm","wt_ba","wt_co","wt_qn","wt_ca","wt_pi","wt_ov","wt_cr","wt_oi","wt_cd","wt_cg","wt_st","wt_linktrack_be","wt_mc","wt_mcvalue","wt_cookie","wt_cookie_sid","wt_cookie_eid","wt_cookie_l_v","wt_cookie_one","wt_cookie_sid_timeout","wt_cookie_eid_timeout","wt_linktrack_params","wt_lp","wt_hm","wt_pa","wt_be","wt_dm","wt_ci","wt_kw","wt_ln_attribute","wt_fm_anonymous","wt_reporturl","wt_is","wt_fm_full_content","wt_fm_attribute");for(var i=0;i<wt_va.length;i++)eval("if(typeof("+wt_va[i]+")!='string')var "+wt_va[i]+"='';");var wt_browserName=navigator.appName,wt_browserName=(wt_indexOf(wt_browserName,"Microsoft")?wt_browserName:"MSIE"),wt_browserNameNS=(wt_browserName=="Netscape"),wt_browserNameIE=(wt_browserName=="MSIE");if(!wt_be)wt_be=wt_url2contentid(document.location.href);function wt_href(){return wt_location().href;};function wt_location(){var r=document.location;if(!document.layers&&document.getElementById){eval("try {r=top.document.location;}catch(e){};");}else{r=top.document.location;};return r;};function wt_length(a){return a!="undefined"?a.length:0;};function wt_url2contentid(url){if(!url)return "no_content";var tmp=new RegExp("//(.*)").exec(url);if(tmp.length<1)return "no_content";return tmp[1].split("?")[0].replace(/\./g,"_").replace (/\//g, ".").replace (/\.{2,};/g,".").toLowerCase();};function wt_include(s){if(!document.createElement)return false;var html_doc=document.getElementsByTagName('head').item(0);var js=document.createElement('script');js.setAttribute('language','javascript');js.setAttribute('type','text/javascript');js.setAttribute('src',s);html_doc.appendChild(js);return true;};function wt_indexOf(a,b,c){return a.indexOf(b,c?c:0);};function wt_typeof(v){return(typeof v!="undefined")?1:0;};function wt_registerEvent(obj,e,f){if(obj.addEventListener){obj.addEventListener(e,f,false);}else{if(obj.attachEvent){obj.attachEvent("on"+e,f);}}};function wt_maxlen(v,l){if(v&&v.length>l)return v.substring(0,l-1);return v;};function wt_escape(u){if(typeof(encodeURIComponent)=='function')return encodeURIComponent(u);return escape(u);};function wt_unescape(u){if(typeof(decodeURIComponent)=='function')return decodeURIComponent(u);return unescape(u);};function wt_decoder(u){var tmp=unescape(u);if(document.layers)return wt_escape(tmp);if(document.getElementById){eval("try {tmp=decodeURIComponent(u);}catch(e){};");}else{tmp=decodeURIComponent(u);};return wt_escape(tmp);};function wt_encoding(){var tmp="";if(typeof(encodeURIComponent)!='function')tmp+="&enc0=old";tmp+="&enc1=ü&enc2="
if(document.characterSet)tmp+=document.characterSet.toLowerCase();if(document.charset)tmp+=document.charset.toLowerCase();return tmp;};function wt_crypt(t){var org="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var rep="NOPQRSTUVWXYZABCDEFGHIJKLM5678901234";t=t.replace(new RegExp("[A-Z]|[a-z]|[0-9]","gi"),function($1){var sp=/[A-Z]/g;var pos=org.indexOf($1.toUpperCase());if(sp.test($1)){return rep.charAt(pos);}else{return rep.charAt(pos).toLowerCase();}});return t;};function wt_zeroPad(n,countZeros){var result=n+'';return "000000000000".substring(0,(countZeros-result.length))+result;};function wt_sid(){return '2'+wt_zeroPad(Math.floor(new Date().getTime()/1000),10)+wt_zeroPad(Math.floor(Math.random()*1000000),8);};function wt_getexpirydate(mins){var UTCstring;var Today=new Date();var nomilli=Date.parse(Today);Today.setTime(nomilli+mins*60*1000);UTCstring=Today.toUTCString();return UTCstring;};function wt_setCookie(name,value,duration){var d=location.hostname.split(".");d=d[d.length-2]+"."+d[d.length-1];var c;if(duration)c=name+"="+escape(value)+";domain="+d+";path=/;expires="+wt_getexpirydate(duration);else c=name+"="+escape(value)+";path=/;domain="+d;document.cookie=c;};function wt_getCookie(cookiename){var cookiestring=""+document.cookie;var index1=cookiestring.indexOf(cookiename);if(index1==-1||cookiename=="")return "";var index2=cookiestring.indexOf(';',index1);if(index2==-1)index2=cookiestring.length;return unescape(cookiestring.substring(index1+cookiename.length+1,index2));};function wt_urlParam(url,param,def){var p=new Array();if(url.indexOf("?")>0)p=url.substring(url.indexOf("?")+1).replace(/&amp;/,"&").split("&");for(var i=0;i<p.length;i++){if(p[i].indexOf(param+"=")==0){return wt_unescape(p[i].substring(param.length+1));}};return def;};function wt_checkCookie(){if(wt_getCookie("wt_cookietest")=="1")return true;wt_setCookie("wt_cookietest","1",0);return wt_getCookie("wt_cookietest")=="1";};var wt_linktrack_p="";var wt_linktrack_namedlinks_only;if(wt_ln=="auto"||wt_ln=="link"){wt_linktrack_namedlinks_only=false;}else{wt_linktrack_namedlinks_only=true;};if(wt_ln){wt_registerEvent(window,"load",wt_ltinstall);};function wt_ltinstall(){for(c=0;c<document.links.length;c++){var name=document.links[c].name;if(wt_ln_attribute!=""){var tmp="";eval("tmp = (document.links[c].getAttribute(wt_ln_attribute)?document.links[c].getAttribute(wt_ln_attribute):'')");if(tmp)name=tmp;};if(name||!wt_linktrack_namedlinks_only){wt_registerEvent(document.links[c],'mousedown',wt_linktrack);}}};function wt_linktrack(e){if((e.which&&e.which==1)||(e.button&&e.button==1)){var a=document.all?window.event.srcElement:this;for(var i=0;i<4;i++){if(a.tagName&&a.tagName.toLowerCase()!="a"&&a.tagName.toLowerCase()!="area"){a=a.parentElement}};a.lname=(a.name?a.name:"");if(wt_ln_attribute!=""){var tmp="";eval("tmp = (a.getAttribute(wt_ln_attribute)?a.getAttribute(wt_ln_attribute):'')");if(tmp)a.lname=tmp;};a.lpos=0;if(!wt_length(a.lpos)&&a.tagName&&a.tagName.toLowerCase()!="area"){c=document.links;for(d=0;d<wt_length(c);d++){if(a==c[d]){a.lpos=d+1;break}}};if(a.lpos){if(wt_ln=="link"){var y=a.href.indexOf("//");var y=(y>=0?a.href.substr(y+2):a.href);if(typeof(wt_linktrack_pattern)!='undefined'){if(typeof(wt_linktrack_replace)!='string')wt_linktrack_replace="";y=y.replace(wt_linktrack_pattern,wt_linktrack_replace);};wt_linktrack_p=wt_be.split(";")[0]+"."+(a.lname?(a.lname+"."):"")+y.split("?")[0].replace(/\//g,".");var p=wt_linktrack_params.replace(/;/g,",").split(",");for(var i=0;i<p.length;i++){var v=wt_urlParam(y,p[i],"");if(v)wt_linktrack_p+="."+p[i]+"."+v;}}else if(wt_ln=="auto"){if(!a.lname)wt_linktrack_p=(wt_linktrack_be?(wt_linktrack_be+"."):(wt_be.split(";")[0]+".link."))+a.lpos;else wt_linktrack_p=wt_be.split(";")[0]+"."+a.lname;}else if(wt_ln=="standard"&&a.lname)wt_linktrack_p=a.lname;if(wt_linktrack_p&&a.target!="")wt_send();}}};var wt_gatherforms_p="";var wt_form=null;var wt_form_focus="";var wt_form_submit=false;if(wt_fm){wt_registerEvent(window,"load",wt_ftinstall);};function wt_ftinstall(){wt_findform();if(!wt_form)return;for(var j=0;j<wt_form.elements.length;j++){var e=wt_form.elements[j];wt_registerEvent(e,"focus",wt_formfocus);};wt_registerEvent(wt_form,"submit",wt_formsubmit);};function wt_findform(){wt_form=null;if(document.forms)wt_form=document.forms[0];var f=document.forms;for(var i=0;i<f.length;i++){var cf=f[i];if(wt_typeof(cf.elements["wt_form"])){wt_form=cf;return;}}};function wt_formsubmit(){wt_form_submit=true;};function wt_formfocus(e){var a=document.all?window.event.srcElement:e.target;if(!a.name||a.type=="submit"||a.type=="image")return;wt_form_focus=(wt_form.name?wt_form.name:wt_be.split(";")[0])+"."+a.name+"."+a.type;};function wt_gatherForm(){var del=";";if(!wt_form)return;var f=wt_form;var p=wt_form.name?wt_form.name:wt_be.split(";")[0];if(wt_fm_attribute){var tmp="";eval("tmp = (f.getAttribute(wt_fm_attribute)?f.getAttribute(wt_fm_attribute):'')");if(tmp)p=tmp;};var fl="";if(wt_typeof(f.elements["wt_fields"]))fl=f.elements["wt_fields"].value;if(!fl){for(var i=0;i<f.elements.length;i++){var e=f.elements[i];if(e.name)fl+=e.name+del;};fl=fl.substring(0,fl.lastIndexOf(del))};var fields=fl.split(del);var fields_length=fields.length;var full_fields=wt_fm_full_content.split(del);var pa="";var emptyradios=new Array();for(var i=0;i<f.elements.length;i++){var e=f.elements[i],value,value2,use=false;if(fl){for(var j=0;j<fields_length;j++)if(e.name==fields[j])use=true;}else{if(e.name)use=true;};if(use){value=null;if(e.type=='select-multiple'){for(var j=0;j<e.options.length;j++){var found=false;if(e.options[j].selected){found=true;pa+=";"+p+".select-multiple."+e.name.replace(/[\.|;]/,"_")+"."+e.options[j].value.replace(/[\.|;]/,"_");};if(!found)value="empty";}};if(e.type=='select-one'){if(e.selectedIndex!=-1){value=e.options[e.selectedIndex].value.replace(/[\.|;]/,"_");if(!value)value="empty";}};if(e.type=='checkbox'){if(!e.checked)value="empty";else value=e.value.replace(/[\.|;]/,"_");};if(e.type=='radio'){if(e.checked)value=e.value.replace(/[\.|;]/,"_");emptyradios[emptyradios.length]=e.name;};if(e.type=="password"||e.type=="text"||e.type=="textarea"){value=(e.value?"filled_out":"empty");for(var k=0;k<full_fields.length;k++)if(full_fields[k]==e.name)value=wt_maxlen(e.value,30);if(!value)value="empty";};if(value){name=e.name.replace(/[\.|;]/,"_");value2=";"+p+"."+name+"."+e.type+"|";if(pa.indexOf(value2)==-1)pa+=value2+(wt_fm_anonymous!=""?"anon":value);}}};for(var i=0;i<emptyradios.length;i++){var n=";"+p+"."+emptyradios[i].replace(/[\.|;]/,"_")+".radio|";if(pa.indexOf(n)==-1)pa+=n+(wt_fm_anonymous!=""?"anon":"empty");};if(pa){pa=pa.substring(1);};return pa;};if(wt_fm||wt_ln){wt_registerEvent(window,(wt_browserNameIE&&wt_typeof(window.onbeforeunload))?"beforeunload":"unload",wt_unload);};function wt_unload(){if(wt_form)wt_gatherforms_p=wt_gatherForm();var p="";if(wt_linktrack_p)p+="&ct="+wt_escape(wt_maxlen(wt_linktrack_p,255));if(wt_gatherforms_p){p+="&ft="+wt_escape(wt_gatherforms_p);p+="&fs="+(wt_form_submit?"1":"0")+"&ff="+wt_escape(wt_form_focus);};if(p){wt_quicksend(wt_escape(wt_be.split(";")[0])+",1,"+wt_baseparams()+p+wt_encoding());wt_linktrack_p="";wt_gatherforms_p="";}};if(typeof(time_start)=="number"&&typeof(wt_be)=="string"&&!document.layers){var time_stop=(new Date()).getTime();wt_registerEvent(window,"load",wt_ttonload);};function wt_ttonload(){if(typeof(time_start)=="number"){wt_t1=time_stop-time_start;var time_stop2=new Date().getTime();wt_t2=time_stop2-time_start;wt_send();time_start="";wt_t1="";wt_t2="";}};if(wt_mc){var m=wt_mc.split(";");wt_mcvalue="";for(var i=0;i<m.length;i++){if(wt_mcvalue!="")wt_mcvalue+="|";wt_mcvalue+=wt_urlParam(wt_href(),m[i],"");}};var wt_tmp=wt_urlParam(wt_href(),"wt_lp","");if(wt_tmp!="")wt_lp=wt_tmp;wt_tmp=wt_urlParam(wt_href(),"wt_kw","");if(wt_tmp!="")wt_kw=wt_tmp;if(wt_hm){var exit=false;if(typeof(wt_heatmap_sites)=='object'&&typeof(wt_heatmap_sites_ini)=='string'){wt_registerEvent(window,"load",wt_hminstall);exit=true;}else{if(!document.layers&&document.getElementById){var stags=document.getElementsByTagName('script');for(var i=0;i<stags.length;i++){if(stags[i].src.match(/webtrekk.*\.js/g)&&!exit){wt_include(wt_hm_config_file=stags[i].src.replace(/webtrekk[a-z|A-Z|0-9|_]*\.js/g,'')+'heatmap_config.js?'+Math.random());wt_registerEvent(window,"load",wt_hminstall);exit=true;}}}}};function wt_hminstall(){if(typeof(wt_heatmap_sites)=='object'&&typeof(wt_heatmap_sites_ini)=='string'){for(var wt_site in wt_heatmap_sites){if(wt_heatmap_sites[wt_site]==wt_escape(wt_be.split(";")[0])&&wt_heatmap_sites_ini==wt_crypt(wt_heatmap_sites.join('')).replace(/\./g,'')&&wt_heatmap_on==false){wt_registerEvent(document,"mousedown",wt_recordClick);}}}else{if(typeof(wt_heatmap_retry)=="undefined")wt_heatmap_retry=0;wt_heatmap_retry++;if(wt_heatmap_retry<60)window.setTimeout("wt_hminstall()",100);}};function wt_recordClick(e){if(typeof(wt_refpoint_id)!='string'){wt_refpoint_id='wt_refpoint';}else{if(wt_refpoint_id==''){wt_refpoint_id='wt_refpoint';}};var isOpera=(navigator.userAgent.indexOf('Opera')!=-1);var isIE=(!isOpera&&navigator.userAgent.indexOf('MSIE')!=-1);var pos={left:-1,top:-1};if(document.getElementById(wt_refpoint_id)){var obj=document.getElementById(wt_refpoint_id);if(typeof obj.offsetLeft!='undefined'){while(obj){pos.left+=obj.offsetLeft;pos.top+=obj.offsetTop;obj=obj.offsetParent;}}};var posx=0;var posy=0;if(!e){var e=window.event;};if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}else if(e.clientX||e.clientY){posx=e.clientX;posy=e.clientY;if(isIE){posx+=document.body.scrollLeft;posy+=document.body.scrollTop;}};var width1=0;if(isIE){width1=document.body.clientWidth;}else{width1=self.innerWidth-16;};var sendPixel=true;if(posx>=width1){sendPixel=false;};if((pos.top>=0||pos.left>=0)&&posx>pos.left&&posy>pos.top){posx='-'+(posx-pos.left);posy='-'+(posy-pos.top);};if(sendPixel)wt_quicksend(wt_escape(wt_be.split(";")[0])+","+posx+","+posy,"hm.pl");};var wt_heatmap_on=(wt_href().indexOf("wt_heatmap=1")>=0);function wt_heatmap0(){if(typeof(wt_heatmap)!="undefined"){window.setTimeout("wt_heatmap()",1000);}else{if(typeof(wt_heatmap_retry)=="undefined")wt_heatmap_retry=0;wt_heatmap_retry++;if(wt_heatmap_retry<60)window.setTimeout("wt_heatmap0()",1000);}};if(wt_href().indexOf("wt_heatmap=0")>=0){wt_heatmap_on=false;};if(wt_heatmap_on){if(wt_reporturl=='')wt_reporturl='report.webtrekk.de/cgi-bin/wt';if(wt_include(location.protocol+"//"+wt_reporturl+"/heatmap.pl?wt_be="+wt_escape(wt_be.split(";")[0])+"&x="+new Date().getTime()+wt_encoding()))if(navigator.userAgent.indexOf('MSIE 6')!=-1&&navigator.userAgent.indexOf('Windows NT 5.0')!=-1){alert("Click OK to start heatmap.");};wt_registerEvent(window,"load",wt_heatmap0);};function wt_overlay0(){if(typeof(wt_overlay)!="undefined")wt_overlay();else{if(typeof(wt_overlay_retry)=="undefined")wt_overlay_retry=0;wt_overlay_retry++;if(wt_overlay_retry<60)window.setTimeout("wt_overlay0()",1000);}};var wt_overlay_on=(wt_href().indexOf("wt_overlay=1")>=0||document.cookie.indexOf("wt_overlay=1")>=0);if(wt_href().indexOf("wt_overlay=0")>=0){wt_overlay_on=false;document.cookie="wt_overlay=0; expires=Thu, 01-Jan-70 00:00:01 GMT;";};if(wt_overlay_on){document.cookie="wt_overlay=1";if(wt_reporturl=='')wt_reporturl='report.webtrekk.de/cgi-bin/wt';if(wt_include(location.protocol+"//"+wt_reporturl+"/overlay.pl?wt_be="+wt_escape(wt_be.split(";")[0])+"&x="+new Date().getTime()+wt_encoding()))wt_registerEvent(window,"load",wt_overlay0);};if(wt_cookie=="1"){var wt_cookie_one=false;var wt_cookie_sid=wt_getCookie("wt_sid");var wt_cookie_l_v=wt_getCookie("wt_l_v");var wt_cookie_eid=wt_getCookie("wt_eid");if(!wt_cookie_eid_timeout)wt_cookie_eid_timeout=60;if(!wt_cookie_sid_timeout)wt_cookie_sid_timeout=30;var tmp=parseInt(wt_cookie_sid);var tmp2=Math.floor(new Date().getTime()/1000);if(tmp>0&&(tmp+wt_cookie_sid_timeout*60)<tmp2)wt_cookie_sid="";if(!wt_cookie_sid){wt_cookie_sid=wt_sid();wt_cookie_one=true;};if(!wt_cookie_eid){wt_cookie_eid=wt_cookie_sid;wt_setCookie("wt_eid",wt_cookie_eid,wt_cookie_eid_timeout*30*24*60);};wt_cookie_l_v=new Date().getTime();wt_setCookie("wt_l_v",wt_cookie_l_v);wt_setCookie("wt_sid",wt_cookie_sid);};function wt_sendinfo(p,mode){if((typeof(time_start)!="number"&&(wt_be!=""||p!=""))||document.layers)wt_send(p,mode);};function wt_quicksend(params,script){if(!wt_dm||!wt_ci)return;if(!script)script="wt.pl";var wt_url=(location.protocol=="https:"?"https:":"http:")+"//"+wt_dm+"/"+wt_ci+"/"+script+"?p="+wt_version+","+params;if(document.images){if(typeof(wt_i)=="undefined")wt_i=new Array();var ii=wt_i.length;wt_i[ii]=new Image();wt_i[ii].src=wt_url;}else{document.write("<img src='"+wt_url+"' height='1' width='1'>");}};function wt_baseparams(){var wt_c=screen.width+"x"+screen.height+","+(navigator.appName!='Netscape'?screen.colorDepth:screen.pixelDepth)+",";wt_c+=((navigator.cookieEnabled==true)?"1,":((navigator.cookieEnabled==false)?"0,":((document.cookie.indexOf("=")!=-1)?"1,":"0,")));wt_c+=new Date().getTime()+",";var wt_ref=0;if(!wt_ref&&document.referrer.length>0)wt_ref=wt_decoder(document.referrer);wt_c+=wt_ref;var h=0;if(!document.layers&&document.getElementById){eval("try {h = top.window.innerHeight;}catch(e){};");}else{h=top.window.innerHeight;};if(!h)eval("try {h = top.document.body.clientHeight;}catch(e){};");if(!h)eval("try {h = top.document.documentElement.clientHeight;}catch(e){};");var w=0;if(!document.layers&&document.getElementById){eval("try {w = top.window.innerWidth;}catch(e){};");}else{w=top.window.innerWidth;};if(!w)eval("try {w = top.document.body.clientWidth;}catch(e){};");if(w=='undefined')w=-1;if(h=='undefined')h=-1;wt_c+=","+w+"x"+h;wt_c+=","+(navigator.javaEnabled()?"1":"0");return wt_c;};function wt_send(p,mode){if(mode=="link"){wt_linktrack_p=p;wt_ln="manual";wt_registerEvent(window,(wt_browserNameIE&&wt_typeof(window.onbeforeunload))?"beforeunload":"unload",wt_unload);return;};if(mode=="click"){wt_linktrack_p=p;wt_unload();return;};var wt_content=(p?p:wt_be);if(!wt_content)wt_content="no_content";var wt_c=wt_escape(wt_content)+",1,";wt_c+=wt_baseparams();wt_c+=wt_encoding();var wt_la="";if(typeof(navigator.language)=="string")wt_la=navigator.language;else if(typeof(navigator.userLanguage)=="string")wt_la=navigator.userLanguage;var wt_len=navigator.plugins.length,wt_np="";if(wt_len>0){var wt_plugs=Array();var wt_np='';for(var i=0;i<wt_len;i++){if(navigator.plugins&&navigator.appName!='Microsoft Internet Explorer'){if(navigator.plugins[i].name=="Shockwave Flash"){wt_np=navigator.plugins[i].description;}else{wt_np=navigator.plugins[i].name;};for(var j in wt_plugs){if(wt_np==wt_plugs[j])wt_np="";};if(wt_np!=""){wt_plugs.push(wt_np);}}};wt_np=wt_plugs.join("|");};if(wt_ov)wt_c+="&ov="+wt_escape(wt_ov);if(wt_cr)wt_c+="&cr="+wt_escape(wt_cr);if(wt_oi)wt_c+="&oi="+wt_escape(wt_oi);if(wt_ba)wt_c+="&ba="+wt_escape(wt_ba);if(wt_co)wt_c+="&co="+wt_escape(wt_co);if(wt_qn)wt_c+="&qn="+wt_escape(wt_qn);if(wt_ca)wt_c+="&ca="+wt_escape(wt_ca);if(wt_pi)wt_c+="&pi="+wt_escape(wt_pi);if(wt_st)wt_c+="&st="+wt_escape(wt_st);if(wt_cd)wt_c+="&cd="+wt_escape(wt_cd);if(wt_t1)wt_c+="&t1="+wt_escape(wt_t1);if(wt_t2)wt_c+="&t2="+wt_escape(wt_t2);if(wt_la)wt_c+="&la="+wt_escape(wt_la);if(wt_cg)wt_c+="&cg="+wt_escape(wt_cg);if(wt_mcvalue)wt_c+="&mcv="+wt_escape(wt_mcvalue);if(wt_length(wt_mcvalue)){wt_c+="&mc="+wt_mc;wt_c+="&mcd="+wt_location().hostname;};if(wt_pa)wt_c+="&pa="+wt_escape(wt_maxlen(wt_pa,255));if(wt_lp)wt_c+="&lp="+wt_escape(wt_maxlen(wt_lp,255));if(wt_kw)wt_c+="&kw="+wt_escape(wt_maxlen(wt_kw,255));if(wt_is)wt_c+="&is="+wt_escape(wt_maxlen(wt_is,255));if(wt_cookie=="1"){wt_c+="&sid="+wt_cookie_sid+"&l_v="+wt_cookie_l_v+"&eid="+wt_cookie_eid+"&one="+(wt_cookie_one?"1":"0");if(wt_cookie_one)wt_c+="&np="+wt_escape(wt_np);}else{wt_c+="&np="+wt_escape(wt_np);};wt_quicksend(wt_c);};
/*
END FROM webtrekk.js
*/


/*
BEGIN FROM windows.js
*/

/* KONSTANTE(N) ************************************************************/

/* vordefinierte site-weite default-gr??en: */
var standardX = 617;
var standardY = 560;
var autoX = 300;2
var autoY = 300;
var helpX = standardX;
var helpY = standardY;
var lexikonX = 450;
var lexikonY = 400;
var lesezeichenX = 450;
var lesezeichenY = 400;
var webmilesX = 400;
var webmilesY = 617;
var schweinigX = 200;
var schweinigY = 150;
var slideshowX = 460;
var slideshowY = 505;
var popupProperties = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";



/* INTERNE HILFSFUNKTION(EN) ***********************************************/

/* getHrefFromA gibt das href-attribut des kompletten a-elements zurueck, */
/* falls ein solches uebergeben worden ist. wenn nicht, dann nicht. */
/* dies macht nur sinn, wenn unser liebes cms nps die links verwaltet */
function getHrefFromA( url ) {
  /* vb: fixme: das ist noch nicht der href, */
  /* sondern einfach das erste doppelt gequotete attribut: */
  url = (url.indexOf( "<a" ) == 0) ? url.split( "\"" )[ 1 ] : url;
  // chl: weil umgeschriebene teaser-links ein "&amp;" enthalten koennen,
  // muss ich das hier wieder wegmachen. sorry.
  while (url.match(/amp;/)) {
    url = url.replace(/amp;/, '');
  }
  return url;
}

/* OEFFENTLICHE FUNKTIONEN ***********+**************************************/

/* URL IM OPENER OEFFNEN ****************************************************/
/* falls kein opener mehr vorhanden ist, wird ein neuer geoeffnet */
function openNewOpener(targetURL) {
  var openerTargetURL = getHrefFromA(targetURL);
  fakeOpener = window.open(openerTargetURL,'fakeOpener');
  fakeOpener.focus();
}
function openInOpener(targetURL) {
  // thl: zeug hier machen wir, damit die sitemap von debitel.ag korrekt auf debitel.de linken kann
  targetURL = getHrefFromA(targetURL);
  //alert(window.location.pathname + " -> "+ targetURL );
  var changeDomain = 0;
  if ((window.location.pathname.search(/^(\/debitel.*)|(\/service.*)/)!=-1) && (targetURL.search(/kunden|privat|business|shop|service/)!=-1)) {
    // chl: expliziten hostnamen entfernt, machte nur aerger
    targetURL = targetURL.replace(/(^(\.\.\/)+)|(^\/)|(^http\/\/.*\/)/, "http://"+window.location.host+"/");
    //alert(window.location.pathname + " -> "+ targetURL );
  }
  if ((window.location.pathname.search(/^(\/service.*)/)!=-1) && (targetURL.search(/kunden|privat|business|shop|service/)!=-1)) {
    changeDomain = 0;
  }
  else if ((window.location.pathname.search(/^(\/debitel.*)/)!=-1) && (targetURL.search(/kunden|privat|business|shop|service/)!=-1))
  {
    changeDomain = 1;
  }
  if (window.opener && (window.opener.closed == false) && (changeDomain == 0) ) {
    // thl: wenn unser opener selbst einen opener(, der selbst einen opener ...) hat
    my_opener = window.opener;
    while (my_opener.opener != null) {
      my_opener = my_opener.opener;
    }
    my_opener.location.href = getHrefFromA(targetURL);
    my_opener.focus();
  }
  else {
    openNewOpener(targetURL);
  }
}

/* windowOpen funktioniert mit 0, 1, 2, 3, 4 parametern: */
/* 0: leere seite (about:blank) mit standard-groesseen */
/* 1: angegebene url (bitte kompletter a-tag) mit standard-groessen */
/* 2: angegebene url (bitte kompletter a-tag) mit anderen standard-groessen */
/* 3: angegebene url (bitte kompletter a-tag) mit den ?bergebenen groessen */
/* 4: angegebene url mit breite und hohe in ein fenster mit speziellem namen */
var popup;
function windowOpen() {
  /* der 1te parameter ist die url */
  url = (windowOpen.arguments.length >= 1) ? getHrefFromA( windowOpen.arguments[ 0 ] ) : "about:blank";
  if (windowOpen.arguments.length==5) url= url + '?var=' + windowOpen.arguments[4];
  /* bei 2 parametern ist der 2te der popup-typ (help, standard) als string */
  type = (windowOpen.arguments.length == 2) ? windowOpen.arguments[ 1 ] : "standard";
  //alert( type );
  /* wer hier was uebergibt, das nicht ueber der funktion definiert ist, ist selber schuld */
  bridth = eval( type + "X" );
  height = eval( type + "Y" );
  /* bei 3 parametern sind der 2te und der 3te die groessenangaben */
  if (windowOpen.arguments.length >= 3 && (windowOpen.arguments[ 1 ]!='' || windowOpen.arguments[ 2 ]!='')) {
    bridth = parseInt( windowOpen.arguments[ 1 ] );
    height = parseInt( windowOpen.arguments[ 2 ] );
    /* vb: fixme: wenn hier muell uebergeben worden ist, dann koennte man standardX und -Y hernehmen */
  }
  /* bei 4 parametern ist der letzte der name des popups, */
  /* um mehrere popups gleichzeitig & unabhaengig voneinander oeffnen und ansprechen zu koennen. */
  popupName = (windowOpen.arguments.length == 4) ? windowOpen.arguments[ 3 ] : "popup";
  eval( 'if (' + popupName + ') { var ' + popupName + '; }' );
  /* jetzt machen wir das fensterl auf */
  popupStr = popupName + ' = window.open( "' + url + '", "' + popupName + '", "' + popupProperties + ',width=' + bridth + ',height=' + height + '" );';
  //if (popup) alert( "popup gibts" );
  if (eval( popupName )) {
    //alert( popupName + " gibts schon" );
    if (eval( popupName + '.closed' )) {
      /* vb: fixme: ns6 scheint mir diesen fall nicht zu checken */
      eval( popupStr );
    } else {
      /* vb: fixme: hier heisst das fenster noch einfach immer popup */
      /* aber ich glaub, er kommt hier nie an (s.u.) */
      popup.location.href = url;
      popup.resizeTo( bridth, height );
      popup.focus();
    }
  } else {
    /* vb: fixme: durch das eval da oben scheint immer dieser fall zuzutreffen: */
    eval( popupStr );
    eval( popupName + ".focus();" );
    /* vb: fixme: wenn ein fenster mit dem gleichen namen und neuen groesseen gew?nscht ist, */
    /* dann sollte ich nicht nur reload und focus, sondern auch einen resize machen. */
  }
}

/* windowOpener laedt die seite im fenster, das dich aufgemacht hat */
function windowOpener( url ) {
  if (window.opener) window.opener.location.href = getHrefFromA( url );
}

/* windowPrint oeffnet den dialog zum drucken, wenn moeglich: */
function windowPrint() {
  if (window.print) {
    window.print();
  } 
}
/*
END FROM windowsjs
*/
