$(document).ready(function()
{
	// Image rollover
	$('img.rollover[src], input.rollover[src]').live('mouseover mouseout', function(event) {
		var hovimgend = "-ovr";
		var pattern = /\.(jpg|jpeg|png|gif)$/;
		var imgsrc = $(this).attr("src");
		var extmatch = imgsrc.match(pattern)[0];
		var matches = imgsrc.match(/hovimgend/);

		if (!matches && event.type == 'mouseover') {
			$(this).attr("src", imgsrc.replace(pattern, hovimgend + extmatch));
		}
		else {
			$(this).attr("src", imgsrc.replace(hovimgend + extmatch, extmatch));
		}

		$(window).bind( 'unload', function(){
				$(this).attr("src", imgsrc.replace(hovimgend + extmatch, extmatch));
		});
	});
});

