/*
 * Copyright 2003-2004, Peter Rowntree. All Rights Reserved.
 * http://www.hdyn.com/wr/common/contact.php?addr=pr
 */
 
//IF cookies.js is included THEN OKCookies() will be called

function getBrowserLink(feature)
{
   return "A free open-source browser with "
      +feature
      +" can be found at "
      +"<a href='http://www.mozilla.org'>mozilla.org</a>";
}

//comment out anything not needed
function missingThings(level)
{
   var things="";
   if(typeof(OKCookies) != "undefined" && !OKCookies())
      things+="<li>enabled cookies (check your preferences)</li>";
   if(level < 1)
      return things;
   if(typeof(document.getElementById) == "undefined")
      things+="<li>JavaScript:document.getElementById (Level 1 DOM)</li>";
   if(level < 2)
      return things;
   if(typeof(decodeURIComponent) == "undefined")
      things+="<li>JavaScript:decodeURIComponent (JavaScript - 1.5)</li>";
   if(typeof(encodeURI) == "undefined")
      things+="<li>JavaScript:encodeURI (JavaScript - 1.5)</li>";
   //don't do flash test; use doFlashTest
   return things;
}

//returns true if nothing is missing
//arg[0] = level (default = 2 (JS 1.5))
function doMissingThings()
{
   var level=(arguments.length < 1 ? 2 : arguments[0]);
   var mt=missingThings(level);
   if(mt == '')
      return true;
   document.writeln(
      "<p class='errorHead'>This Browser Lacks Some Necessary Functionality.</p>"
      +"<div class='error1'>"
      +"This website requires the following missing features."
      +"<ul style='color: mediumvioletred' >"+mt+"</ul>"
      +getBrowserLink('the required functionality')
      +"</div>");
   return false;
}