function preload(img) {
	//Image preload
	var img1 = new Image;
	
	for(i=0; i<img.length; i++) {
		img1.src = img[i];
	}
}


function switch_imgs() {
	//Automatically add roll over image to images
	
	imgs = document.getElementsByTagName('img');
	newsrc = Array();
	newsrc_nid = Array();
	oldsrc = Array();
	
	for(i=0; i<imgs.length; i++) {
		sstatus = imgs[i].src.substr((imgs[i].src.length-8), 4);
		
		if(sstatus=='_off') {

			oldsrc[imgs[i].id] = imgs[i].src;
			newsrc[imgs[i].id] = imgs[i].src.replace('_off.', '_on.');
			newsrc_nid[i] = imgs[i].src.replace('_off.', '_on.');
			
			
			imgs[i].onmouseover = function() {
				this.src = newsrc[this.id];	
			}
			
			imgs[i].onmouseout = function() {
				this.src = oldsrc[this.id];	
			}
		}
		
	}
	
	return newsrc_nid;
	
}

window.onload = function() {
	preload(switch_imgs());
}

function serviceHover(text, caller) {
	el = document.getElementById('serviceHover');
	el.innerHTML = text;
	
	caller.onmouseout = function() {
		el.innerHTML = '';
	}
}