// This script is used to conveniently update certain text strings that appear
// throughout the pages, such as the current version of Jam. This allows these
// variable to be set in just one place, even on static pages that aren't being
// served by Rails.

// Obviously, since these are keyed to entity IDs, each item can be used only
// once per page. 

// The attached event makes the script run at load time

function setTextVariables()
  {
  var theVersionText = document.createTextNode("Version 0.23.11 (BETA)");
  var theElement = document.getElementById("jamLatestVersion");
  theElement.appendChild(theVersionText);
  }

//  This uses a variety of cross-browser tricks to find the right one for
//  attaching the event so it will run when the document loads.

if (window.addEventListener)      // DOM method for binding an event
  window.addEventListener("load", setTextVariables, false)
else if (window.attachEvent)      // IE exclusive method for binding an event
  window.attachEvent("onload", setTextVariables)
else if (document.getElementById) //support older modern browsers
  window.onload=setTextVariables
