function ConfiguraEstilo(sTitulo)
{
  var nInd, vLink = document.getElementsByTagName("link");
  for (nInd = 0; nInd <= vLink.length-1 ; nInd++)
  {
    if (vLink[nInd].getAttribute("rel").indexOf("stylesheet") != -1 &&
        vLink[nInd].getAttribute("title"))
    {
      vLink[nInd].disabled = true;
      if(vLink[nInd].getAttribute("title") == sTitulo)
        vLink[nInd].disabled = false;
    }
  }
  GravaCookie("EstiloSite", sTitulo);
}

function GravaCookie(sNome,sValor)
{
  document.cookie = sNome+"="+sValor;
}

function LeCookie(sNome)
{
  var sValor = null;
  var sCookie = document.cookie;
  var nInicio = sCookie.indexOf(sNome);
  if (nInicio != -1)
    sValor = unescape(sCookie.substring(sCookie.indexOf("=",nInicio)+1,sCookie.length));
  return sValor;
}

var sCookie = LeCookie("EstiloSite");
var sTitulo = (sCookie ? sCookie : "Primeiro");
ConfiguraEstilo(sTitulo);