(function(onLoad) {
    try {
        window.addEventListener('load', smartRollover, false);
    } catch (e) {
        window.attachEvent('onload', smartRollover);
    }
})();

function smartRollover() {
	var tags = ["img","input"];
	var over = function() { this.src = this.src.replace('_out.', '_over.'); };
	var out  = function() { this.src = this.src.replace('_over.', '_out.'); };
	for( var i=0, len=tags.length; i<len; i++ ) {
		var el = document.getElementsByTagName(tags[i]);
		for (var j=0, len2=el.length; j<len2; j++) {
			var attr = el[j].getAttribute('src');
			if (!el[j].src.match(/_out\./)&&attr) continue;
			el[j].onmouseover = over;
			el[j].onmouseout  = out;
		}
	}
}
