function showAndHide (showObj,hideObjs)
{
	// Effect.Appear (showObj);
	Element.show (showObj);

	if (hideObjs && hideObjs.length > 0)
	{
		var i = 0;
		while (i < hideObjs.length)
		{
			Element.hide (hideObjs[i]);
			i++;
		}
	}
}

function hideAfterDelay (hideObj)
{
	setTimeout (function() { Element.hide(hideObj);},2000);
}

// ADD IMAGE SWAP -------------------------------------------------
// adds a JS mouse over swap to all image inputs and image links
// in the document with '_off' or '_on' as the last bit of the
// filename before the extension
function AddSwap() {
//	declare variables
	var	inputs,
		hyperlinks,
		numElements,
		childImages,
		numImages,
		i,
		j;
//	test for DOM Methods and get all input elements
	if(	(typeof document.getElementById != 'undefined') &&
		(typeof document.getElementsByTagName != 'undefined') &&
		(inputs = document.getElementsByTagName('input')) &&
		(hyperlinks = document.getElementsByTagName('a'))
		) {
//		loop through the inputs
		numElements = inputs.length;
		for (i = 0; i < numElements; i++) {
//			find the ones that are of type 'image'
			if (inputs[i].type.toLowerCase() == 'image') {
//				pass image inputs to the function that adds the swap
				this.makeSwap(inputs[i]);
			}
		}
//		loop through the anchors
		numElements = hyperlinks.length;
		for (i = 0; i < numElements; i++) {
//			find the ones that have image children
			childImages = hyperlinks[i].getElementsByTagName('img');
			numImages = childImages.length;
			if (numImages > 0) {
//				pass the images to the function that adds the swap
				for (j = 0; j < numImages; j++) {
					this.makeSwap(childImages[j]);
				}
			}
		}
		// addUnloadHandler(this.cleanUp);
		// Event.observe(window, 'unload', cleanUp, false);
		return true;
	}
	return false;
}
AddSwap.prototype.makeSwap = function (el) {
	if ((typeof el.src == 'string') && (el.src.indexOf('_off.') != -1)) {
//		if the image name contains 'off' set the src of off state img to the current
//		src and swap the 'off' with 'on' to get the src for the on state
		el.offImg = new Image();
		el.offImg.src = el.src;
		el.onImg = new Image();
		el.onImg.src = el.src.replace(/_off\./,'_on.');
	} else if ((typeof el.src == 'string') && (el.src.indexOf('_on.') != -1)) {
//		otherwise, if the image name contains 'on' set the src of on state img to the
//		current src and swap the 'on' with 'ooff' to get the src for the on state
		el.offImg = new Image();
		el.offImg.src = el.src;
		el.onImg = new Image();
		el.onImg.src = el.src.replace(/_on\./,'_off.');
//	if neither of the state slugs is present, return false
	} else return false;
//	add mouseover and mouseout functions
	el.onmouseover = function() { this.src = this.onImg.src; return true; }
	el.onmouseout = function() { this.src = this.offImg.src; return true; }
	return true
}
AddSwap.prototype.cleanUp = function () {
	var	inputs = document.getElementsByTagName('input'),
		hyperlinks = document.getElementsByTagName('a'),
		numElements = inputs.length,
		childImages,
		numImages,
		i,
		j;
//	loop through the inputs
	for (i = 0; i < numElements; i++) {
//		find the ones that are of type 'image'
		if (inputs[i].type.toLowerCase() == 'image') {
//			remove handlers & expandos
			inputs[i].offImg = null;
			inputs[i].onImg = null;
			inputs[i].onmouseover = null;
			inputs[i].onmouseout = null;
		}
	}
//	loop through the anchors
	numElements = hyperlinks.length;
	for (i = 0; i < numElements; i++) {
//		find the ones that have image children
		childImages = hyperlinks[i].getElementsByTagName('img');
		numImages = childImages.length;
		if (numImages > 0) {
//			pass the images to the function that adds the swap
			for (j = 0; j < numImages; j++) {
				childImages[j].offImg = null;
				childImages[j].onImg = null;
				childImages[j].onmouseover = null;
				childImages[j].onmouseout = null;
			}
		}
	}
	return true;
}
// addLoadHandler(function() { return new AddSwap();});

function initSwaps() { return new AddSwap(); }

Event.observe(window, 'load', initSwaps, false);

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("main-nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace
        (" over", "");
   }
   }
  }
 }
}

Event.observe(window, 'load', startList, false);

