
































// START DART-Variablen setzen HEAD
var adlWallPaperTop=0;
var adlWallPaperLeft=796;
// ENDE  DART-Variablen setzen HEAD

// START Browserweich und CSS angleichung im HEAD
var ua = navigator.userAgent;
var suche=ua.lastIndexOf(")");
if (ua.substring(suche+2, suche+8) == "Safari") {
  document.write("<link rel='stylesheet' href='/css/fz_safari.css' type='text/css'>"); 
}            

var ua = navigator.userAgent;
if (ua.substring(0, 5) == "Opera") {
  document.write("<link rel='stylesheet' href='/css/fz_opera.css' type='text/css'>"); 
}            
// ENDE Browserweich und CSS angleichung im HEAD

// START Content-Boxen ein/aus klappen
 function onOff (number) {  
            var a = new Date();
            a.setMonth(a.getMonth()+3);        
            box = 'box' + number; 
            pfeil ='pfeil' + number;
            if(document.getElementById(box).style.visibility=='hidden')   {
                    document.getElementById(pfeil).src='/pics/pfeil-auf.gif';
                    document.getElementById(pfeil).alt='Ausblenden';
                    document.getElementById(box).style.height='auto';
                    document.getElementById(box).style.visibility='visible';
                    document.getElementById(box).style.display='block';
                    document.cookie = box + '_' + RessortID + '_' + window.location.host + '=visible; expires=' + a.toGMTString(); 
            }
            else 
            {
                    document.getElementById(pfeil).src='/pics/pfeil-zu.gif';
                    document.getElementById(pfeil).alt='Einblenden';
                    document.getElementById(box).style.height=0;
                    document.getElementById(box).style.visibility='hidden';
                    document.getElementById(box).style.display = 'none';
                    document.cookie = box + '_' + RessortID + '_' + window.location.host + '=hidden; expires=' + a.toGMTString();
            }  
 }   
 
function changeArrowMouseover (pfeil) {  
    if (document.getElementById(pfeil).src=="http://" + window.location.host+"/pics/pfeil-auf.gif") {
        document.getElementById(pfeil).src="/pics/pfeil-auf-invers.gif";
    }
    else {
        document.getElementById(pfeil).src="/pics/pfeil-zu-invers.gif";
    } 
}

function changeArrowMouseout (pfeil) {
    if ((document.getElementById(pfeil).src=="http://" + window.location.host+"/pics/pfeil-auf-invers.gif") || (document.getElementById(pfeil).src=="http://" + window.location.host+"/pics/pfeil-auf.gif")) {
        document.getElementById(pfeil).src="/pics/pfeil-auf.gif";
    }
    else {
        document.getElementById(pfeil).src="/pics/pfeil-zu.gif";
    }
}
// ENDE  Content-Boxen ein/aus klappen

// START Content-Raiter-Boxen
// Initialisierung in der Rechten Navigation mittels
// init_tabnavieboxen_content.tpl
function getChildElementsByClassName(parentElement, className)
{
    var i, childElements, pattern, result;
    result = new Array();
    pattern = new RegExp("\\b"+className+"\\b");


    childElements = parentElement.getElementsByTagName('*');
    for(i = 0; i < childElements.length; i++)
    {
        if(childElements[i].className.search(pattern) != -1)
        {
            result[result.length] = childElements[i];
        }
    }
    return result;
}
 
