// ********************
// slightly modified version DOM-compliant mouseover code thanks to QuirksMode
// http://www.quirksmode.org/js/mouseov.html

var W3CDOM = (document.createElement && document.getElementsByTagName);

var mouseOvers = new Array();
var mouseOuts = new Array();

// use code below, for example, on calling page to initialize
window.onload = init_mouseovers;

// gets id of div that contains nav elements to add mouseover to
function init_mouseovers()
{
	if (!W3CDOM) return;
	var nav = document.getElementById('side-nav');
	var imgs = nav.getElementsByTagName('img');
	for (var i=0;i<imgs.length;i++)
	{
		 if (imgs[i].className!='active') {
			imgs[i].onmouseover = mouseGoesOver;
			imgs[i].onmouseout = mouseGoesOut;
			var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
			mouseOuts[i] = new Image();
			mouseOuts[i].src = imgs[i].src;
			mouseOvers[i] = new Image();
			mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "-ovr" + suffix;
			imgs[i].number = i;
		 }
	}
}

function mouseGoesOver()
{
	this.src = mouseOvers[this.number].src;
}

function mouseGoesOut()
{
	this.src = mouseOuts[this.number].src;
}
// ********************

