var Layers = ["Parish", "County", "Civil Registration District", /*"Probate Court",*/ "Diocese", "Rural Deanery", "Poor Law Union", "Hundred", "Province", "Division"];
var nonSelectableLayers = ["Ordnance Survey" /*"Constituent Country", "Country", "County Color", "Extra Parochial", "New Forest", "Water", "Cathedral"*/];
var gmap;
var mapext = null;
var overlay = null;
var serviceURL = "http://fh.gis.lds.org/ArcGIS/rest/services/EJ1851P/MapServer";
var selectedJurisdiction = {
		sguids: [],
		label: null,
		type: null,
		polygon: null,
		overlay: null,
		mainSguid: null,
		associatedPrevSelection: null,
		selectInfo: null,
		infoWindow: { html: null,
					  lat: null,
					  lng: null,
					  options: { suppressMapPan: false }}};
//--delete these 2 after replacing with selected jurisdiction
var selectedJurisPolygon = null;
var selectedJuris = { ID: null,
					  label: null,
					  displayName: null};
var infoWindowOptions = {suppressMapPan: false};
var infoWindowHtml = null;
var radiusColorKey = { "0.25": "#990000", "0.5": "#004400", "1": "#FF0099", "3": "#FF00FF", "5": "#FF0000", "10": "#007700", "15": "#0000FF"};
var radiusSearchCircle = {radius: null, points: null, polyClickPoint: null, overlay: null, crossHair: null, crossHairPoints: null};
var circleOverlays = [];
var circleListDB = [];
var PrintObject = {  list: null, 
	    			 bubbleInfo: null, 
	    			 jurisInfo: null,
	    			 center: null,
	    			 zoom: null,
	    			 mapType: null,
	    			 tiles: [],
	    			 selectedPolygon: null,
	    			 selectedJurisID: null,
	    			 selectedJurisLabel: null,
	    			 selectedJurisName: null};
var wordsToLower = ["Created", "Located", "Partly", "Chapelry"];
var isAdvancedSearch = false;
var isCircleInfoWindow = false;
var radiusSearchSize = null;
var isMoveCircle = false;
var currentSelectLayer = null;
var markersOnMap = [];
var hiddenMarkers = [];
var singleMarker = null;
var markerSrc = "images/markers/blue_"; //"http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/marker"
var searchIDNum = 0; //tracks which search was last done, this prevents  markers from appearing after a new search
var abortedQuerys = [];
var LoginPass = "Abish";
var isDisabled = false;
var center = new GLatLng(52.5763, -1.4832);
var zoom = 7;
var zoomTypes = {never: 0, always: 1, conditional: 2}; 
var dontClearPolyFlag = false;
var allowAutoLayerChange = true;
var isMiles = true;
var isCountry = true;
var isSmartLayerSearch = true;
var doContigSearch = false;
var currentLayers = [];
var circleHint = null;
var layerID = { ParishSelect: 8,
				CountySelect: 7,
				CivilRegistrationSelect: 6,
				DioceseSelect: 5,
				RuralDeanerySelect: 1,
				PoorLawSelect: 2,
				HundredSelect: 3,
				ProvinceSelect: 4,
				County: 10,
				CountyInfo: 11,
				RuralDeanery: 15,
				Diocese: 16,
				DioceseInfo: 18,
				Province: 19,
				CivilRegistration: 20,
				Hundred: 21,
				PoorLaw: 22,
				Parish: 24,
				ParishInfo: 27,
				Water: 9,
				CountyShade: 28,
				Division: 29,
				Probate: 30};
var asyncContigData = {numOfResults: null,
					   results: []};
function switchToProductionServer()  //comment out/in in the load() line 20
{
	//serviceURL = "http://gis.familysearchsupport.com/ArcGIS/rest/services/EJ1851Shapefiles/MapServer";
	GIS_NOTES_FIELD = "NOTES";
	GIS_LABEL_FIELD = "LABEL";
	GIS_SGUID_FIELD = "SPATIALGUID";
}

var GIS_NOTES_FIELD = "GIS_PUBLIC.FHMAPS_LABELS_MVW.NOTES";
var GIS_LABEL_FIELD = "GIS_PUBLIC.FHMAPS_LABELS_MVW.LABEL";
var GIS_SGUID_FIELD = "GIS_PUBLIC.FHMAPS_LABELS_MVW.SPATIALGUID";
var GIS_LAT_FIELD = "GIS_PUBLIC.FHMAPS_LABELS_MVW.LAT";
var GIS_LNG_FIELD = "GIS_PUBLIC.FHMAPS_LABELS_MVW.LNG";