// Main Menu Script
function initmenu(skinpath)
{
	if(typeof skinpath == 'undefined'){skinpath='skins';}
	var i;
	if (document.getElementById) {
		var x = document.getElementById('mainmenu').getElementsByTagName('IMG');
	}
	else if (document.all) {
		var x = document.all['mainmenu'].all.tags('IMG');
	}
	else return;
	var preloads = new Object();
	for (i=0;i<x.length;i++)
	{
		if(x[i].id != ''){
		filetype=x[i].src.substr(x[i].src.lastIndexOf('.')+1);
		preloads['n'+x[i].id] = new Image;
		preloads['n'+x[i].id].src = skinpath + '/'+ x[i].id + '.' + filetype;
		preloads['o'+x[i].id] = new Image;
		preloads['o'+x[i].id].src = skinpath + '/'+ x[i].id + '_mo.' + filetype;
		preloads['o'+x[i].id].onerror = function () {this.src=skinpath + '/mm_home.' + filetype}
		x[i].onmouseover = function () {this.src=preloads['o'+this.id].src;}
		x[i].onmouseout = function () {this.src=preloads['n'+this.id].src;}
		}
	}
}
