$(document).ready(function(){   
	$('img.hover').mouseover(function(){
		$(this).attr('osrc', $(this).attr('src'));
		var pos = $(this).attr('src').lastIndexOf(".");
		var name = $(this).attr('src').substr(0, pos);
		var ext = $(this).attr('src').substr(pos);
		$(this).attr('src', (name+"_hover"+ext));
	});
	
	
	$('img.hover').mouseout(function(){
		$(this).attr('src', $(this).attr('osrc'));
	});
});


var applyHover = function(obj, _src){
	var img = new Image();
	img.src = _src;
	
	obj.outSrc = obj.src;
	obj.onSrc = _src;
	obj.onmouseout = function(){
		this.src = this.outSrc;
	};
	obj.onmouseover = function(){
		this.src = this.onSrc;
	};
	obj.onload = null;
};
