//*************************************************************************************************
//*
//* Function: ActivateZoomIn(imgPrefix)
//*
//* Description: Used by the SingleClick Client to zoom-in. Is not used by the basic viewer.
//*
//*************************************************************************************************

function ActivateZoomIn(imgPrefix) {

  // imgPrefix is optional... it is used by the Chameleon Interface

  if (imgPrefix == null) {
    imgPrefix = "";
  }
	
  setToolImage('ZOOMIN','2',imgPrefix); 

  document.frmNavigation.Cmd.value = 'ZOOMIN';
  document.frmNavigation.target="";
  document.frmNavigation.action = 'map.asp';
}

//*************************************************************************************************
//*
//* Function: ActivateZoomOut(imgPrefix)
//*
//* Description: Used by the SingleClick Client to zoom-out. Is not used by the basic viewer.
//*
//*************************************************************************************************

function ActivateZoomOut(imgPrefix) {

  // imgPrefix is optional... it is used by the Chameleon Interface

  if (imgPrefix == null) {
    imgPrefix = "";
  }
	
  setToolImage('ZOOMOUT','2',imgPrefix); 

  document.frmNavigation.Cmd.value = 'ZOOMOUT';
  document.frmNavigation.target="";
  document.frmNavigation.action = 'map.asp';
}

//*************************************************************************************************
//*
//* Function: ActivateZoomOut(imgPrefix)
//*
//* Description: Used by the SingleClick Client to pan the map. Is not used by the basic viewer.
//*
//*************************************************************************************************

function ActivatePan(imgPrefix) {

  // imgPrefix is optional... it is used by the Chameleon Interface

  if (imgPrefix == null) {
    imgPrefix = "";
  }	

  setToolImage('PAN','2',imgPrefix); 

  document.frmNavigation.Cmd.value = 'PAN';
  document.frmNavigation.target="";
  document.frmNavigation.action = 'map.asp';
}

//*************************************************************************************************
//*
//* Function: ActivateIdentify(targetwin,imgPrefix)
//*
//* Description: Used by the SingleClick Client to identify features on the map. Is not used by the
//* basic viewer.
//*
//*************************************************************************************************

function ActivateIdentify(targetwin,imgPrefix) {

  // imgPrefix is optional... it is used by the Chameleon Interface

  if (imgPrefix == null) {
    imgPrefix = "";
  }	

    setToolImage('IDENTIFY','2',imgPrefix); 

    document.frmNavigation.Cmd.value = 'IDENTIFY';
    document.frmNavigation.target = targetwin;
    document.frmNavigation.action = 'identify.asp';
}

//*************************************************************************************************
//*
//* Function: PopOut(sURL,sTitle,iHeight,iWidth,ynScroll,ynResize)
//*
//* Description: Opens a pop-up window that is iHeight x iWidth.
//*
//*************************************************************************************************

function PopOut(sURL,sTitle,iHeight,iWidth,ynScroll,ynResize) {

  var objWin;

  objWin = window.open(unescape(sURL), sTitle, "height=" + iHeight + ", width=" + iWidth + ", screenX=0, screenY=0, top=0, left=0, scrollbars=" + ynScroll + ", resizable=" + ynResize);

  if (parseInt(navigator.appVersion) >=4) objWin.window.focus();
}

//*************************************************************************************************
//*
//* Function: setToolImage(tool, mode, prefix)
//*
//* Description: Used by Graphical Button Clients.
//*
//*************************************************************************************************

function setToolImage(tool, mode, prefix) {

  // Prefix is an optional argument to the image file name.

  if (prefix == null) {
    prefix = "";
  }

  var imageFile = 'images/' + prefix + tool + mode + '.gif';	

  // Dull all images first.

  document.ZOOMIN.src = 'images/'+ prefix +'zoomin1.gif';
  document.ZOOMOUT.src = 'images/'+ prefix +'zoomout1.gif';
  document.PAN.src = 'images/'+ prefix +'pan1.gif';
  document.IDENTIFY.src = 'images/'+ prefix +'identify1.gif';

  //Then brighten the passed tool.

  if (tool == "ZOOMIN") {
    document.ZOOMIN.src = imageFile;
  }

  if (tool == "ZOOMOUT") {
    document.ZOOMOUT.src = imageFile;
  }

  if (tool == "PAN") {
    document.PAN.src = imageFile;
  }

  if (tool == "IDENTIFY") {
    document.IDENTIFY.src = imageFile;
  }
}

//*************************************************************************************************
//*
//* Function: ProcessLink(sURL)
//*
//* Description:
//*
//*************************************************************************************************

function ProcessLink(sURL) {

  document.body.style.cursor = "wait";
  document.location = sURL;
}