$(document).ready(function(){
    if (typeof rollover_props == 'undefined'){
        var props = {
            hclass : "rollover",
            suffix : "_on"
        };
    } else {
        var props = rollover_props;
    }
    $('img.'+props.hclass+',input.'+props.hclass).each(
        function(i){
            var osrc = $(this).attr('src');
            if (!osrc) return;
            var hsrc = osrc.replace(/(\.gif|\.jpg)/,props.suffix+'$1');
            (new Image()).src = hsrc;
            $(this).mouseover(function(){
                $(this).attr("src", hsrc);
            });
            $(this).mouseout(function(){
                $(this).attr("src", osrc);
            });
        }
    );
});
