/* Saemtliche Rechte: Aktion Mensch - Einfach fuer Alle */
/* Lizenzbedingungen zur freien Nutzung: http://www.einfachfueralle.de/lizenz/ */

function setActiveStyleSheet(title) {
   if(title=="1") title = document.styleswitch.style_auswahl.options[document.styleswitch.style_auswahl.selectedIndex].value;
   else title = title;
   status = title;
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel") && a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) {
	a.disabled = false;
	cookieManager.setCookie("style", title, 365);
      }
    }
  }
  return false;
}

function init(){
	setActiveStyleSheet(title);
	document.styleswitch.style_auswahl.value = title;
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

var cookie = cookieManager.getCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);


function shop_opener() {
window.open('http://www.vzbv.de/shop/start/','shop','menubar=yes,toolbar=yes,scrollbars=yes,width=1000,height=580,resizable=1');
        }

function slk_opener(adr) {
window.open(adr,'slk','toolbar=yes,scrollbars=no,width=800,height=550');
        }

function slk_opener2(adr) {
window.open(adr,'slk','toolbar=yes,scrollbars=yes,width=800,height=550');
        }