function smartRollover() {
    var images = $("img");

    images.each(function(){
        str = $(this).attr("src");
        if(str.match("_off."))
        {
            $(this).mouseover(function(){
                src = $(this).attr("src");
                $(this).attr("src", src.replace("_off.", "_on."));
            })
            $(this).mouseout(function(){
                src = $(this).attr("src");
                $(this).attr("src", src.replace("_on.", "_off."));
            })
        }
    });
}

$(function(){
    smartRollover();
});
