function SetStyle(pTitle)
{
  var ss = document.styleSheets;

  if (pTitle == null)
  	pTitle = 'blue';

  for (var i = 0; i < ss.length; i++)
  {
    if (ss[i].title != '')
      ss[i].disabled = (ss[i].title.toLowerCase() != pTitle.toLowerCase());
    else
      ss[i].disabled = (pTitle == '$none');
  }

  setCookie('style', pTitle);
}

function CookieStyle()
{
  if (getCookie('style') != '')
    SetStyle(getCookie('style'));
}

var path = '';
function setCookie(name, value)
{
    document.cookie= name + "=" + escape(value) +
        ((path) ? "; path=" + path : "");
}

function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

document.onload = CookieStyle();