function BuildTabs(containerId)
{
    var i, tabContainer, tabContents, tabHeading, title, tabElement;
    var divElement, ulElement, liElement, tabLink, linkText;


    // assume that if document.getElementById exists, then this will work...
    if(! eval('document.getElementById') ) return;

    tabContainer = document.getElementById(containerId);
    if(tabContainer == null)
        return;

    tabContents = getChildElementsByClassName(tabContainer, 'tab-content');
    if(tabContents.length == 0)
        return;

    divElement = document.createElement("div");
      divElement.className = 'tab-header'
      divElement.id = containerId + '-header';
    ulElement = document.createElement("ul");
      ulElement.className = 'tab-list'

    tabContainer.insertBefore(divElement, tabContents[0]);
    divElement.appendChild(ulElement);

    for(i = 0; i < tabContents.length; i++)
    {
        tabHeading = getChildElementsByClassName(tabContents[i], 'tab');
        title = tabHeading[0].childNodes[0].nodeValue;

        // create the tabs as an unsigned list
        liElement = document.createElement("li");
        liElement.id = containerId + '-tab-' + i;

        tabLink = document.createElement("a");
        linkText = document.createTextNode(title);

        tabLink.className = "tab-item";

        tabLink.setAttribute("href","javascript://");
        tabLink.setAttribute( "title", tabHeading[0].getAttribute("title"));
        tabLink.onclick = new Function ("ActivateTab('" + containerId + "', " + i + ")");

        ulElement.appendChild(liElement);
        liElement.appendChild(tabLink);
        tabLink.appendChild(linkText);

        // remove the H1
        tabContents[i].removeChild
    }
}

function ActivateTab(containerId, activeTabIndex)
{
    var i, tabContainer, tabContents; 
    tabContainer = document.getElementById(containerId);
    if(tabContainer == null) {
        return;
    }
    tabContents = getChildElementsByClassName(tabContainer, 'tab-content');
    if(tabContents.length > 0)
    {
        for(i = 0; i < tabContents.length; i++)
        {
            //tabContents[i].className = "tab-content";
            tabContents[i].style.display = "none";
        }
        tabContents[activeTabIndex].style.display = "block";
        tabList = document.getElementById(containerId + '-list');
        tabs = getChildElementsByClassName(tabContainer, 'tab-item');
        if(tabs.length > 0)
        {
            for(i = 0; i < tabs.length; i++)
            {
                tabs[i].className = "tab-item";
            } 
            tabs[activeTabIndex].className = "tab-item tab-active";
            tabs[activeTabIndex].blur();
        }
    }
}
// ENDE  Content-Raiter-Boxen  


// START moleds
function moleds()
{
  if(document.getElementById)
  {
    s = document.getElementById('ledsTop_4_sub');
    p = document.getElementById('main');    
    y = 7;
    if(p.offsetTop  )
    {
      y = y+p.offsetTop  ;
    } 
    s.style.display = 'block';
    s.style.visibility = 'visible';
    s.style.position = 'absolute';  
    s.style.top= y;   
    window.setTimeout('mc()',3000);
  }
}
// ENDE  moleds 

// START mc
function mc(z)
{
  s = document.getElementById('ledsTop_4_sub');
  if(s)
  {
    s.style.display = 'none';
    s.style.visibility = 'hidden';
  }
}
// ENDE  mc
 
// START Bildgröessenberechnung inkl. Proportionen-Erhaltung 
function makethumb(arid,number)
{
  var mynumber = number;
  var divcontainer='bild_'+arid;
  var cssausgabe="";
  var gef = "nein";   
  if(document.getElementById(divcontainer))
  {
    var thumbbig = document.getElementById(divcontainer);
    if(thumbbig.getElementsByTagName("img").length!=0)
    {    
      var orig_breite=thumbbig.getElementsByTagName("img")[0].width;
      var orig_hoehe=thumbbig.getElementsByTagName("img")[0].height;
      var s = thumbbig.getElementsByTagName("img")[0].src;      
      if (orig_breite < 1) {
        var tmp = new Image(); tmp.src = s;
        if($j.browser.msie) while(!tmp.complete) tmp.src = s; 
        orig_breite=tmp.width;
        orig_hoehe=tmp.height;
      }  
    } 
     if (orig_breite > orig_hoehe) {
          cssausgabe='#'+divcontainer+' img { height:auto !important; width:'+mynumber+'px !important;}';  
     }
     else {
          cssausgabe='#'+divcontainer+' img { width:auto !important;height:'+mynumber+'px !important;}';  
     }  
   } 
  return(cssausgabe+"\n") ;
}
  
