$(document).ready(function() {
    $(".hoverswap").hover(
        function () {
			$(this).data('orig_src', $(this).attr('src'));
			var new_src_array = $(this).attr("src").replace(/up.jpg/, "over.jpg").split('/');
			var img_url_array = new_src_array.pop().split('_');
			var over_imgnum = $(this).attr("id").split('_').pop();
			img_url_array[1] = over_imgnum;
			new_src_array.push(img_url_array.join('_'));
            $(this).attr("src", new_src_array.join('/'));
        },
        function () {
            $(this).attr("src", $(this).data('orig_src'));
        }
    );
});


