function chooseStyle (newstyle){
	var expdate = new Date();
	expdate.setTime(expdate.getTime()+(1000*3600*24*365));
	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") == '/includes/switch/style'+newstyle+'.css') a.disabled = false;
			}
		}
	} else {
		self.location = self.location;
	}
}

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 expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
