var warned = 0;
function setCookie(name,value){
	var cookieText=name+"="+escape(value);
	var expires=new Date();

	expires.setTime(expires.getTime()+365*24*60*60*1000);
	cookieText=cookieText+"; expires="+expires.toGMTString();

	document.cookie=cookieText;

	if (getCookie(name) != value &&
		warned == 0)
	{
		warned = 1;
		alert("You must have cookies enabled to use this feature.");
	}

}

function getCookie(name){
	var cookieText=document.cookie;
	var cookieName=name+"=";
	var start=cookieText.indexOf(cookieName);
	if (start==-1){
	return null;
	}
	var end=document.cookie.indexOf(";",start);
	if (end==-1){
	end=cookieText.length;
	}
	return unescape(cookieText.substring(start+cookieName.length,end));
}

function deleteCookie(name){
	if (getCookie(name)){
	document.cookie=name+"="+"; expires=0";
	}
}

function setSheet(value)
{
	setCookie("sheet", value);
	window.location.reload(true);
	return false;
}

var sheet = getCookie("sheet");

if (sheet != null)
{
	document.write("<LINK REL=\"stylesheet\" HREF=\"");
	document.write(sheet);
	document.write("\">");
}

