function SetupButtonEvents(imgId,imgSrc,moSrc,mdSrc)
{
  var img = document.getElementById(imgId);
  if (moSrc != '')
    img.onmouseover = function() {this.src = moSrc;}

  if (mdSrc != '')
    img.onmousedown =  function() {this.src = mdSrc;}

  if (moSrc != '')
    img.onmouseup  = function() {this.src = moSrc;}
  else
    img.onmouseup  = function() {this.src = imgSrc;}

  img.onmouseout = function() {this.src = imgSrc;}
}