styleswitcher = {
	chooseStyle: function(newstyle) {
		var expdate = new Date();
		expdate.setTime(expdate.getTime()+(1000*3600*24*365));
		styleswitcher.createCookie('style', newstyle, 365);
		// alert('This style choice will persist for a year unless changed again.\nYou may need to reload the page.');
		if (document.getElementById) {
			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("href") == '/stylesheets/switch/'+newstyle+'.css') a.disabled = false;
				}
			}
		} else {
			self.location = self.location;
		}
	},

	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=/";
	}
}