// tB Rolloverscript incl. image preload and tab feature

window.onload = rollover_find;

function rollover_find() {
	for (i=0; i<document.images.length; i++) {
		if (document.images[i].parentNode.tagName == "A") {
			rollover_init(document.images[i]);
		}
	}
}

function rollover_init(thisImage) {
	thisImage.outImage = new Image();
	thisImage.outImage.src = thisImage.src;
	thisImage.onmouseout = Out;
	
	thisImage.overImage = new Image();
	thisImage.overImage.src = "/images/" + thisImage.id + "_h.gif";
	thisImage.onmouseover = Over;
	
	thisImage.parentNode.childImg = thisImage;
	thisImage.parentNode.onblur = rollOutChild;
	thisImage.parentNode.onfocus = rollOverChild;
}

function Out() {
	this.src = this.outImage.src;
}

function Over() {
	this.src = this.overImage.src;
}

function rollOutChild() {
	this.childImg.src = this.childImg.outImage.src;
}

function rollOverChild() {
	this.childImg.src = this.childImg.overImage.src;
}
