<!-- + + + + + + + + + + + + + + + + + + + + + Steuerung der Darstellung + + + + + + + + + + + + + + + + + + + + + -->
function setActiveStyleSheet(title) {
	var i, a;
	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;
				styleSwitch.setCookie("styleSwitch", 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");
	 //alert("getActiveStylesheet wird ausgeführt\n a.getAttribute(title) = " + a.getAttribute("title"));
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
	 //alert("getPreferredStyleSheet() wird ausgeführt");
	 if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title")) return a.getAttribute("title");
  }
  return null;
}

var cookie = styleSwitch.getCookie("styleSwitch");
//alert("get Cookie aus change!\n Cookie = " + cookie);
var title = cookie ? cookie : getPreferredStyleSheet();
//alert("Title aus change!\n Title = " + title);
setActiveStyleSheet(title);
