(function (window) {	"use strict";	var thisEvent, thisFunction;	thisEvent = (window.addEventListener) ? "load" : "onload";	thisFunction = (GWD_Styleswitcher);	if (window.addEventListener) {		window.addEventListener(thisEvent, thisFunction, false);	} else if (window.attachEvent) {		window.attachEvent(thisEvent, thisFunction);	}}(window));function GWD_Styleswitcher(style) {	var Styleswitcher = {		cookie : null,		title : null,		init : function() {			window.styleTemp = new StyleswitcherSettings("none", "none", "none");			this.cookie = this.readCookie("style");			this.title = this.cookie ? this.cookie : this.getPreferredStyleSheet();			styleTemp.save = this.title;			styleTemp.use = this.title;			styleTemp.current = this.title;			this.setActiveStyleSheet(this.title);		},		readCookie : function(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;		},		getPreferredStyleSheet : function() {			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;		},		setActiveStyleSheet : function(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;				}			}			styleTemp.current = this.getActiveStyleSheet();		},		getActiveStyleSheet : function() {			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;		},		createCookie : function(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=/";		}	};	if (typeof style === "string") {		switch (style) {		case "use":			styleTemp.use = styleTemp.current;			break;		case "save":			styleTemp.use = styleTemp.current;			styleTemp.save = styleTemp.current;			Styleswitcher.createCookie("style", styleTemp.save, 365);			break;		case "cancel":			if (styleTemp.current !== styleTemp.use) {				Styleswitcher.setActiveStyleSheet(styleTemp.use);			}			break;		default:			Styleswitcher.setActiveStyleSheet(style);			break;		}	} else {		Styleswitcher.init();	}}function StyleswitcherSettings (saved, in_use, changed) {	this.save = saved;	this.use = in_use;	this.current = changed;}
