var ie4 = false;
var checked = 0;

if (document.all) { ie4 = true; }
function getObject(id) {
	if (ie4) {
		return document.all[id];
	} else {
		return document.getElementById(id);
	}
}

if (document.getElementsByTagName && document.getElementById) {
	if (window.addEventListener) window.addEventListener('load', setImageSwaps, false);
	else if (window.attachEvent) window.attachEvent('onload', setImageSwaps);
}

function setImageSwaps() {
	prepareImageSwap('menu',true,true,true);
}

// Non-Obtrusive Image Swap Script V1.1 by Hesido.com 
function prepareImageSwap(elem,mouseOver,mouseOutRestore,mouseOut) {
	if (typeof(elem) == 'string') elem = document.getElementById(elem); 
	if (elem == null) return; 
	var regg = /(.*)(_off\.)([^\.]{3,4})$/ 
	var prel = new Array(), img, imgList, imgsrc, mtchd; 
	imgList = elem.getElementsByTagName('img'); 
	for (var i=0; img = imgList[i]; i++) { 
		if (!img.rolloverSet && img.src.match(regg)) { 
			mtchd = img.src.match(regg); 
			img.hoverSRC = mtchd[1]+'_on.'+ mtchd[3]; 
			img.outSRC = img.src; 
			if (img.hoverSRC) {preLoadImg(img.hoverSRC); img.onmouseover = imgHoverSwap;} 
			if (img.outSRC) {preLoadImg(img.outSRC); img.onmouseout = imgOutSwap;} 
			img.rolloverSet = true; 
		} 
	}
	function preLoadImg(imgSrc) { 
		prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc; 
	} 
} 
function imgHoverSwap() {this.src = this.hoverSRC;} 
function imgOutSwap() {this.src = this.outSRC;} 