function bildgroesse2(arid,breite,hoehe)
{   
  var divcontainer='bild_'+arid;   
  var thumbbig = document.getElementById(divcontainer);
  var img = thumbbig.getElementsByTagName("img")[0];
  var s = img.getAttribute("src");
  var tmp = new Image(); tmp.src = s;
  if($j.browser.msie) while(!tmp.complete) tmp.src = s; 
  var w = Math.round(tmp.width);
  var h = Math.round(tmp.height);  
  if(h > w) {
    img.setAttribute("height",hoehe);
    img.removeAttribute("width");
  } else {
    img.setAttribute("width",breite);
    img.removeAttribute("height");
  }
  return true;  
  if(document.getElementById(divcontainer))
  {
    var thumbbig = document.getElementById(divcontainer);
    if(thumbbig.getElementsByTagName("img").length!=0)
    {
    
      var orig_breite=thumbbig.getElementsByTagName("img")[0].getAttribute("width");
      var orig_hoehe=thumbbig.getElementsByTagName("img")[0].getAttribute("height");
      if(orig_breite==0)
      {
        var borigurl=thumbbig.getElementsByTagName("img")[0].src;
        bild = new Image();
        bild.src = borigurl;
        orig_breite = bild.width;
        orig_hoehe = bild.height;
      }
      document.write('<!-- divcontainer:'+divcontainer+'; orig-b:'+orig_breite+'; orig-h:'+orig_hoehe+'; b/h:'+orig_breite/orig_hoehe+'<br /> -->');
      var borigcheck1=orig_breite;   
      var umrechnercheck1=breite/borigcheck1;
      var horigcheck1=orig_hoehe;
      var hneucheck1=horigcheck1*umrechnercheck1;
      hneucheck=parseInt(hneucheck1);
      var horigcheck2=orig_hoehe;
      var umrechnercheck2=hoehe/horigcheck2;
      var borigcheck2=orig_breite;
      var bneucheck2=borigcheck2*umrechnercheck2;
      bneucheck=parseInt(bneucheck2);  
      if ((!isNaN(hneucheck)) || (!isNaN(bneucheck)))
      {                          
        if(hneucheck<=hoehe)
        {
          document.write('<!-- divcontainer:'+divcontainer+'; orig-b:'+orig_breite+'; orig-h:'+orig_hoehe+'; b/h:'+orig_breite/orig_hoehe+'<br /> -->');
          var horig=orig_hoehe;
          var umrechner=hoehe/horig;
          var borig=orig_breite;
          var bneu=borig*umrechner;
          bneu=parseInt(bneu);   
          var left = (bneu-breite) / 2; 
          var cssausgabe='<style> #'+divcontainer+' img { width:'+bneu+'px; height:'+hoehe+'px;} </style>';
          document.write(cssausgabe);
          document.write('<!-- 1 divcontainer:'+divcontainer+'; neue-b:'+bneu+'; neue-h:'+hoehe+'; b/h:'+bneu/hoehe+'<br /> -->');
        }
        else
        {
          document.write('<!-- divcontainer:'+divcontainer+'; orig-b:'+orig_breite+'; orig-h:'+orig_hoehe+'; b/h:'+orig_breite/orig_hoehe+'<br /> -->');
          var borig=orig_breite;
          var umrechner=breite/borig;
          var horig=orig_hoehe;
          var hneu=horig*umrechner;
          hneu=parseInt(hneu);
          var top = (hneu-hoehe) / 2;
          var cssausgabe2='<style> #'+divcontainer+' img { width:'+breite+'px !important; height:'+hneu+'px  !important} </style>';
          document.write(cssausgabe2);
          document.write('<!-- 2 divcontainer:'+divcontainer+'; neue-b:'+breite+'; neue-h:'+hneu+'; b/h:'+breite/hneu+'<br /> -->');
        }
      }
      else
      {
      }
      return(cssausgabe);
    }
  }
}

//ALT
function bildgroesse(arid,anpassung,groesse)
{
}
// ENDE Bildgröessenberechnung inkl. Proportionen-Erhaltung 

// START Browsercheck
function browserok() {   
    var UA = navigator.userAgent;
    var ua = UA.split(";");
    var v = null; 
    if($j.browser.msie) {
        v = parseInt( ua[1].replace(/MSIE/,"") );
        if( v < 7 ) return false;
    }  
    if($j.browser.opera) {
        v = parseInt(navigator.appVersion);
        if( v < 9 ) return false;
    }  
    if(UA.indexOf("Firefox") != -1) {
        var ffver = ua[ua.length-1].split("/");
        v = parseInt( ffver[ffver.length-1] );
        if( v < 2 ) return false;
    }   
    if($j.browser.safari) {
        var sver = ua[ua.length-1].split("/"); 
        v = parseInt( sver[sver.length-1] );
        if( v < 419 ) return false;
    }   
    return true; 
}

