//mouseover.js
function swapImage(obj, strState) {
	if ((obj.src.indexOf('_0') >0) || (strState=='1')) {
		obj.src = obj.src.replace('_0', '_1');
	} else {
		obj.src = obj.src.replace('_1', '_0');
	}
}

function preloadImage(obj) {
	imgTmp=new Image();
  	imgTmp.src=obj.src.replace('_0', '_1');
}

// This one needs the swapImage(this) to be explicitly added to each image what wants to roll over...
function preloadold() {
	var preloadcount=0;
	var imgarr = document.images;  //document.getElementsByTagName('img');
	for (var i = 0; i < imgarr.length; i++) {
		if (imgarr[i].src.indexOf('_0.') > 0) {
			preloadImage(imgarr[i]);
			//preloadcount++;
		}
	}
}


//...whereas this one in the body onload event will automagically hook up the swap images for you
function preload() {
	var preloadcount=0;
	var imgarr = document.images;  //document.getElementsByTagName('img');
	for (var i = 0; i < imgarr.length; i++) {
		if (imgarr[i].src.indexOf('_0.') > 0) {
			preloadImage(imgarr[i]);
			imgarr[i].onmouseover=function(){swapImage(this, '1')};
			imgarr[i].onmouseout=function(){swapImage(this, '0')};
			//preloadcount++;
		}
	}
}


