var regex = /_(neutral|rollover|select)\./;
var images = document.getElementsByTagName("img");

var i = 0;

for( i = 0; i < images.length; i++ ){
  images[i].onmouseover =
	  function(){
		  this.src = this.src.replace(regex,"_rollover.");
		};
	images[i].onmousedown = 
	  function(){
		  this.src = this.src.replace(regex,"_select.");
		};
	images[i].onmouseup = 
	  function(){
		  this.src = this.src.replace(regex,"_rollover.");
		};
	images[i].onmouseout = 
	  function(){
		  this.src = this.src.replace(regex,"_neutral.");
		};
}
