
	// track what major features we have access to (equiv to browser testing)
	var ie4 = (document.all ? true : false);
	var ns4 = (document.layers ? true : false);
	var w3c = (document.getElementById ? true : false);

	// shortcut function to get object using appropriate browser feature
	function getByID (id)
	{
		if (w3c) { return document.getElementById(id); }
		else if (ie4) { return document.all[id]; }
		else if (ns4) { return document.layers[id]; }
		return null;
	}


	// basic image rollover functions -- onmouseover="imgOn('imgName')"
	function imgOn (name) { document[name].src = 'pictures/'+name+'2.gif'; }
	function imgOff (name) { document[name].src = 'pictures/'+name+'.gif'; }

	// rollover for input type="image" -- onmouseover="imgOn(this)"
	function imgOn2 (elem) { elem.src = elem.src.replace(/(\.[^\.]+)$/,'2$1'); }
	function imgOff2 (elem) { elem.src = elem.src.replace(/(2\.[^\.]+)$/,'$1'); }

	// this is a SAMPLE of how to preload the images:
// precaching of rollover images
//a = new Image(); a.src = '/pictures/name2.gif';



	// checks to see if we have actually left a menu for onMouseOut
	//  got inspiration from:
	// http://www.quirksmode.org/js/events_mouse.html#mouseover
	//  e == the event from onMouseOut="isInMenu(event,this)" or this => "getByID('base_id')"
	//  b == the base element, are we really moving out of this?
	function isInMenu (e,b)
	{
		// adapt to NS/IE naming differences
		p = e.relatedTarget;
		if (!p) { p = e.toElement; }

		// check all parents, see if they are the base element
		while (p)
		{
			// one of the parents is the base element, we're still over it
			if (p == b) { return true; }

			// this parent is not the base, keep checking the next parent up
			p = p.parentNode;
		}

		// we never found the base in all parents of event's target
		//  ergo, we really are no longer over the base element
		return false;
	}
