function preload(img) {
	//Image preload
	var img1 = new Image;
	img1.src = img;
}


function switch_imgs() {
	//Automatically add roll over image to images
	
	imgs = document.getElementsByTagName('img');
	
	for(i=0; i<imgs.length; i++) {
		sstatus = imgs[i].src.substr((imgs[i].src.length-7), 3);
		
		if(sstatus=='off') {			
			
			preload(imgs[i].src.replace('_off', '_on'));
			
			imgs[i].onmouseover = function() {
				this.src = this.src.replace('_off', '_on');	
			}
			
			imgs[i].onmouseout = function() {
				this.src = this.src.replace('_on', '_off');
			}
		}
		
	}
		
}

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