function browsercheck() {  
    if(!browserok()&&document.cookie.indexOf("browsercheckpopup=shown")==-1) {
        window.open("/browsercheck/?_FRAME=33","browsercheck","width=590,height=342");
        document.cookie = "browsercheckpopup=shown";
    } 
}
// ENDE  Browsercheck

// START Cookie-Funktionen
function bilder_des_tages() {
    var bdt = document.getElementsByName("bilder_des_tages");
    for(a=0;a<bdt.length;a++) 
    {  
        var bdti = bdt[a].getElementsByTagName("img")[0];
        bdt[a].setAttribute("onclick","");
        bdt[a].setAttribute("target","");
        bdt[a].setAttribute("onmouseover","");
        bdt[a].setAttribute("href", bdt[a].getAttribute("href")+"&_FRAME=33&keepThis=true&TB_iframe=true&height=440&width=786&scrolling=no");
        bdti.style.height="90px"; bdti.style.width="90px";
    }
}

function getCookies() {
    var arg = getCookies.arguments, filter = false, dc = document.cookie.split(";"), cookies = new Array();
    if(arg.length==1) filter = arg[0];
    
    for(i=0; i<dc.length; i++) {
        var cookie = dc[i].split("=");
        
        if( !filter || (filter.length && cookie[0].indexOf(filter) > -1) ) {
             cookies[ cookie[0] ] = cookie[1];        
        }
    }
    
    return cookies;
}

function loadBoxes() {
    var dc = getCookies("_"+RessortID+"_"+window.location.host);
    
    if(dc.length) { // wenn cookies für boxen existieren, klappe diese auf
        for(c in dc) {                                     
            var a = c.split("_"), box = a[0], pfeil = a[0].replace(/box/,"pfeil");
                
            with(document.getElementById(box)) {
                style.height = (dc[c] == "visible" ? "auto" : 0);
                style.visibility = (dc[c] == "visible" ? "visible" : "hidden");
                style.display = (dc[c] == "visible" ? "block" : "none");
            }
            with(document.getElementById(pfeil)) {
                alt = (dc[c] == "visible" ? "Ausblenden" : "Einblenden");
                src = (dc[c] == "visible" ? "/pics/pfeil-zu.gif" : "/pics/pfeil-auf.gif");
            }                  
        }
    } else { // ansonsten klappe alle boxen auf
        var divs = document.getElementsByTagName("div");
        
        for(i=0; i<divs.length; i++) {
            var div = divs[i];
        
            if(div.getAttribute("id") && div.getAttribute("id").indexOf("box") > -1) {
                with(div) {
                    style.height = "auto";
                    style.visibility = "visible";
                    style.display = "block";
                }                                    
            }
        }
        var pfeile = document.getElementsByTagName("img");
        
        for(i=0; i<pfeile.length; i++) {
            var pfeil = pfeile[i];
            
            if(pfeil.getAttribute("id") && pfeil.getAttribute("id").indexOf("pfeil") > -1) {
                with(pfeil) {                      
                    alt = "Ausblenden";
                    src = "/pics/pfeil-auf.gif";                
                }
            }
        }
    }
}

function getContent() {
    loadBoxes();
    placePager();
    bilder_des_tages();
    document.body.style.visibility='visible';
    tb_onload();
    browsercheck();
}

