/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
	Rewritten to jQuery by Martin Olson
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var i=0;
	$('img.imgover').each(function() {
			var src = $(this).attr('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_on'+ftype);
	
			$(this).attr('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			$(this).mouseover( function() {
				sTempSrc = $(this).attr('src');
				$(this).attr('src', $(this).attr('hsrc'));
			}
			);
			
			$(this).mouseout(function() {
				if (!sTempSrc) sTempSrc = $(this).attr('src').replace('_on'+ftype, ftype);
				$(this).attr('src', sTempSrc);
			});
			i++;		
		}
	);

}

window.onload = initRollovers;
