function highlight_info01(a)
{
  if (a) document.getElementById('info01').src="images/button_info_gross_02.png";
  else document.getElementById('info01').src="images/button_info_gross_01.png";
}

function highlight_weiter(element,zustand)
{
  if (zustand) document.getElementById(element).src="images/button_weiter_02.png";
  else document.getElementById(element).src="images/button_weiter_01.png";
}

function highlight_download(element,zustand)
{
  if (zustand) document.getElementById(element).src="images/button_download_02.png";
  else document.getElementById(element).src="images/button_download_01.png";
}

function highlight_abonnieren(element,zustand)
{
  if (zustand) document.getElementById(element).src="images/button_abonnieren_02.png";
  else document.getElementById(element).src="images/button_abonnieren_01.png";
}

function highlight_starten(element,zustand)
{
  if (zustand) document.getElementById(element).src="images/button_starten_02.png";
  else document.getElementById(element).src="images/button_starten_01.png";
}

function highlight_pfeil_r(element,zustand)
{
  if (zustand) document.getElementById(element).src="images/button_pfeil_r2.png";
  else document.getElementById(element).src="images/button_pfeil_r1.png";
}

function highlight_pfeil_l(element,zustand)
{
  if (zustand) document.getElementById(element).src="images/button_pfeil_l2.png";
  else document.getElementById(element).src="images/button_pfeil_l1.png";
}


function highlight_plus(element,hover)
{
  aktuell = document.getElementById(element).src;
  punkt = aktuell.lastIndexOf(".");
  if (punkt == -1) return;
  
  ext = aktuell.substr(punkt);
  neu = aktuell.substring(0,punkt);
  if (hover) {
    neu = neu + "_hover" + ext;
  }
  else {
    neu = neu.replace("_hover", "") + ext;  
  }
  document.getElementById(element).src = neu;
}

function highlight_zurueck01(a)
{
  if (a) document.getElementById('zurueck01').src="images/button_zurueck_02.png";
  else document.getElementById('zurueck01').src="images/button_zurueck_01.png";
}

function highlight_oben(a)
{
  if (a) document.getElementById('oben').src="images/pfeil_oben_02.png";
  else document.getElementById('oben').src="images/pfeil_oben_01.png";
}

function NachOben ()
{
  var y = 0;
  if (window.pageYOffset)
  {
    y = window.pageYOffset;
  }
  else if (document.body && document.body.scrollTop)
  {
    y = document.body.scrollTop;
  }
  if (y > 0)
  {
    window.scrollBy(0, -10);
    setTimeout("NachOben()", 10);
  }
}

function swapBox(von, nach)
{
  a = document.getElementById(von);
  a.style.display = 'none';
  b = document.getElementById(nach);
  b.style.display = 'block';
}

function swapSummary(id)
{
  a = document.getElementById(id + "_kurz");
  b = document.getElementById(id + "_lang");
  i = document.getElementById(id + "_icon");

  if (a.style.display == 'block')
  {
    a.style.display = 'none';
    b.style.display = 'block';
    i.src = 'images/minus.png';
  }
  else
  {
    a.style.display = 'block';
    b.style.display = 'none';
    i.src = 'images/plus.png';
  }
}

function openscreenshot(Adresse,Titel,Breite,Hoehe)
{
  Fenstername="a"+Math.round(Math.random()*100+1);
  Url = 'screenshot.php?titel='+Titel+'&adresse='+Adresse;
  Fenster1 = window.open(Url, Fenstername, "width="+Breite+",height="+Hoehe+",left=50,top=150,dependent=yes");
  Fenster1.focus();
}

function prepareprint(page)
{
  fenstername="a"+Math.round(Math.random()*100+1);
  url = 'index.php?mode=print&page=' + page;
  Fenster1 = window.open(url, fenstername, "width=700,height=700,left=50,top=150,dependent=yes,scrollbars=yes,menubar=yes");
  Fenster1.focus();
}

function angehakt(id)
{
  a = document.getElementById(id + "_ausblenden");
  b = document.getElementById(id + "_anzeigen");

  if (a.style.display == 'block')
  {
    a.style.display = 'none';
    b.style.display = 'block';
  }
  else
  {
    a.style.display = 'block';
    b.style.display = 'none';
  }
}

function checkEmail(id)
{
  if (document.getElementById(id).value == "")
  {
    alert("Bitte geben Sie Ihre Email-Adresse ein!");
    return false;
  }
}


function swapPanel(id)
{
  a = document.getElementById(id);
  b = document.getElementById(id + "_open");
  
  if (a.style.display == 'none')
  {
    a.style.display = 'block';
    b.style.display = 'none';
  }
  else
  {
    a.style.display = 'none';
    b.style.display = 'block';
  }
}


function selectTab(tabcontrol,id)
{
  a = document.getElementById(tabcontrol);
  var knoten = a.firstChild;
  while (knoten != null) {
    if (knoten.nodeType == 1) {
      if (knoten.id==id) {
        knoten.setAttribute("class", "active");
        knoten.setAttribute("className", "active");
      }
      else {
        knoten.setAttribute("class", "inactive");
        knoten.setAttribute("className", "inactive");
      }
      
      b = document.getElementById(knoten.id + '_content');
      if (b) {
        if (knoten.id==id) {
          b.style.display = 'block';
        }
        else {
          b.style.display = 'none';
        }
      }
    }
    knoten = knoten.nextSibling;
  }
  
}

function produktvergleich (spalte,zustand)
{
  a = document.getElementById(spalte);
  b = document.getElementById('breite');

  var t = String(b.style.width);
  var breite = parseInt(t);
  if (zustand==true)
  {
    a.style.display = 'block';
    breite = breite+100;
  }
  else
  {
    a.style.display = 'none';
    breite = breite-100;
  }
  b.style.width = breite+'px';
}
