
function Preload_swap(){
  var nodes2 = $('#button_nav table');

	for(i=0;i < nodes2.length;i++){
	if(nodes2[i].getAttribute('background')){
		var org = nodes2[i].getAttribute('background');
		var Val = org.split(".");
		var splitVal = Val[0]+'_over.gif'
		PreImage = new Image();
		PreImage.src= splitVal;
		addEvent( nodes2[i], 'mouseover', swapOver )
		addEvent( nodes2[i], 'mouseout', swapOut )
		addEvent( nodes2[i], 'click', navClick )
		nodes2[i].setAttribute('over', splitVal);
		nodes2[i].setAttribute('org', org);
		}
	}
}

function addEvent( obj, type, fn ) {
	if (obj.addEventListener)
		obj.addEventListener( type, fn, false );
	else if (obj.attachEvent)
	{
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
	}
}

function swapOver(el){
	var imgSrc = this.getAttribute('over');
	this.style.background = "url("+imgSrc+")";
	this.style.cursor = "pointer";
}

function swapOut(el){
	var imgSrc = this.getAttribute('org');
	this.style.background = "url("+imgSrc+")";
	this.style.cursor = 'default';
}

function navClick() {
	var obj = this;
	var tst = $(obj).find("a").attr("href");
	window.location.href = tst;
}

