// Email obfuscation gleaned from http://blog.macromates.com/2006/obfuscating-email-addresses/
function dsNoSpamMailto(a, b, c)
{
  // Hide the no js warning
  if (document.getElementById)
  {
    var obj = document.getElementById(a+"NoJsWarning");
    if (obj) obj.style.display="none";
  } 
  // Write the email address
  var e = a + "@" + b + "." + c;
  document.write("<a href='mailto:"+e+"'>");
  document.write(e);
  document.write("</a>"); 
}

function dsOnload()
{
   dsWarnIE6();
}

// IE6 detection gleaned from http://ajaxian.com/archives/detecting-ie7-in-javascript
function dsWarnIE6()
{
  if (window.XMLHttpRequest)
  {
    // This is IE 7+, mozilla, safari, opera 9, etc 
    return;
  }
  // This is IE6 and older browsers
  // Display an unsupported warning banner.
  var pageWarnings = document.getElementById('pageWarnings');
  if (pageWarnings==null) return;
  pageWarnings.className = "pageWarnings"; // Make the warnings div visible
  private_dsAddElement(pageWarnings,'h2',"WARNING");
  private_dsAddElement(pageWarnings,'p',"This website does not support Internet Explorer 6 (or earlier)");
  private_dsAddElement(pageWarnings,'p',"For justification pleas look at the <a href=\"http://en.wikipedia.org/wiki/Internet_Explorer_6\"> IE6 Wikipedia</a> entry");
  private_dsAddElement(pageWarnings,'p',"Please use a more up to date browser such as Internet Explorer 7 (or 8 or 9), Firefox, Google Chrome, or Safari");
}

function private_dsAddElement(parentElement,type,content)
{
  var newElement = document.createElement(type);
  newElement.innerHTML = content;
  parentElement.appendChild(newElement);
}

