var d=document, w=window;

function preloadImagez() {
	var im;
	var x=d.getElementsByTagName("img");
	if (x) {
		if (!w.imgz) w.imgz=new Array();
//		alert("got "+x.length+" images");
		for (var i=0; i<x.length; i++) {
			if (x[i].id.substr(0, 6)=="imgpre") {
				im=x[i];
				im.otherimage=new Array(2);
				im.otherimage[0]=new Image();
				im.otherimage[0].src=im.src.replace(/[oa]?.gif/, "o.gif");
				w.imgz[im.id]=im;
			}
		}
	} else {
//		alert("no imgz?!");
	}
}

function preloadOver(id) {
	if (!w.imgz) { return; }
	var im=w.imgz[id];
	if (im && im.otherimage[0].src){
		if (!im.otherimage[1]) {
			im.otherimage[1]=new Image();
			im.otherimage[1].src=im.src;
//			alert("otherimage[1]=" + im.otherimage[1].src);
		}
		im.src=im.otherimage[0].src;
	}
}

function preloadOut(id) {
	if (!w.imgz) { return; }
	var im=w.imgz[id];
	if (im && im.otherimage[1].src) {
		im.src=im.otherimage[1].src;
	}
}