function check_all(){
var alldiv = document.getElementsByTagName('div');
var divhead = [];
var divbody = [];
kennung = navigator.userAgent.toLowerCase();
for (var i=0; i<alldiv.length; i++) {
    if(typeof(alldiv[i].getAttribute) == 'function' || kennung.search(/msie 8.0/) != -1){
        class_text = alldiv[i].getAttribute('class');
    }else{
        class_text = alldiv[i].attributes('class').nodeValue;
    }
    if((class_text == 'acc_head') || (class_text == 'acc_head2')  || (class_text == 'acc_head3')){
        divhead.push(alldiv[i]);
    }
    if((class_text == 'acc_body') || (class_text == 'acc_body2')){
        divbody.push(alldiv[i]);
    }
}
for (i=0; i<divhead.length; i++) {
    if(typeof(divhead[i].getAttribute) == 'function' || kennung.search(/msie 8.0/) != -1){
        class_text = divhead[i].getAttribute('class');
        if((class_text == 'acc_head') || (class_text == 'acc_head3')){
            divhead[i].setAttribute('class', 'acc_head2');
            divbody[i].style.visibility = 'hidden';
            divbody[i].style.height = '0';
        }else if(class_text == 'acc_head2'){
            if(divbody[i].innerHTML.length != 0){
            divhead[i].setAttribute('class', 'acc_head');
            divbody[i].style.visibility = 'visible';
            divbody[i].style.height = '100%';
            }else{
               divhead[i].setAttribute('class', 'acc_head3');
            }
        }
    }else{
        class_text = divhead[i].attributes('class').nodeValue;
        if((class_text == 'acc_head') || (class_text == 'acc_head3')){
            divhead[i].attributes('class').nodeValue = 'acc_head2';
            divbody[i].style.visibility = 'hidden';
            divbody[i].style.height = '0';
        }else if(class_text == 'acc_head2'){
            if(divbody[i].innerHTML.length != 0){
            divhead[i].attributes('class').nodeValue = 'acc_head';
            divbody[i].style.visibility = 'visible';
            divbody[i].style.height = '100%';
            }else{
               divhead[i].attributes('class').nodeValue = 'acc_head3';
            }
        }
    }
}
}

function click_head(cnt){
var alldiv = document.getElementsByTagName('div');
var divhead = [];
var divbody = [];
for (var i=0; i<alldiv.length; i++) {
    if(typeof(alldiv[i].getAttribute) == 'function' || kennung.search(/msie 8.0/) != -1){
        class_text = alldiv[i].getAttribute('class');
    }else{
        class_text = alldiv[i].attributes('class').nodeValue;
    }
    if((class_text == 'acc_head') || (class_text == 'acc_head2') || (class_text == 'acc_head3')){
        divhead.push(alldiv[i]);
    }
    if((class_text == 'acc_body') || (class_text == 'acc_body2')){
        divbody.push(alldiv[i]);
    }
}
if(divhead[cnt] != null){
    if(typeof(divhead[cnt].getAttribute) == 'function' || kennung.search(/msie 8.0/) != -1){
        class_text = divhead[cnt].getAttribute('class');
        if((class_text == 'acc_head') || (class_text == 'acc_head3')){
            divhead[cnt].setAttribute('class', 'acc_head2');
            divbody[cnt].setAttribute('class', 'acc_body');
            divbody[cnt].style.visibility = 'hidden';
            divbody[cnt].style.height = '0';
        }else if(class_text == 'acc_head2'){
            if(divbody[cnt].innerHTML.length != 0){
            divhead[cnt].setAttribute('class', 'acc_head');
            divbody[cnt].setAttribute('class', 'acc_body');
            divbody[cnt].style.visibility = 'visible';
            divbody[cnt].style.height = '100%';
            }else{
               divhead[cnt].setAttribute('class', 'acc_head3');
               divbody[cnt].setAttribute('class', 'acc_body2');
            }
        }
    }else{
        class_text = divhead[cnt].attributes('class').nodeValue;
        if((class_text == 'acc_head') || (class_text == 'acc_head3')){
            divhead[cnt].attributes('class').nodeValue = 'acc_head2';
            divbody[cnt].attributes('class').nodeValue = 'acc_body';
            divbody[cnt].style.visibility = 'hidden';
            divbody[cnt].style.height = '0';
        }else if(class_text == 'acc_head2'){
            if(divbody[cnt].innerHTML.length != 0){
            divhead[cnt].attributes('class').nodeValue = 'acc_head';
            divbody[cnt].attributes('class').nodeValue = 'acc_body';
            divbody[cnt].style.visibility = 'visible';
            divbody[cnt].style.height = '100%';
            }else{
               divhead[cnt].attributes('class').nodeValue = 'acc_head3';
               divbody[cnt].attributes('class').nodeValue = 'acc_body2';
            }
        }
    }

}
}


function hide_all(){
var alldiv = document.getElementsByTagName('div');
var divhead = [];
var divbody = [];
for (var i=0; i<alldiv.length; i++) {
    if((alldiv[i].getAttribute('class') == 'acc_head') || (alldiv[i].getAttribute('class') == 'acc_head2') || (alldiv[i].getAttribute('class') == 'acc_head3')){
        divhead.push(alldiv[i]);
    }
    if((alldiv[i].getAttribute('class') == 'acc_body') || (alldiv[i].getAttribute('class') == 'acc_body2')){
        divbody.push(alldiv[i]);
    }
}
for(i=0; i<divhead.length; i++){
   divhead[i].setAttribute('class', 'acc_head2');
    divbody[i].setAttribute('class', 'acc_body');
    divbody[i].style.visibility = 'hidden';
    divbody[i].style.height = '0';
}
}

function hide_except(acc_name,acc_sub){
var alldiv = document.getElementsByTagName('div');
var divhead = [];
var divbody = [];
for (var i=0; i<alldiv.length; i++) {
    if((alldiv[i].getAttribute('class') == 'acc_head') || (alldiv[i].getAttribute('class') == 'acc_head2') || (alldiv[i].getAttribute('class') == 'acc_head3')){
        divhead.push(alldiv[i]);
    }
    if((alldiv[i].getAttribute('class') == 'acc_body') || (alldiv[i].getAttribute('class') == 'acc_body2')){
        divbody.push(alldiv[i]);
    }
}
for(i=0; i<divhead.length; i++){
   if(divhead[i].innerHTML.toUpperCase() != acc_name.toUpperCase()){
    divhead[i].setAttribute('class', 'acc_head2');
    divbody[i].setAttribute('class', 'acc_body');
    divbody[i].style.visibility = 'hidden';
    divbody[i].style.height = '0';
   }else{
    var textdiv = divbody[i].getElementsByTagName('div');
    for(j=0; j<textdiv.length; j++){
        if(textdiv[j].innerHTML.toUpperCase() == acc_sub.toUpperCase()){textdiv[j].style.background = 'gray';}
    }
    if(divbody[i].innerHTML.length != 0){
    divhead[i].setAttribute('class', 'acc_head');
    divbody[i].setAttribute('class', 'acc_body');
    divbody[i].style.visibility = 'visible';
    divbody[i].style.height = '100%';
    }else{
       divhead[i].setAttribute('class', 'acc_head3');
       divbody[i].setAttribute('class', 'acc_body2');
    }
   }
}
}


