if (document.images) {
	preload_image_object = new Image();
	// set image url
	image_url = new Array();
	image_url[0] = "/wmeanb/images/nav_01_on.gif";
	image_url[1] = "/wmeanb/images/nav_02_on.gif";
	image_url[2] = "/wmeanb/images/nav_03_on.gif";
	image_url[3] = "/wmeanb/images/nav_04_on.gif";
	image_url[4] = "/wmeanb/images/nav_05_on.gif";
	image_url[5] = "/wmeanb/images/nav_06_on.gif";
	image_url[6] = "/wmeanb/images/nav_07_on.gif";
	image_url[7] = "/wmeanb/images/nav_08_on.gif";
	image_url[8] = "/wmeanb/images/nav_09_on.gif";

	for(var i=0; i<=3; i++)
		preload_image_object.src = image_url[i];
}

function runRollOver(id) {
	if (document.getElementById(id) != null) {
		var els = document.getElementById(id).getElementsByTagName("a");

		// It seems like the array position for img tag in <a> is different according to the browser type
		var childNodePosition = 0;
		if (navigator.appName == "Microsoft Internet Explorer") {
			childNodePosition = 0;

			if (document.getElementById("postLegend") != null) {
				document.getElementById("postLegend").style.marginLeft="-0.5em";
			}
		}
		else {
			childNodePosition = 1;
		}

		for (var x=0; x<els.length; x++) {
			els[x].onmouseover = function() {
				this.childNodes[childNodePosition].src = this.childNodes[childNodePosition].src.replace("off.gif", "on.gif");
			}
			els[x].onmouseout = function() {
				this.childNodes[childNodePosition].src = this.childNodes[childNodePosition].src.replace("on.gif", "off.gif");
			}
		}
	}
}

window.onload = function() {
	runRollOver("navBarLinks");
};