//Functions that can be called from any page on the site
//Rev. 3/5/08


//create automatically updated copyright text
   COPYRIGHT = "&copy; ECi Software Solutions, 1999&ndash;";

   function writeCopyright()
   {
      document.write(COPYRIGHT, new Date().getFullYear(), ". All rights reserved.");
   }

//Cloak email addresses to hide them from spam bots
	function cloaker(mailname,mailserver) {
		document.write("<a href='mailto:" + mailname + "@" + mailserver + "'>");
		document.write(mailname + "@" + mailserver);
		document.write("</a>");
	}

//image randomizer supplies header images for all pages except home page
//this script and addLoadListener from "The JavaScript Anthology"
//list all header images and corresponding alt text in the var headerimg block
addLoadListener(function()
{
  var headerimg = [  
      ['/images/layout/banners/NavHeader1', 'smiling businesswoman'],
      ['/images/layout/banners/NavHeader2', 'smiling business people'],
	  ['/images/layout/banners/NavHeader3', 'smiling young woman'],
	  ['/images/layout/banners/NavHeader4', 'smiling man']
  ];

  var n = Math.floor(Math.random() * headerimg.length);

  var img = document.getElementById('imgforheader');

  img.src = headerimg[n][0] + '.jpg';
  img.alt = headerimg[n][1];
});

//function that lets us include as many event listeners as needed; used in randomizer
function addLoadListener(fn)
{
  if (typeof window.addEventListener != 'undefined')
  {
    window.addEventListener('load', fn, false);
  }
  else if (typeof document.addEventListener != 'undefined')
  {
    document.addEventListener('load', fn, false);
  }
  else if (typeof window.attachEvent != 'undefined')
  {
    window.attachEvent('onload', fn);
  }
  else
  {
    var oldfn = window.onload;
    if (typeof window.onload != 'function')
    {
      window.onload = fn;
    }
    else
    {
      window.onload = function()
      {
        oldfn();
        fn();
      };
    }
  }
}