/*
http://ascii.jp/elem/000/000/471/471577/
original: _on
modify: _hover
*/

$(function(){
    $("img.rollover").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_hover$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_hover(\.[a-z]+)$/, "$1$2"));
    }).each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
    })
})

// 以降、inputを追加
$(function(){
    $("input.rollover").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_hover$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_hover(\.[a-z]+)$/, "$1$2"));
    }).each(function(){
        $("<input>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_hover$2"))
    })
})
// JavaScript Document
