function fontSmall () {
  for (var i = 0; i < document.getElementsByTagName("body").length; i++) {
    document.getElementsByTagName("body")[i].style.fontSize = "11px";
  }
  for (var i = 0; i < document.getElementsByTagName("h1").length; i++) {
    document.getElementsByTagName("h1")[i].style.fontSize = "14px";
    document.getElementsByTagName("h1")[i].style.fontWeight = "bold";
  }
  for (var i = 0; i < document.getElementsByTagName("h2").length; i++) {
    document.getElementsByTagName("h2")[i].style.fontSize = "12px";
  }
  for (var i = 0; i < document.getElementsByTagName("h3").length; i++) {
    document.getElementsByTagName("h3")[i].style.fontSize = "11px";
  }
}

function fontMedium () {
  for (var i = 0; i < document.getElementsByTagName("body").length; i++) {
    document.getElementsByTagName("body")[i].style.fontSize = "12px";
  }
  for (var i = 0; i < document.getElementsByTagName("h1").length; i++) {
    document.getElementsByTagName("h1")[i].style.fontSize = "18px";
    document.getElementsByTagName("h1")[i].style.fontWeight = "normal";
  }
  for (var i = 0; i < document.getElementsByTagName("h2").length; i++) {
    document.getElementsByTagName("h2")[i].style.fontSize = "14px";
  }
  for (var i = 0; i < document.getElementsByTagName("h3").length; i++) {
    document.getElementsByTagName("h3")[i].style.fontSize = "12px";
  }
}

function fontLarge () {
  for (var i = 0; i < document.getElementsByTagName("body").length; i++) {
    document.getElementsByTagName("body")[i].style.fontSize = "14px";
  }
  for (var i = 0; i < document.getElementsByTagName("h1").length; i++) {
    document.getElementsByTagName("h1")[i].style.fontSize = "24px";
    document.getElementsByTagName("h1")[i].style.fontWeight = "normal";
  }
  for (var i = 0; i < document.getElementsByTagName("h2").length; i++) {
    document.getElementsByTagName("h2")[i].style.fontSize = "18px";
  }
  for (var i = 0; i < document.getElementsByTagName("h3").length; i++) {
    document.getElementsByTagName("h3")[i].style.fontSize = "14px";
  }
}

// Startseite setzen im IE >=5
function setStartseite(which, angebot) {
  var IE5 = (document.getElementById ? true : false);
  if ((navigator.appName == "Microsoft Internet Explorer") && (IE5) && (navigator.platform != "MacPPC")) {
    which.style.behavior='url(#default#homepage)';
    which.setHomePage("http://www." + angebot + ".de");
    
    return false;
  } else {
    alert("Diese Funktion funktioniert nur mit Internet Explorer ab Version 5.x unter Windows!");
    return false;
  }
}

// open link in new window
function openExtWin (url) {
 extWin = window.open(url, '_blank', "scrollbars=yes,location=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes,dependent=no");
 extWin.focus();
}

// quick search form
function OnSubmitForm(){
 if(document.quick_search.avsearchtypx[0].checked == true) {
   document.quick_search.action ="http://www.mz-web.de/servlet/ContentServer";
 } else if(document.quick_search.avsearchtypx[1].checked == true) {
   document.quick_search.action ="http://www.mz-web.de/archiv/articleSearch.html";
   document.quick_search.article.value =document.quick_search.avsearchwhat.value;
 }
 return true;
}

function formHandler(form) {
  var url = form.url.options[form.url.selectedIndex].value;
  if (url != "") {
    if (url.indexOf("http") > 0) {
      openExtWin(url.slice(4));
    } else {
      window.location.href = url;
    }
  }
}

// show/hide the horizontal menu
var elements = new Array();
var timerOn = new Array();
var timerOff = new Array();
function ShowHead(id, isOver){
  if( isOver ){
    elements[id].firstChild.className = "mehr_spalte_delay_hover";
  } else {
    elements[id].firstChild.className = "mehr_spalte_delay";
  }
}
// show/hide the horizontal menu with delay
function changeHeadLayer(element, id, isOver){
  elements[id] = element;
//  elements[id].firstChild.className = "mehr_spalte_delay";
  if( isOver ){
    timerOn[id] = window.setTimeout( "ShowHead(" + id + "," + isOver + ")", 400);
    window.clearTimeout(timerOff[id]);
  } else {
    timerOff[id] = window.setTimeout( "ShowHead(" + id + "," + isOver + ")", 400);
    window.clearTimeout(timerOn[id]);
  }
}

// change the top 3 articles with delay
var changeTimer;
function doChange(topID){
  document.getElementById('topentry_' + topID ).style.display='block';
  document.getElementById('topentry_' + ((topID + 1) % 3) ).style.display='none';
  document.getElementById('topentry_' + ((topID + 2) % 3) ).style.display='none';
}
// change the top 3 articles with delay
function changeTop(topID, isOver){
  if( isOver ){
    changeTimer = window.setTimeout( "doChange(" + topID + ")", 300);
  } else {
    window.clearTimeout( changeTimer );    
  }
}


  function showArticleComments( URL ){
    //erstellen des requests
    var req = null;
    try{
      req = new XMLHttpRequest();
    }
    catch (ms){
      try{
        req = new ActiveXObject("Msxml2.XMLHTTP");
      } 
      catch (nonms){
        try{
          req = new ActiveXObject("Microsoft.XMLHTTP");
        } 
        catch (failed){
          req = null;
        }
      }  
    }
    if (req != null){
      //anfrage erstellen (GET, url ist localhost,
      //request ist asynchron      
      req.open("GET", URL, true);

      //Beim abschliessen des request wird diese Funktion ausgeführt
      req.onreadystatechange = function(){            
        switch(req.readyState) {
          case 4:
            if(req.status==200) {
              //schreibe die antwort in den div container mit der id content 
              document.getElementById('artikelkommentare').innerHTML = req.responseText;
            }
            break;
          default:
            try{
              if(req.status==404) {
                req.abort();
              }
            } 
            catch (failed){
            }
        }
      };
  
      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      req.send(null);
    }  
  }

  

function ajax( targetURL, callbackFnc ){
    //erstellen des requests
    var req = null;
    try{
      req = new XMLHttpRequest();
    }
    catch (ms){
      try{
        req = new ActiveXObject("Msxml2.XMLHTTP");
      } 
      catch (nonms){
        try{
          req = new ActiveXObject("Microsoft.XMLHTTP");
        } 
        catch (failed){
          req = null;
        }
      }  
    }
    if (req != null){
      //anfrage erstellen (GET, url ist localhost,
      //request ist asynchron      
      req.open("GET", targetURL, true);

      //Beim abschliessen des request wird diese Funktion ausgeführt
      req.onreadystatechange = function(){            
        switch(req.readyState) {
          case 4:
            if(req.status==200) {
              callbackFnc( req );
            }
            break;
          default:
            try{
              if(req.status==404) {
                req.abort();
              }
            } 
            catch (failed){
            }
        }
      };
  
      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      req.send(null);
    }  
}

// do nothing, only count the request
function countClicksCallback( req ){
  //schreibe die antwort in den div container mit der id content 
  //document.getElementById('artikelkommentare').innerHTML = req.responseText;
}

