//Map.js

// Force loading of all state-ful images so they are cached
imageFiles = new Array(
  "/ot/images/ZoomIn_ON.jpg",
  "/ot/images/ZoomIn_OFF.jpg",
  "/ot/images/ZoomOut_ON.jpg",
  "/ot/images/ZoomOut_OFF.jpg"
);
imageObjects = new Array( imageFiles.length );
for( var i = 0 ; i < imageFiles.length ; i++ )
{
  imageObjects[ i ] = new Image( 40 , 40 );
  imageObjects[ i ].src = imageFiles[ i ];
}

//<!--  reset tool icons to non-set state -->
function revertToolPic()
{
  document.zoomin.src="images/ZoomIn_OFF.jpg";
  document.zoomout.src="images/ZoomOut_OFF.jpg";
  document.rect.src="images/Marquee_ToolOFF.jpg";
  document.pan.src="images/Hand_ToolOFF.jpg";
}

//<!--  Reset images then set to second image for selected function so the image looks selected -->

//All images are set to the OFF position
//The specified tool is set to ON
//change all onmouseover events to use the HIGHLIGHT
//change all mouseout events to use the OFF
//set selected tool onmouseover and onmouseout to have no value
function setToolPic(functName)
{
//alert("begin setToolPic");
  //set all images to OFF position
  revertToolPic();

  //The specified tool is set to ON
  if (functName=="Zoom In")
  {
    document.zoomin.src="images/ZoomIn_ON.jpg";
  }
  else if (functName=="Zoom Out")
  {
    document.zoomout.src="images/ZoomOut_ON.jpg";
  }
  else if (functName=="Select Rectangle")
  {
    document.rect.src="images/Marquee_ToolON.jpg";
  }
  else if (functName=="Pan")
  {
    document.pan.src="images/Hand_ToolON.jpg";
  }
}

