function cookie_getValue(pos) { var end = document.cookie.indexOf(";", pos); if (end == -1) { end = document.cookie.length; } return unescape(document.cookie.substring(pos, end)); } function cookie_get(name) { name += "="; var length = name.length; var cookieLength = document.cookie.length; var i = 0; while (i < cookieLength) { var j = i + length; if (document.cookie.substring(i, j) == name) { return cookie_getValue(j); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) { break; } } return null; } function cookie_set(name, value) { var exp = new Date(); exp.setTime(exp.getTime() + (300 * 24 * 60 * 60 * 1000)); document.cookie = name + "=" + escape (value) + "; expires=" + exp.toGMTString() + "; path=/"; } function cookie_delete(name) { var exp = new Date(); exp.setTime (exp.getTime() - 1); var value = cookie_get(name); if (value != null) { document.cookie = name + "=" + value + "; expires=" + exp.toGMTString(); } } function openPrintview(url) { var width = 800; var height = 700; var left = (screen.width) ? (screen.width-width)/2 : 0; var top = (screen.height) ? (screen.height-height)/2 : 0; if(window.screenLeft) { left = left + window.screenLeft; } ref = window.open(url, 'print', "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width="+width+",height="+height+",top="+top+",left="+left); ref.focus(); return false; } // /////////////////////////////// // CSS-Swich Konfiguration // /////////////////////////////// var cssswitcher_style = "fontsize_norm"; var cssswitcher_cookie = "usercss"; var cssswitcher_cookie_days = 30; // /////////////////////////////// // Style Switcher // /////////////////////////////// // /////////////////////////////// // Style Switcher // /////////////////////////////// function switchStyle(style) { if (!document.getElementsByTagName) { return; } var elems = document.getElementsByTagName("link"); for (var i = 0; i < elems.length; i++ ) { if (elems[i].getAttribute("rel").indexOf("style") != -1 && elems[i].getAttribute("title")) { elems[i].disabled = true; if (elems[i].getAttribute("title") == style) { elems[i].disabled = false; } } } } function loadStyle() { var cs = getStyleCookie(); if (cs && cs != cssswitcher_style) { switchStyle(cs); cssswitcher_style = cs; } markCssSwitcher(cssswitcher_style, cs); } function setStyle(style) { if (style != cssswitcher_style) { switchStyle(style); //if(document.getElementById('cssSwitcher') != null) { markCssSwitcher(cssswitcher_style, style); //} cssswitcher_style = style; } } function setStyleCookie() { cookie_set(cssswitcher_cookie, cssswitcher_style, cssswitcher_cookie_days); } function getStyleCookie() { return cookie_get(cssswitcher_cookie); } function delStyleCookie() { cookie_delete(cssswitcher_cookie); } function userSetStylesheet(style) { setStyle(style); setStyleCookie(); } function changeStylesheet(style) { userSetStylesheet(style); location.href = 'start.htm'; } function markCssSwitcher(oldStyle, newStyle) { /* if(document.getElementById('cssSwitcher') != null) { document.getElementById(oldStyle).className = 'cssSwitchLink'; document.getElementById(newStyle).className = 'cssSwitchLinkActive'; } */ } window.onload = loadStyle;