//class="rollover"を追加。画像はソース名+_on
//<p><a href="#">
//<img class="rollover" src="rollover.gif" alt="rollover" />
//</a></p>


$(document).ready(function(){
    $("img.rollover").each(function() {
        var off = this.src;
        var dot = this.src.lastIndexOf('.');
        var on = this.src.substr(0, dot) +
            '_on' + this.src.substr(dot, 4);
        $(this).hover(
            function() { this.src = on; },
            function() { this.src = off; });
    });
});

