//
// Subtitle ein und ausblenden
//

function show_hide_content(elem) {
  if (document.all) {  // IE
var this_div = elem.srcElement;
  } else {
var this_div = this;
  }

  var arr_all_divs = document.getElementsByTagName('div');
  for (var int_counter = 0; int_counter < arr_all_divs.length; int_counter++) {
if (arr_all_divs[int_counter] == this_div) {
  next_div = arr_all_divs[int_counter + 1];
}
  }

  if (next_div.style.display != 'block') {
this_div.firstChild.data = 'Info aus';
this_div.style.background   = '#00CCCC';
this_div.style.color   = '#000000';
next_div.style.display   = 'block';
  } else {
this_div.firstChild.data = 'Info ein';
this_div.style.background   = '#00008B';
this_div.style.color   = '#ffffff';
next_div.style.display   = 'none';
  }
}

function event_init() {
  var arr_all_divs = document.getElementsByTagName('div');
  for (var int_counter = 0; int_counter < arr_all_divs.length; int_counter++) {
if (arr_all_divs[int_counter].className == 'toggleLink') {
  if (arr_all_divs[int_counter].addEventListener) {
arr_all_divs[int_counter].addEventListener('click', show_hide_content, false);
  } else if (arr_all_divs[int_counter].attachEvent) {
arr_all_divs[int_counter].attachEvent('onclick', show_hide_content);
  }
}
if (arr_all_divs[int_counter].className == 'toggleContent') {
  arr_all_divs[int_counter].style.display = 'none';
}
  }
}





// MainButton Funktion alles öffnen, alles schließen

function openAll() {
  var arr_all_divs = document.getElementsByTagName('div');
  for (var int_counter = 0; int_counter < arr_all_divs.length; int_counter++) {
if (arr_all_divs[int_counter].className == 'toggleLink') {
  if (arr_all_divs[int_counter].addEventListener) {
arr_all_divs[int_counter].addEventListener('click', show_hide_content, false);
  } else if (arr_all_divs[int_counter].attachEvent) {
arr_all_divs[int_counter].attachEvent('onclick', show_hide_content);
  }
}
if (arr_all_divs[int_counter].className == 'toggleContent') {
  arr_all_divs[int_counter].style.display = 'block';
}
if (arr_all_divs[int_counter].className == 'toggleLink') {
  arr_all_divs[int_counter].style.background = '#00CCCC';
}
if (arr_all_divs[int_counter].className == 'toggleLink') {
  arr_all_divs[int_counter].style.color = '#000000';
}
if (arr_all_divs[int_counter].className == 'toggleLink') {
  arr_all_divs[int_counter].firstChild.data = 'Info aus';
}
  }
}



function closeAll() {
  var arr_all_divs = document.getElementsByTagName('div');
  for (var int_counter = 0; int_counter < arr_all_divs.length; int_counter++) {
if (arr_all_divs[int_counter].className == 'toggleLink') {
  if (arr_all_divs[int_counter].addEventListener) {
arr_all_divs[int_counter].addEventListener('click', show_hide_content, false);
  } else if (arr_all_divs[int_counter].attachEvent) {
arr_all_divs[int_counter].attachEvent('onclick', show_hide_content);
  }
}
if (arr_all_divs[int_counter].className == 'toggleContent') {
  arr_all_divs[int_counter].style.display = 'none';
}

if (arr_all_divs[int_counter].className == 'toggleLink') {
  arr_all_divs[int_counter].style.background = '#00008B';
}
if (arr_all_divs[int_counter].className == 'toggleLink') {
  arr_all_divs[int_counter].style.color = '#FFFFFF';
}
if (arr_all_divs[int_counter].className == 'toggleLink') {
  arr_all_divs[int_counter].firstChild.data = 'Info ein';
}
  }
}


// Button Layout Steuerung

var Buttons = document.getElementsByName("Button");	
var Active = "";

function CheckButton(Num) {
	if (Active != "" && Active != Num) {
	Buttons[Active].style.backgroundColor = "#00008B";
	}
	Buttons[Num].style.backgroundColor = "#00CCCC";
	Active = Num;

}
