// JavaScript-Funktionen e-Shop

function TabFarbe()
{
  if(document.getElementById)
  {
  var tabelle,zeilen,i;
  tabelle=document.getElementById("tab");
  zeilen=tabelle.getElementsByTagName("col");
  	for(i=0;i<zeilen.length;i++)
    {
      if(i % 2 == 0)zeilen[i].style.backgroundColor="#FFC";
      else zeilen[i].style.backgroundColor="#CCC";
    }
  }
}


// Fensterhoehe ermitteln

function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}

// Elementhoehe setzen -> Fusszeile am unteren Fensterrand platziert

function setHoehe() {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var inhaltElement = document.getElementById('innen');
var inhaltHeight = inhaltElement.offsetHeight;
if (windowHeight - (inhaltHeight + 134) >= 0) {
inhaltElement.style.height = (windowHeight - 134) + 'px';
}
}
}

//onload-Events

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

//Event-Handler

addLoadEvent(setHoehe);

window.onresize = function () {
setHoehe();
}
