// mouseover script
function mouseovers(element_id,my_path)
{
	
	// define gif, jpeg, or png here
	var filetype = '.jpg';
	// define overstate suffix here
	var overstate = '-over';
			
	if (document.getElementById)
		var x = document.getElementById(element_id).getElementsByTagName('IMG');

	else if (document.all)
		var x = document.all[element_id].all.tags('IMG');
	else return;
	var preloads = new Object();
	for (var i=0;i<x.length;i++)
	{
		preloads['n'+x[i].id] = new Image;
		preloads['n'+x[i].id].src = my_path + x[i].id + filetype;
		preloads['o'+x[i].id] = new Image;
		preloads['o'+x[i].id].src = my_path + x[i].id + overstate + filetype;
		preloads['o'+x[i].id].onerror = function () {this.src=my_path+'spacer.gif'}
		if(x[i].className == 'selected') // if class="selected", preserve image name
		{
			x[i].onmouseover = function () {this.src=preloads['o'+this.id].src;}
			x[i].onmouseout = function () {this.src=preloads['o'+this.id].src;}
		}
		else
		{
			x[i].onmouseover = function () {this.src=preloads['o'+this.id].src;}
			x[i].onmouseout = function () {this.src=preloads['n'+this.id].src;}
		}
	}
}