function getContent0() {       

var DC = document.cookie;  

if(DC.indexOf("box") != -1) {                 

//alert('COOCKIE DAAAAA     '+document.cookie);

    var a = ' ' + document.cookie;
    var boxes = new Array();
    var boxID = 1;
    while (document.getElementById('box' + boxID))  {
        boxes[boxID + '_' + RessortID] = 'visible';
        ++boxID;
    }
    while (a.length > 0) {
        var tmpName =  a.substring(1,a.indexOf('='));
        if  (a.indexOf(';') != -1) {
            var tmpValue = a.substring(a.indexOf('=')+1,a.indexOf(';'));  
        }
        else {
            var tmpValue = a.substring(a.indexOf('=')+1,a.length);  
        }
        if (tmpName.indexOf('box') != -1 && tmpName.indexOf('_'+RessortID) != -1 && tmpName.indexOf('_'+window.location.host)) {     // nur Cookies des aktuellen Ressorts auf aktuellem Host berücksichtigen
            boxes[tmpName.substring(3,tmpName.length)] = tmpValue; 
        }
        if (a.indexOf(';') > 0) {
            a = a.substring(a.indexOf(';')+1,a.length);
        }
        else {
            a = '';
        }
    }

        for (b in boxes) {
            i = b.substring(0,b.indexOf('_'));
            
            if(document.getElementById('box' + i) != null)  { 
                if (boxes[b] == 'hidden') {             
                    document.getElementById('box' + i).style.height=0;
                    document.getElementById('box' + i).style.visibility='hidden';
                       document.getElementById('box' + i).style.display = 'none';
                    if(document.getElementById('pfeil' + i) != null) {
                        document.getElementById('pfeil' + i).src='/pics/pfeil-zu.gif';
                        document.getElementById('pfeil' + i).alt='Einblenden';
                    }
                } else {  
                    document.getElementById('box' + i).style.height='auto';
                    document.getElementById('box' + i).style.visibility='visible';
                    document.getElementById('box' + i).style.display = 'block';
                    if(document.getElementById('pfeil' + i) != null) {
                        document.getElementById('pfeil' + i).src='/pics/pfeil-auf.gif';
                        document.getElementById('pfeil' + i).alt='Ausblenden';
                    }
                }
            }
        }
 }
 else
 {         
  // wenn kein Cookie da ist, alle boxen anzeigen
  //alert('KEIN COOKIE'); 
    for (i=1; i<30; ++i) {
        if (document.getElementById('box' + i)) { 
                 document.getElementById('box' + i).style.height='auto';
                 document.getElementById('box' + i).style.visibility='visible';
            document.getElementById('box' + i).style.display = 'block';

                 if(document.getElementById('pfeil' + i) != null) {
                    document.getElementById('pfeil' + i).src='/pics/pfeil-auf.gif';
                    document.getElementById('pfeil' + i).alt='Ausblenden';
                 }
        }    
    }
 }

placePager();
document.body.style.visibility='visible';
 
 }


function listPages (pagerName) { 
  i=1;
  brb = ""; 
  while (document.getElementById(pagerName + i))
  {  
    brb = brb + "<a href=javascript:showPage('" + pagerName + "'," + i + "); onClick='this.blur();' class='submenu_na'>" + i + "</a>&nbsp;|&nbsp;";
    i++;
  }  
  i--;
  brb ="<a href=javascript:goBack('" + pagerName + "'," + i + "); onClick='this.blur();'><img border='0' src='/pics/pfeil-left.gif' id='seitezahl' style='margin-left:140px;'></a>&nbsp;&nbsp;"
    + brb.substring(0,brb.length-7)+ "&nbsp;"
    + "<a href=javascript:goForward('" + pagerName + "',"  + i + "); onClick='this.blur();'><img border='0' src='/pics/pfeil-right.gif' id='seitezahl'></a>&nbsp &nbsp"; 
  return brb;
}  

function listPagesHighlights (pagerName)
{
    i=1;
    brb = "";   
    while (document.getElementById(pagerName + i))
    {
        brb = brb + "<a href=javascript:showPageHighlights('" + pagerName + "'," + i + "); onClick='this.blur();' class='submenu_na'>" + i + "</a>&nbsp;|&nbsp;";
        i++;
    }  
    i--;
    brb ="<a href=javascript:goBackHighlights('" + pagerName + "'," + i + "); onClick='this.blur();'><img border='0' src='/pics/pfeil-left.gif' id='seitezahl' style='margin-left:140px;'></a>&nbsp;&nbsp;"
        + brb.substring(0,brb.length-7)+ "&nbsp;"
        + "<a href=javascript:goForwardHighlights('" + pagerName + "'," + i + "); onClick='this.blur();'><img border='0' src='/pics/pfeil-right.gif' id='seitezahl'></a>&nbsp &nbsp"; 
    return brb;
}

