function get_cookie(name) {
  var index = document.cookie.indexOf(name + "=");
  if (index == -1) return "normal";
  index = document.cookie.indexOf("=", index) + 1;
  var endstr = document.cookie.indexOf(";", index);
  if (endstr == -1) endstr = document.cookie.length;
  return unescape(document.cookie.substring(index, endstr));
}

// Document.write doesn't work with application/xhtml+xml, and this trick
// doesn't work with text/html... /perf
function include_css(file)
{
  var l = document.createElementNS("http://www.w3.org/1999/xhtml", "link");
  l.setAttribute("rel", "stylesheet");
  l.setAttribute("type", "text/css");
  l.setAttribute("href", file);
  l.setAttribute("media", "screen");
  document.getElementsByTagName("head")[0].appendChild(l);
}

include_css("/LoTwebb/luwebb/style/ddg_contrast_" + get_cookie("ui_contrast") + ".css");
