﻿//=============================================================================
// Primary javascript file for the web site wwww.RichmondLionsClub.org
//
// © Wild Hare Productions 2008-2009. All rights reserved.
//
// Portions of this file are copyright their respective owners.
// Copyright notice for these sections is given as appropriate.
//=============================================================================

//=============================================================================
// This function masks e-mail addresses so spam-bots can't farm them.
// This code is based on something I saw somewhere and modified.
//=============================================================================
function makemail(name,domain,subj)
{ 
	if (domain == "")
		domain = "RichmondLionsClub.org";
		
	document.location.href = "mail" + "to:" + name + "@" + domain + "?subject=" + subj; 
}

//=============================================================================
// This function places the date of the last update in the page footer.
//=============================================================================
function LastUpdate()
{
	lastmod = document.lastModified		// get string of last modified date
	lastmoddate = Date.parse(lastmod)	// convert modified string to date
	if (lastmoddate == 0) {				// unknown date (or January 1, 1970 GMT)
		document.writeln("Last Modified: Unknown   ")
	} else {
		document.writeln("Last Modified: " + lastmod.substr(0, 11) + " &nbsp; ")
	}
}

//=============================================================================
// Show one of the hockey logos in respose to a 'showHockeyImage() script call.
//=============================================================================
var hockeyImages=new Array('32881020.gif', '32882397.gif', '32883592.gif', '32884502.gif', '32894216.gif', '32894891.gif', '32895532.gif', '32900749.gif', '32902102.gif', '32912046.gif', '32948882.gif', '32949583.gif', '32950063.gif','32952161.gif', '32952422.gif', '32953403.gif', '32956591.gif', '32957283.gif', '32963329.gif', '32964484.gif', '32965417.gif', '32966693.gif', '32971208.gif', '32971738.gif', '32984794.gif');
function showHockeyImage( BasePath )
{
	var whichImage = Math.round(Math.random()*(hockeyImages.length-1));
	document.write('<img alt="" height="80" width="79" style="border-width:0px" src="'+BasePath+hockeyImages[whichImage]+'">');
}

//=============================================================================
// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
//=============================================================================
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

//=============================================================================
// Changes an image
//=============================================================================
function movepic(img_name,img_src)
{
document[img_name].src=img_src;
}



