function useSheet(pName) {
  var theLinks = document.getElementsByTagName("link");

  for (var i = 0; i < theLinks.length; i++) {
    var theElement = theLinks[i];
    var theRel = theElement.getAttribute("rel");
    if (/stylesheet/.test(theRel)) {
      theElement.disabled = true;
      if (theElement.getAttribute("title") == pName) {
        theElement.disabled = false;
      }
    }
  }
}

function changeStyle(pIndex) {
  // remember choice
  setCookie("style", pIndex);

  // reload page
  history.go(0);
}

function getStyle() {
  var theStyle = getCookie("style");

  if (theStyle == null) {
    theStyle = 1;
  } else {
    theStyle = parseInt(theStyle);
  }

  return theStyle;
}

var theStyle = getStyle();

switch (theStyle) {
  case 0 :
    {
      useSheet("");
    }; break;
  case 1 :
    {
      useSheet("default");
    }; break;
  case 2 :
    {
      useSheet("bamboo");
    }; break;
}
