$(function() {
	$('img.submenu').each(function(){
		var t=$(this);
		var initSrc = t.attr('src'); // initial src
		var initPath = initSrc.substring(0, initSrc.lastIndexOf('/')+1); // initial path
		var FileName = initSrc.substring(initSrc.lastIndexOf('/')+1, initSrc.lastIndexOf('.')); // let's get file name without extension
		t.mouseover(function(){
			$(this).attr('src', initPath + FileName+ 'Over.' + /[^.]+$/.exec(initSrc)); //last part is for extension
		})
		.mouseout(function(){
			$(this).attr('src', initPath + FileName + '.' + /[^.]+$/.exec(initSrc)); //removing 'Over' from the name
		});
	});
});
