var hostName = document.location.host;
var localhostName= "carto.mairie-meudon.fr";
var catURL = "http://carto.mairie-meudon.fr/servlet/com.esri.esrimap.Esrimap?ServiceName=catalog";
var serverURL  = "http://carto.mairie-meudon.fr/servlet/com.esri.esrimap.Esrimap?ServiceName=";
var imsURL = "http://carto.mairie-meudon.fr/servlet/com.esri.esrimap.Esrimap?ServiceName=PlanHisto";
var imsOVURL =  "http://carto.mairie-meudon.fr/servlet/com.esri.esrimap.Esrimap?ServiceName=PlanSituation";
var imsQueryURL = '';
var mapBackColor = '225,225,225';
var ovBoxColor = '#ff0000';
var ovBoxSize = 3;
var zoomBoxColor = '#ff0000';
var hasOVMap = true;
var startLeft = 588237.196946611;
var startRight = 596514.402513668;
var startTop = 126367.99051121;
var startBottom = 119914.229379987;
var MSstartLeft = 588237.196946611;
var MSstartRight = 596514.402513668;
var MSstartTop = 126367.99051121;
var MSstartBottom = 119914.229379987;
var InActiveArea=true;
var limitLeft = 588237.196946611;
var limitRight = 596514.402513668;
var limitTop = 128072.542142107;
var limitBottom = 119307.569067766;
var usePan=true;
var usePanNorth=false;
var usePanWest=false;
var usePanEast=false;
var usePanSouth=false;
var useZoomIn=true;
var useZoomOut=true;
var useFullExtent=true;
var useZoomActive=true;
var useZoomLast=true;
var useMeasure=true;
var useSetUnits=true;
var useQuery=true;
var useFind=true;
var useStoredQuery=false;
var usePrint=true;
var useGeoNetwork=false;
var useExtract=false;
var MapUnits = "Meters";
var ScaleBarUnits = "Kilometers";
var hasToolBarOnLayer=false;
var setDebug=true;
var hspc = 0;
var vspc = 0;
var panFactor = 85/100;
var zoomFactor = 2
var showScalePercent=true;
var showXYs=false;
var doURLencode = false;
var drawNorthArrow = true;
var NorthArrowType = "4";
var NorthArrowSize = "50";
var NorthArrowCoords = "400 200";
var NorthArrowAngle ="0";
var drawScaleBar = false;
var setMapUnits=false;
var drawCopyright = true;
var CopyrightFont = "Arial";
var CopyrightStyle = "Bold";
var CopyrightSize = "14";
var CopyrightCoordsY = 0.13;
var CopyrightCoordsX = 0.09;
var CopyrightCoords = "";
var CopyrightColor = "255,255,255";
var CopyrightBackground = "true";
var CopyrightBGColor = "0,0,0";
var CopyrightGlow = "False";
var CopyrightGlowColor = "255,255,255";
var CopyrightText = "."
var Map_Description = new Array();
Map_Description[16] = "Aucun plan disponible au XVIème siècle"
Map_Description[17] = "Plan du château, jardins et conduites (1697)"
Map_Description[18] = "Carte générale des parcs et jardins (1723)"
Map_Description[19] = "Assemblage du cadastre Napoléonien (1816)"
Map_Description[20] = "Plan (1925)"
var drawModeOnMap = false;
var ovImageVar;
var ovBorderWidth = 2;
var ovExtentBoxSize = 2;
var mapTransparent=false;
var isIE = false;
var isNav = (navigator.appName.indexOf("Netscape")>=0);
var isNav4 = false;
var isIE4 = false;
var is5up = false;
if (isNav) {	
	if (parseFloat(navigator.appVersion)<5) {
		isNav4=true;
	} else {
		is5up = true;
	}
} else {
	isIE4=true;
	isIE=true;
	if (navigator.appVersion.indexOf("MSIE 5")>0) {
		isIE4 = false;
		is5up = true;
	}
}	
var ovHspc = 0;
var ovVspc = 0;
var ActiveLayerIndex=99;
var useTextFrame=true;
var useExternalWindow=false;
var textFrameBackColor="Silver";
var tableBackColor="White";
var textFrameTextColor="Black";
var textFrameLinkColor="Blue";
var textFrameFormColor="Gray";
var toggleVisible = true;
var toggleOVVisible = false;
var listAllLayers = false;
var hideLayersFromList=false;
var noListLayer = new Array();
var drawFloatingMode = false;
var modeLayerOn = false;
var modeLayerColor = "Black";
var modeLayerShadowColor = "White";
var modeLayerFont = "Arial";
var modeLayerSize = "4";
var ovMapIsLayer=true;
var webParams = parent.document.location.search;
var clickMarkerColor="255,0,0";
var clickMarkerType="Circle";
var clickMarkerSize="6";

function checkParams() {
	appDir = getPath(document.location.pathname);
	ovImageVar = document.ovImage;
	debugOn = 0;
	if (parent.TextFrame==null) {
		useTextFrame = false;
		useExternalWindow=true;
	}
	if (!hasLayer("measureBox")) useMeasure=false;
	if ((!useMeasure) && (!drawScaleBar)) useSetUnits=false;
	if (ovImageVar==null) hasOVMap = false;		
	if (isIE)	{
		if (hasLayer("theTop")) document.all.theTop.style.cursor = "crosshair";
		if (hasOVMap) ovImageVar.style.cursor = "hand";
	}		
	if (hasOVMap) {
		i2Width =  parseInt(ovImageVar.width);
		i2Height = parseInt(ovImageVar.height);
		forceNewOVMap =false;
		ovMapLeft=iWidth - 9/10* i2Width;
		ovMapTop =-1/20*i2Width;
		ovHspc=ovMapLeft;
	}
	if (webParams!="") {
		getCommandLineParams(webParams);
	}
	if ((startLeft!=0) && (startRight!=0)) getStartingExtent=false;
	if ((limitLeft!=0) && (limitRight!=0)) {
		getLimitExtent=false;
		enforceFullExtent=true;
	}
	// modif max 2003/09
	enforceFullExtent = false;

	if (ovBoxColor=="") ovBoxColor = "255,0,0";
	checkCoords();
	if (aimsNavigationPresent) {
		if (isNav4) {
			document.captureEvents(Event.MOUSEMOVE);
			document.captureEvents(Event.MOUSEDOWN);
			document.captureEvents(Event.MOUSEUP);
		}
		document.onmousemove = getMouse;
		document.onmousedown = mapTool;
		document.onmouseup = chkMouseUp;
	} else {
		usePan=false;
		usePanNorth=false;
		usePanWest=false;
		usePanEast=false;
		usePanSouth=false;
		useMeasure=false;
		useZoomIn=false;
		useZoomOut=false
		//useFullExtent=false;
		useZoomActive=false;
		//useZoomLast=false;	
	}
	if ((aimsXMLPresent) && (aimsMapPresent)) {
		startMap();
	} else {
		alert(msgList[0]);
	}
}
