sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


function init()
{
	if (document.getElementById)
		var x = document.getElementById('topmenu').getElementsByTagName('IMG');
	else if (document.all)
		var x = document.all['topmenu'].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 = '/img/'+ x[i].id + '.gif';
		preloads['o'+x[i].id] = new Image;
		preloads['o'+x[i].id].src = '/img/'+ x[i].id + '_over.gif';
		preloads['o'+x[i].id].onerror = function () {this.src='/img/default.gif'}
		x[i].onmouseover = function () {this.src=preloads['o'+this.id].src;}
		x[i].onmouseout = function () {this.src=preloads['n'+this.id].src;}
	}
}
window.onload = init;