//placePager()
//setzt alle Pager an die richtigen Stelle auf der Seite  
function placePager() {  
  for (i=1; i<10; i++) {
    if (document.getElementById('pagelist' + i)) { 
        var pos = findPos(document.getElementById('box' + i));
        var top =  pos[3]-30;
        document.getElementById('pagelist' + i).style.top = "-" + top + "px"; 
        document.getElementById('pagelist' + i).style.left = -60 + "px";
        document.getElementById('pagelist' + i).style.visibility ='visible';
        document.getElementById('pagelist' + i).style.display = "block";  
    } 
  }     
}        

//findPosition(obj)
//@obj = HTML-Objekt
//gibt die Position des Elements in der Seite zurück  
function findPos(obj) {
    var curleft = curtop = curwidth = curheight = 0;
    if (obj.offsetParent) {
        curleft = obj.offsetLeft
        curtop = obj.offsetTop
        curwidth= obj.offsetWidth
        curheight= obj.offsetHeight
        while (obj = obj.offsetParent) {
            curleft += obj.offsetLeft
            curtop += obj.offsetTop
        }
    }
    return [curtop,curleft,curwidth,curheight];
} 

function test () {  
  alert ('TEST');  
}
// ENDE  Cookie-Funktionen

// START Zoomcss
// configuration
var maxFontSize = 16;
var minFontSize = 10;
var standardFontSize = 12;
var actualFontSize = standardFontSize;
/* functions */
function cssChangeStandard() {
    document.getElementById("content_left").style.fontSize = ""+standardFontSize+"px";
}

function cssChangeBigger() {
    if(actualFontSize<maxFontSize) {
        actualFontSize++;
    }
    document.getElementById("content_left").style.fontSize = ""+actualFontSize+"px";   
}

function cssChangeSmaller() {
    if(actualFontSize>minFontSize) {
        actualFontSize--;
    }
    document.getElementById("content_left").style.fontSize = ""+actualFontSize+"px"; 
}
// ENDE  Zoomcss 

// START ftvpopup
function ftvlaunch(video,quality,pid) {
  if (pid == "hazeuro2008") pid="fuldaereuro2008";
  if (pid == "haz") pid="fuldaer";
  var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
  var TopPosition = (screen.height) ? (screen.height-430)/2 : 0;
  var popwin = window.open('http://www.zoomin.tv/videoplayer/index.cfm?id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid,'MTV6_window','toolbar=no,width=665,height=430,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
  popwin.focus();
}

//Tour de France 2005 video player launch:
function tourlaunchNL(video,quality,pid,langid) {
      var LeftPosition = (screen.width) ? (screen.width-648)/2 : 0;
      var TopPosition = (screen.height) ? (screen.height-460)/2 : 0;
      var popwin = window.open('http://www.zoomin.tv/tourdefrance2005/videoplayer/index.cfm?id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid + '&lang='+ langid,'MTV6_window','toolbar=no,width=648,height=460,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}

function tourlaunch(video,quality,pid,langid) {
    switch(langid)
    {
        case "1":
            tourlaunchNL(video,quality,pid,"NL");
            break;
        case "2":
            tourlaunchBE(video,quality,pid,"BE");
            break;
    }
}

function tourlaunchBE(video,quality,pid,langid) {
      var LeftPosition = (screen.width) ? (screen.width-665)/2 : 0;
      var TopPosition = (screen.height) ? (screen.height-457)/2 : 0;
      var popwin = window.open('http://www.zoomin.tv/tourdefrance2005/videoplayer/index.cfm?fuseaction=homebe&id='+video+'&mode=normal&quality='+ quality +'&pid='+ pid + '&lang='+ langid,'MTV7_window','toolbar=no,width=665,height=457,top='+TopPosition+',left='+LeftPosition+',directories=no,status=no,statusbar=0,scrollbars=no,resizable=no,menubar=no');
      popwin.focus();
}
// ENDE  ftvpopup 

// START x

// ENDE  x


