function setActiveStyleSheet(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);
      }
    }
  }
}

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;
}

function getCookieVal() {
	var cookie = cookieManager.getCookie("style");
	var title = cookie ? cookie : getPreferredStyleSheet();
	return title;
}

function changeActiveStyleSheet() {
	if(getCookieVal() == "plus") {
		setActiveStyleSheet('minus');
	} else {
		setActiveStyleSheet('plus');
	}
}

function setFontSizeLinkText() {
	var label = document.getElementById("fontSize");
	var minus="<img src=\"fileadmin/js/ugos/minus.png\" border=\"0\" align=\"right\">";
	var plus="<img src=\"fileadmin/js/ugos/plus.png\" border=\"0\" align=\"right\">";

	if(label != null) {
		if(getCookieVal() == "plus") {
			document.getElementById("fontSize").innerHTML = minus;


		} else {
			//document.getElementById("fontSize").childNodes[0].nodeValue = plus;
			document.getElementById("fontSize").innerHTML = plus;
		}
	}
}

