function showContent(name, tabname){
    showHideTabContents(name);
    showHideTabs(tabname);
}

function showHideTabs(tabname) {
    tabdiv = document.getElementById('tab');
    for(i=0; i<tabdiv.childNodes.length; i++) {
        tn = tabdiv.childNodes[i]; 
        if (tn.nodeName == "LI") {
            a = tn.firstChild;
            classn = (a.getAttribute('id') == tabname) ? 'show' : 'dontshow';
            bg = (a.getAttribute('id') == tabname) ? '#c2be4a' : '#efeded';
            a.className =  classn;
            a.style.background=bg;
        }
    }
}

function showHideTabContents(name) {
    cdiv = document.getElementById('tabcontents');
    for(i=0; i<cdiv.childNodes.length; i++) {
        cn = cdiv.childNodes[i];
        if (cn.nodeName == "DIV" && cn.getAttribute('id') != "tabverlauf" 
            && cn.getAttribute('id')!="verlauf") {
            isit = (cn.getAttribute('id') == name ) ? true : false;
            cn.style.display = (isit) ? 'block' : 'none';
            cn.style.visibility = (isit) ? 'visible' : 'hidden';
        }
    }
    return; 
} 

function hoverTab(tabname,st) {
    tabdiv = document.getElementById('tab');
    for(i=0; i<tabdiv.childNodes.length; i++) {
        tn = tabdiv.childNodes[i]; 
        if (tn.nodeName == "LI") {
            a = tn.firstChild;
            bg = (a.getAttribute('id') == tabname && st==1 ) ? '#c2be4a' : '#efeded';
            if (a.className!='show') {
                a.style.background = bg;
            }
        }
    }
   
}

function showC(name, tabname){
       var c = document.getElementById('tab').childNodes.length;
       for(var i = 1;i <= c; i++) {

               document.getElementById('div' + i).className = '';
               document.getElementById('contentdiv' + i).style.display = "none";
       }

       document.getElementById(name).style.display = "block";
       document.getElementById(tabname).className = 'show';

       return false;
}
