function prepareImageSwap(titleimage) { 
//Do not delete these comments. 
//Non-Obtrusive Image Swap Script V1.1 by Hesido.com 
//Attribution required on all accounts 
	var regg = /menuimage\[(.*)\]$/ 
	var regg2 = /itemhover\[(.*)\]$/ 
	var prel = new Array(), link, linkList, mtchd; 
	linkList = document.body.getElementsByTagName('a'); 
	for (var i=0; link = linkList[i]; i++) { 
		if(!link.rolloverSet && link.getAttribute("rel")!=null) {
			if(link.getAttribute("rel").match(regg)) {
				mtchd = link.getAttribute("rel").match(regg);
		 		link.hoverSRC = "images/menu/"+mtchd[1]+"_over.gif";
		 		link.outSRC = "images/menu/"+mtchd[1]+".gif";
		 		link.img = "menuimg_"+mtchd[1];
		 		preLoadImg(link.hoverSRC);
		 		link.onmouseover = linkHoverSwap;
		 		preLoadImg(link.outSRC);
		 		link.onmouseout = linkOutSwap;
		 		link.rolloverSet = true;
		 	} else if(link.getAttribute("rel").match(regg2)) {
				mtchd = link.getAttribute("rel").match(regg2);
		 		link.img = "itemhover_"+mtchd[1];
		 		document.getElementById(link.img).img = link.img;
		 		link.onmouseover = itemHoverSwap;
		 		link.onmouseout = itemOutSwap;
		 		//document.getElementById(link.img).onmouseout = itemOutSwap;
		 		link.rolloverSet = true;
		 	}
 		}
	}
    function preLoadImg(imgSrc) { 
        prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc; 
    } 
} 
function linkHoverSwap() {
	document.getElementById(this.img).src = this.hoverSRC;
} 
function linkOutSwap() {
	document.getElementById(this.img).src = this.outSRC;
}
function itemHoverSwap() {
	document.getElementById(this.img).style.visibility = "visible";
}
function itemOutSwap() {
	document.getElementById(this.img).style.visibility = "hidden";
}

