<!--

/* Highlight Just The Essentials -
   Include justess.js and justess.css in your
   document and highlight essential text by giving
   it the style of #justess

   (c) 2002-4 Simon Huggins - http://www.simonhuggins.com
*/

var justess_on = getFromCookie("just_the_essentials",false)=="true"?false:true;
flipEssentials();

function flipEssentials() {
  document.styleSheets[0].disabled=!(justess_on=!justess_on);
  saveToCookie("just_the_essentials",justess_on,6);
  writeEssentials();
}

function writeEssentials() {
  var ess=(document.getElementById("#essentials"));
  if (ess) {
    var onoroff = justess_on?"OFF":"ON";
    ess.innerHTML=
      "<a href='javascript:flipEssentials();' "+
      "title='JUST THE ESSENTIALS: Click here to turn "+onoroff+
      " the highlighting of key phrases on this web site'>"+
      "Click here to turn <i>Just The Essentials</i> "+
      onoroff+"</a>";
    return;
  }
}

function getFromCookie(itemName,defName) {
  var cookies=document.cookie.split("; "); var result = "";
  for (i=0; i<cookies.length; i++) {
    thisCookie=cookies[i].split("=");
    if (itemName == thisCookie[0]) return thisCookie[1];
  }
  return defName;
}

function saveToCookie(itemName,str,months) {
  var dt= new Date(); dt.setMonth(dt.getMonth()+months);
  document.cookie = itemName+"="+str+";expires="+dt.toGMTString();
}

// -->

