var InMoveButton=false;
var InZoomPButton=false;
var InZoomMButton=false;
var InToolBar=false;
    
function ZoomOut(){
 toolMode=0;
 setActiveTool('ZoomOut');
 InZoomMButton=true;
 clickFunction ("zoomout");
}

function ZoomIn(){
 toolMode=0;
 setActiveTool('ZoomIn');
 InZoomPButton=true;
 clickFunction ("zoomin");
}

function Move(){
 toolMode=0;
 setActiveTool('Move');
 InMoveButton=true;
 clickFunction ("pan");
}

function VGlobale(){
 if (is5up) document.getElementById('FExtent').src="/gifs/t/ic_fullextent.gif";
 else document.all.FExtent.src="/gifs/t/ic_fullextent.gif";
 InToolBar=true;
 eLeft = startLeft;
 eRight = startRight;
 eTop = startTop;
 eBottom = startBottom;
 sendMapXML();
 InToolBar=false;
}

function setActiveTool (sToolName){
  if (is5up)
  {
    document.getElementById('ZoomIn').src  = (sToolName == 'ZoomIn')  ? "/gifs/t/ic_loupe+.gif" : "/gifs/t/i_loupe+.gif";
    document.getElementById('MainMove').src= (sToolName == 'Move')    ? "/gifs/t/ic_main.gif"   : "/gifs/t/i_main.gif";
    document.getElementById('ZoomOut').src = (sToolName == 'ZoomOut') ? "/gifs/t/ic_loupe-.gif" : "/gifs/t/i_loupe-.gif";
  }
  else
  {
    document.all.ZoomIn.src  = (sToolName == 'ZoomIn')  ? "/gifs/t/ic_loupe+.gif" : "/gifs/t/i_loupe+.gif";
    document.all.MainMove.src= (sToolName == 'Move')    ? "/gifs/t/ic_main.gif"   : "/gifs/t/i_main.gif";
    document.all.ZoomOut.src = (sToolName == 'ZoomOut') ? "/gifs/t/ic_loupe-.gif" : "/gifs/t/i_loupe-.gif";
  }
}

function ZoomToFeature(MinX,MinY,MaxX,MaxY,ID,Layer)
{
 var DeltaX=MaxX-MinX;
 var DeltaY=MaxY-MinY;
 var Marge=0;
 switch(parseInt(Layer)){
  case 104:
  	selectType="point";
  	DeltaX=1;
  	DeltaY=1;
  	Marge=80;
  	break;
  case 103:
  	selectType="point"
  	DeltaX=1;
  	DeltaY=1;
  	Marge=70;
  	break;
  case 102:
	selectType="line";
	Marge=0.5;
	break;
  case 101:
	selectType="point";
	Marge=45;
	break;
  default:
	break;
 }
 eLeft=MinX - Marge*DeltaX;
 eBottom=MinY - Marge*DeltaY;
 eRight=MaxX*1 + Marge*DeltaX;
 eTop=MaxY*1 + Marge*DeltaY;
 ActiveLayer=Layer;
 QueryString=" #ID# = " + ID;
 selectCount=2;
 canSelectInvisible=true;
 showSelectedFeatures=true;
 setQueryString=QueryString;
 aimsSelectPresent=true;
 showRetrieveMap();
 var theText = writeXML();
 sendToServer(imsURL,theText,1);
}
	