var current_tool = false;

function selectTool( tool ) {
  // this only works if the pre-load images are set
  t = document.getElementById(tool);
  if ( current_tool != tool) {
    if ( current_tool ) {
      document.getElementById(current_tool).src = "images/tool_" + current_tool + "_1.gif";
    }
  }
  t.src = "images/tool_" + tool + "_2.gif";

  setCursor(tool);

  var s = document.getElementById('status');
  if (s) {
    s.innerHTML = "Tool: " + tool;
  }
  current_tool = tool;
}

