﻿window.onload = function () {
	if (self.init)
		init();
}
function init()
{
	if (document.getElementById)
		var x = document.getElementById('nav').getElementsByTagName('IMG');
	else if (document.all)
		var x = document.all['nav'].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 = '/images/'+ x[i].id + 'off.png';
		preloads['o'+x[i].id] = new Image;
		preloads['o'+x[i].id].src = '/images/'+ x[i].id + 'on.png';
		preloads['o'+x[i].id].onerror = function () {this.src='/images/'+ x[i].id + 'off.png';}
		x[i].onmouseover = function () {this.src=preloads['o'+this.id].src;}
		x[i].onmouseout = function () {this.src=preloads['n'+this.id].src;}
	}
}
