jQuery.noConflict(); jQuery(document).ready(function($) { function createCookie(name,value,days){ if (days){ var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name){ var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++){ var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name){ createCookie(name,"",-1); } /** * Styleswitch stylesheet switcher built on jQuery * Under an Attribution, Share Alike License * By Kelvin Luck ( http://www.kelvinluck.com/ ) **/ (function($){ $(document).ready(function(){ /*$('.styleswitch').click(function(){ //console.info(this.getAttribute("rel")); switchStylestyle(this.getAttribute("rel")); return false; });*/ var c = readCookie('seasonCSS'); if (c){ } else { var month = ['normal.css','normal.css','normal.css','normal.css','normal.css','normal.css','normal.css','normal.css','normal.css','normal.css','normal.css','normal.css']; var jetzt = new Date(); var jetztMonat = jetzt.getMonth(); c = month[jetztMonat] createCookie('seasonCSS', c, 0); } //if (c) switchStylestyle(c); }); /*function switchStylestyle(styleName){ $('link[@rel*=style][title]').each(function(i){ this.disabled = true; if (this.getAttribute('title') == styleName) this.disabled = false; }); createCookie('seasonCSS', styleName, 0); }*/ })(jQuery); }); // ************************************************************* // JahresZeitenWechsler fixed by McRich // ************************************************************* function setActiveStyleSheet(title) { /* var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } */ var styleTag; var styleSwitch; var styleHref=''; for(var i=0; (styleTag = document.getElementsByTagName("link")[i]); i++) { if(styleTag.getAttribute("title")=="switch") { styleSwitch=styleTag; } if(styleTag.getAttribute("rel").indexOf("alternate stylesheet")!=-1 && styleTag.getAttribute("title")) { if(styleTag.getAttribute("title")==title) { styleHref=styleTag.getAttribute("href"); } } } if(styleSwitch != undefined){ if (styleSwitch.getAttribute("href") != styleHref && styleHref != '') { styleSwitch.setAttribute("href",styleHref); } } if(title != '') { createCookieS("style", title, 365); } return false; } 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; */ var styleTag; var styleSwitch; var styleTitle=''; for(var i=0; (styleTag = document.getElementsByTagName("link")[i]); i++) { if(styleTag.getAttribute("title")=="switch") { styleSwitch=styleTag; } } for(var i=0; (styleTag = document.getElementsByTagName("link")[i]); i++) { if(styleTag.getAttribute("rel").indexOf("alternate stylesheet")!=-1 && styleTag.getAttribute("title")) { if(styleTag.getAttribute("href")==styleSwitch.getAttribute("href")) { styleTitle=styleTag.getAttribute("title"); } } } return styleTitle; } 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 createCookieS(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); }else{ expires = ""; } document.cookie = name+"="+value+expires+"; path=/"; } function readCookieS(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' '){ c = c.substring(1,c.length); } if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); } } return null; } window.onload = function(e) { var cookie = readCookieS("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title); } window.onunload = function(e) { var title = getActiveStyleSheet(); createCookieS("style", title, 365); } var cookie = readCookieS("style"); var title = cookie ? cookie : getPreferredStyleSheet(); setActiveStyleSheet(title);