// ArcIMSparam.js
// javascript file with parameters specific to calling page

//***************************************************************************
//*			parameters File for HTML Template		    *
//***************************************************************************

// get machine name
var hostName = document.location.host;
// common aliased portion of url
var aliasBlurb = "/ARCIMS/ims?ServiceName="
// common portion of url
var esriBlurb = "/servlet/com.esri.esrimap.Esrimap?ServiceName="
// make URL for getting mapservice catalog
var catURL = "http://" + hostName + esriBlurb + "catalog";
// service name
var serviceName = "dcad_new"
// make prefix for URL
var serverURL = "http://" + hostName + esriBlurb + serviceName;
// 'http://devmaps.dcad.org/arcims/ims?ServiceName=dcad';




//*********************************************************************
//*			parameters set by Designer		      *
//*********************************************************************
var imsURL = serverURL;
var imsOVURL = serverURL;

var imsQueryURL = '';
var imsGeocodeURL = '';
var atsWebAppRoot = "http://" + hostName + "/website/dcad";
//alert(atsWebAppRoot)
//var atsWebAppRoot = "http://devmaps.dcad.org/website/dcad";


//initial map extent
var startLeft = 2388590; //2331640.74970515;
var startRight = 2604259; //2660702.51804623;
var startTop = 7059493; //7080191.97966586;
var startBottom = 6879245; //6856584.569971;

//maximum map extent
var limitLeft = 2388590; //2331640.74970515;
var limitRight = 2604259; //2660702.51804623;
var limitTop = 7059493; //7080191.97966586;
var limitBottom = 6879245; //6856584.569971;

var finalScale = -1;
var updateTOC  = true;

var usePan=true;
var usePanNorth=false;
var usePanWest=false;
var usePanEast=false;
var usePanSouth=false;
var useZoomIn=true;
var useZoomOut=true;
var useFullExtent=false;
var useZoomActive=false;
var useZoomLast=false;
var useIdentify=true;
var useMeasure=true;
var useSetUnits=false;
var useSelect=false;
var useQuery=false;
var useFind=true;
var useGeocode=false;
var useStoredQuery=false;
var useClearSelect=true;
var usePrint=false;
var useGeoNetwork=false;
var useBuffer=false;
var useExtract=false;
var useParcelIdentify=true;

var MapUnits = "Feet";
var ScaleBarUnits = "Feet";



// End of Designer set parameters

//Custom HTMl viewer settings developed by ATS, Inc

// URL to foward for parcel identification

var urlParcelIdentify = "http://www.dallascad.org/AcctDetailGIS.aspx?ID=";

// Set the field in Parcel layer that contains the Parcel Account Number
	// Field in layer to match db
var mapIDField = "Acct"; //case sensitive
	// Field in db to match layer
var dbIDField = "Acct"; //case senstive
	// List of fields to be returned in response
var dbFieldList = "Acct";
	// List of descriptions matching the fields in dbFieldList
var dbFieldListDescript = "Parcel ID";

var dbIDFieldIsText = true;
var dbTableList = "ontquery";


// Layers Index that will have active radio button enabled in the Layer List
// current layers include Map Grid, Dallas Block, Abstract Boundary and subdivision boundary
// added the contours as an active selectabel layer. 2-26-04
// Index is counted from bottom of AXL with Parcels being 0

var activeLayers = new Array();
    activeLayers = [1,2,3,4,5,6,10,11,19,21,22,23,24,25];


// Layers that toggle on the LayerList eg, City, ISD, TIF, SPECIAL TAX DIST, ZIPCODES with indexes as 22,23,24,25,26

var toggleLayer = new Array();
    toggleLayer = [28,29];

// Layers enabled for searchs
//Layers include Map Grid, Dallas Block, Abstract and subdivision 

var selLayers = new Array();
    selLayers = [21,22,23,24,25];

var selLayerName = new Array();
    selLayerName = ['Neighborhood','Map Grid','Dallas Block','Abstract','Subdivision'];

var selLayerText = new Array();
    selLayerText = ['Enter Neighborhood number. Eg: 5DSY04','Enter Map page number. Eg: 11-A','Enter Block NUMBER', 'Find Abstract by NUMBER or NAME (Enter three or more characters for better results Eg: Dallas)', 'Type Subdivision NAME (Please enter the first five characters of the subdivision name).'];


// Scale at which Ortho photos are turned on

var photoScale = 3001;

//Ortho Image Index 

var orthoIndex = 13;


// End Custom settings by ATS, Inc.


var useHyperLink=false;
var useHyperLinkAny=false;
var useIdentifyAll=false;
var useBufferShape=false; 
var hasToolBarOnLayer=false;
	// useHyperLink takes priority - both cannot be true
if (useHyperLink) useHyperLinkAny=false;
	// useIdentify takes priority - both cannot be true
if (useIdentify) useIdentifyAll=false;
	// allow debugging
var setDebug=true;


/**************************************
* Basic Map parameters
**************************************/

// variables for setting component colors
var mapBackColor = "";
var ovBoxColor = "#ff0000";
var ovBoxSize = 3;
var zoomBoxColor = "#ff0000";

// variables for using individual components
var hasOVMap = false;
var hasTOC = true;
var useModeFrame = true;

// variables for map pixel offset from upper left corner of frame
	// horizontal offset
var hspc = 0;
	// vertical offset
var vspc = 0;

//panning factor for arrow buttons
var panFactor = 85/100;
//zoom factors for v.3
var zoomFactor = 2

// margin factor for zooming in on selected lines and polygons - based on feature width and height. . . margin will be selectMargin * width or height
var selectMargin = 20/100;
// margin margin factor for zooming in on selected points - based on full extent. . . margin will be selectPointMargin * fullWidth or fullHeight
var selectPointMargin = 60/1000

// show the scale factor
var showScalePercent=true;
// display coords in status line
var showXYs=true;

// Have ArcXML responses URL encoded? Will not work with multi-byte characters
var doURLencode = false;

// automatically adjust for ArcMapServer, if necessary
	// North Arrow size is smaller from ArcMapServer
var autoAdjustForArcMapServer = true;


//variables for MapDrawing
	// North Arrow
var drawNorthArrow = true;
var NorthArrowType = "3";
var NorthArrowSize = "30";
var NorthArrowCoords = "25 30";
var NorthArrowAngle = "0";
var NorthArrowOutline = "255,255,255";


	// Scale Bar
var drawScaleBar = true;
	// MapUnits=DEGREES,FEET,METERS
	// can MapUnits be changed by user?
var setMapUnits=false;
	// ScaleBarUnits=KILOMETERS,METERS,MILES,FEET
var ScaleBarBackground = "true";
var ScaleBarBackColor = "255,255,255";
var ScaleBarFontColor = "255,255,255";
var ScaleBarColor = "255,255,255";
var ScaleBarFont = "Arial";
var ScaleBarStyle = "Regular";
var ScaleBarRound = "1";
var ScaleBarSize = "12";
var ScaleBarWidth = "7";
var ScaleBarPrecision = 2;
var ScaleBarTextOutline = "0,0,0";
var numDecimals = 2;



	// Scale Bar 2
var drawScaleBar2 = false;
var ScaleBar2Units = "KILOMETERS";
var ScaleBar2Background = "false";
var ScaleBar2BackColor = "0,0,0";
var ScaleBar2FontColor = "0,0,0";
var ScaleBar2Color = "128,128,128";
var ScaleBar2Font = "";
var ScaleBar2Style = "Regular";
var ScaleBar2Round = "1";
var ScaleBar2Size = "9";
var ScaleBar2Width = "6";
var ScaleBar2Precision = 2;

	// Copyright blurb
var drawCopyright = false;
var CopyrightFont = "";
var CopyrightStyle = "Regular";
var CopyrightSize = "8";
var CopyrightCoords = "3 3";
var CopyrightColor = "0,0,0";
var CopyrightBackground = "True";
var CopyrightBGColor = "255,255,255";
var CopyrightGlow = "False";
var CopyrightGlowColor = "255,255,255";
var CopyrightShadow = "False";
var CopyrightShadowColor = "32,32,32";
var CopyrightText = "Copyright (C) DCAD http://www.dallascad.org";

	// place bar behind Copyright text and scalebars
var drawBottomBar = false;
var bottomBarColor = "255,255,255";
var bottomBarOutline = "0,0,0";
var bottomBarHeight = "18";

	// Mode on Map
var drawModeOnMap = false;
var modeRefreshMap = false;
var modeMapColor = "255,255,255";
var modeMapGlow = "128,0,255";

var ovImageVar;
var ovBorderWidth = 2;
var ovExtentBoxSize = 2;

// map image background transparent? - requires gif or png8 types
var mapTransparent=false;

// setup test for Nav 4.0
var isIE = false;
var isNav = (navigator.appName.indexOf("Netscape")>=0);
var isNav4 = false;
var isIE4 = false;
var is5up = false;
//alert(navigator.appVersion);
if (isNav) {
	
	if (parseFloat(navigator.appVersion)<5) {
		isNav4=true;
		//alert("Netscape 4.x or older");
	} else {
		is5up = true;
	}
} else {
	isIE4=true;
	isIE=true;
	if ((navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE 6")>0)) {
		isIE4 = false;
		is5up = true;
		//alert("IE5");
	}
}	
		
/**************************************
* Extended Map parameters
**************************************/

// variables for ovmap offset
var ovHspc = 0;
var ovVspc = 0;

// color for Main Map zoombox in html hex RGB format
//var zoomBoxColor = "#ff0000";

// index of initial active layer. . . if more than or equal to layer count top layer used

var ActiveLayerIndex=27;

// variables for using individual components
var useTextFrame=true;
// use external window for dialogs
var useExternalWindow=false;

// colors for tables 
var textFrameBackColor="#FFFFFF";
var tableBackColor="White";
var textFrameTextColor="Black";
var textFrameLinkColor="Blue";
var textFrameFormColor="Gray";

// LayerList visible at service load
var showTOC=true;
// set layer visibility according to LayerList or by custom programming
var toggleVisible = true;
// set layer visibility of OVMap according to LayerList or by custom programming
	// imsURL must equal imsOVMap - depends on one LayerList
var toggleOVVisible = false;
// will the LayerList show all layers, not just those available at current scale
var listAllLayers = false;

// toggle the check of non-listing of layers in LayerList and Legend
// if true, noListLayer array must have an element defined for each layer
var hideLayersFromList=true;

// layers that will be listed in the LayerList or Legend
	// Note: This does not affect map display

var noListLayer = new Array();
 noListLayer[0] = false;
 noListLayer[1] = false;
 noListLayer[2] = false;
 noListLayer[3] = false;	
 noListLayer[4] = false;
 noListLayer[5] = false;
 noListLayer[6] = false;
 noListLayer[7] = false;
 noListLayer[8] = false;	
 noListLayer[9] = false;
 noListLayer[10] = false;
 noListLayer[11] = false;
 noListLayer[12] = false;
 noListLayer[13] = false;	
 noListLayer[14] = false;
 noListLayer[15] = false;
 noListLayer[16] = false;
 noListLayer[17] = false;
 noListLayer[18] = false;	
 noListLayer[19] = false;
 noListLayer[20] = false;	
 noListLayer[21] = false;
 noListLayer[22] = false;
 noListLayer[23] = false;
 noListLayer[24] = false;
 noListLayer[25] = false;
 noListLayer[26] = false;
 noListLayer[27] = false;
 noListLayer[28] = false;
 noListLayer[29] = false;
 noListLayer[30] = false;
 noListLayer[31] = false;
 noListLayer[32] = false; 
 

var noListLegend = new Array();
 noListLegend[0] = false;
 noListLegend[1] = false;
 noListLegend[2] = false;
 noListLegend[3] = false;	
 noListLegend[4] = false;
 noListLegend[5] = false;
 noListLegend[6] = false;
 noListLegend[7] = false;
 noListLegend[8] = false;	
 noListLegend[9] = false;
 noListLegend[10] = false;
 noListLegend[11] = false;
 noListLegend[12] = false;
 noListLegend[13] = false;	
 noListLegend[14] = false;
 noListLegend[15] = false;
 noListLegend[16] = false;
 noListLegend[17] = false;
 noListLegend[18] = false;	
 noListLegend[19] = false;
 noListLegend[20] = false;	
 noListLegend[21] = false;
 noListLegend[22]  = false;
 noListLegend[23]  = false;
 noListLegend[24]  = false;
 noListLegend[25]  = false;
 noListLegend[26]  = false;
 noListLegend[27]  = false;
 noListLegend[28]  = false;
 noListLegend[29]  = false;
 noListLegend[30]  = false;
 noListLegend[31]  = false;
 noListLegend[32]  = false;

	// Mode on floating layer
var drawFloatingMode = false;
var modeLayerOn = false;
var modeLayerColor = "Black";
var modeLayerShadowColor = "White";
var modeLayerFont = "Arial";
var modeLayerSize = "4";

	// does the overview map a layer on top of map?... 
var ovMapIsLayer=true;

var webParams = "";
if (parent.MapFrame!=null) {
	webParams = parent.document.location.search;
} else {
	webParams = document.location.search;
}

/**************************************
* Interactive Map parameters
**************************************/

// Click points - Measure/Shape Select/Shape Buffer
var clickMarkerColor="255,0,0";
var clickMarkerType="Circle";
var clickMarkerSize="6";


/**************************************
* Identify/Select/Query/Buffer parameters
**************************************/

// search tolerance in pixels around click
var pixelTolerance=3;
// color of selected features in decimal RGB format
var selectColor="255,255,0";
// color of highlighted feature in decimal RGB format
var highlightColor="255,255,0";
// level of transparency of selected and highlighted color
var transparentLevel = "0.4";
	// zoom to selected feature if only one is returned?
var zoomToSingleSelect = false;
	// use only unique values in sample field value lists
var onlyUniqueSamples = true;
	// are string queries case insensitive?
		// false by default to match Java Viewer and ArcExplorer
var queryCaseInsensitive=true;

// fields to be returned in identify/selection/query request. . . #ALL#=all fields
var selectFields= "#ALL#";
//var selectFields= "#ID# #SHAPE#";
// swap out the list of returned fields? 
//If true, a list must be defined in selFieldList[n] for each layer to update selectFields
var swapSelectFields=true;
// array for each layer's returned fields if swapSelectFields=true
var selFieldList = new Array();
// sample set for world - if not #ALL#, id and shape fields required. Separate with a space

selFieldList[0]="GIS.ADM.PARCEL.Acct #ID# #SHAPE#";
selFieldList[1]="GIS.ADM.PARCEL2011.Acct #ID# #SHAPE#";
selFieldList[2]="GIS.ADM.PARCEL2010.Acct #ID# #SHAPE#";
selFieldList[3]="GIS.ADM.PARCEL2009.Acct #ID# #SHAPE#";
selFieldList[4]="GIS.ADM.PARCEL2008.Acct #ID# #SHAPE#";
selFieldList[5]="GIS.ADM.PARCEL2007.Acct #ID# #SHAPE#";
selFieldList[6]="GIS.ADM.PARCEL2006.Acct #ID# #SHAPE#";
selFieldList[7]="#ALL#";
selFieldList[8]="#ALL#";
selFieldList[9]="#ALL#";
selFieldList[10]="#ALL#";
selFieldList[11]="#ALL#";
selFieldList[12]="GIS.ADM.CONTOURS.Elevation #ID# #SHAPE#";
selFieldList[13]="#ALL#";
selFieldList[14]="#ALL#";
selFieldList[15]="#ALL#";
selFieldList[16]="#ALL#";
selFieldList[17]="#ALL#";
selFieldList[18]="#ALL#";
selFieldList[19]="#ALL#";
selFieldList[20]="#ALL#";
selFieldList[21]="GIS.ADM.NBHD.NBHD #ID# #SHAPE#";
selFieldList[22]="GIS.ADM.MAPSCO.MAPSCO #ID# #SHAPE#";
selFieldList[23]="GIS.ADM.DA_BLK.BLOCK #ID# #SHAPE#";
selFieldList[24]="GIS.ADM.ABST.NAME GIS.ADM.ABST.NUMBER #ID# #SHAPE#";
selFieldList[25]="GIS.ADM.SUBD.NUMBER GIS.ADM.SUBD.VOLPAGE GIS.ADM.SUBD.NAME GIS.ADM.SUBD.DCADCITY GIS.ADM.SUBD.CITYNAME #ID# #SHAPE#";
selFieldList[26]="#ALL#";
selFieldList[27]="#ALL#";
selFieldList[28]="#ALL#";
selFieldList[29]="#ALL#";
selFieldList[30]="GIS.ADM.CITY.NAME #ID# #SHAPE#";
selFieldList[31]="GIS.ADM.ISD.NAME #ID# #SHAPE#";
selFieldList[32]="GIS.ADM.ZIPCODE.ZIPCODE GIS.ADM.ZIPCODE.PONAME #ID# #SHAPE#";



// use the field alias in the data display? 
//If true, a list must be defined in fieldAliasList[n] for each layer defining aliases for those fields needing them
var useFieldAlias=true;
// array for aliases for each layer's returned fields if useFieldAlias=true
var fieldAliasList  = new Array();
// sample set for world - fieldname:alias pairs separated by a bar (|)... if no aliases, use empty string ("")

fieldAliasList[0]="GIS.ADM.PARCEL.Acct:Account";
fieldAliasList[1]="GIS.ADM.PARCEL2011.Acct:Account";
fieldAliasList[2]="GIS.ADM.PARCEL2010.Acct:Account";
fieldAliasList[3]="GIS.ADM.PARCEL2009.Acct:Account";
fieldAliasList[4]="GIS.ADM.PARCEL2008.Acct:Account";
fieldAliasList[5]="GIS.ADM.PARCEL2007.Acct:Account";
fieldAliasList[6]="GIS.ADM.PARCEL2006.Acct:Account";
fieldAliasList[7]="";
fieldAliasList[8]="";
fieldAliasList[9]="";
fieldAliasList[10]="";
fieldAliasList[11]="";
fieldAliasList[12]="GIS.ADM.CONTOURS.Elevation:Elevation";
fieldAliasList[13]="";
fieldAliasList[14]="";
fieldAliasList[15]="";
fieldAliasList[16]="";
fieldAliasList[17]="";
fieldAliasList[18]="";
fieldAliasList[19]="";
fieldAliasList[20]="";
fieldAliasList[21]="GIS.ADM.NBHD.NBHD:Nbhd";
fieldAliasList[22]="GIS.ADM.MAPSCO.MAPSCO:Mapsco";
fieldAliasList[23]="GIS.ADM.DA_BLK.BLOCK:Block";
fieldAliasList[24]="GIS.ADM.ABST.NAME:Name|GIS.ADM.ABST.NUMBER:Number";
fieldAliasList[25]="GIS.ADM.SUBD.NUMBER:Number|GIS.ADM.SUBD.VOLPAGE:Vol&nbsp;Page|GIS.ADM.SUBD.NAME:Name|GIS.ADM.SUBD.DCADCITY: City&nbsp;Code|GIS.ADM.SUBD.CITYNAME:City&nbsp;Name";
fieldAliasList[26]="";
fieldAliasList[27]="";
fieldAliasList[28]="";
fieldAliasList[29]="";
fieldAliasList[30]="GIS.ADM.CITY.NAME:Name";
fieldAliasList[31]="GIS.ADM.ISD.NAME:Name";
fieldAliasList[32]="GIS.ADM.ZIPCODE:ZipCode|GIS.ADM.ZIPCODE:POName";


// Hide the ID field display? The ID Field must be included in field list, but we don't have to show it.
var hideIDFieldData = true;
// Hide the shape field display? The Shape Field must be included in field list, but we don't have to show it.
var hideShapeFieldData = true;


// parameters for setting up hyperlinks in data display
var hyperLinkLayers = new Array(); // layers to have hyperlink
var hyperLinkFields = new Array();	// field in those layers to be used for hyperlink
var hyperLinkPrefix = new Array();  // prefix (if any) to place before field value to make hyperlink url
var hyperLinkSuffix = new Array();  // suffix (if any) to place after field value to make hyperlink url
/*
hyperLinkLayers[0] = "Image";
hyperLinkFields[0] = "HOT";
hyperLinkPrefix[0] = "/gisdata/world/images/";
hyperLinkSuffix[0] = ".jpg";
*/

hyperLinkLayers[0] = "Parcel 2011";
hyperLinkFields[0] = "GIS.ADM.PARCEL2011.Acct";
hyperLinkPrefix[0] = "http://www.dallascad.org/AcctHistory.aspx?ID=";
hyperLinkSuffix[0] = "";

hyperLinkLayers[1] = "Parcel 2010";
hyperLinkFields[1] = "GIS.ADM.PARCEL2010.Acct";
hyperLinkPrefix[1] = "http://www.dallascad.org/AcctHistory.aspx?ID=";
hyperLinkSuffix[1] = "";

hyperLinkLayers[2] = "Parcel 2009";
hyperLinkFields[2] = "GIS.ADM.PARCEL2009.Acct";
hyperLinkPrefix[2] = "http://www.dallascad.org/AcctHistory.aspx?ID=";
hyperLinkSuffix[2] = "";

hyperLinkLayers[3] = "Parcel 2008";
hyperLinkFields[3] = "GIS.ADM.PARCEL2008.Acct";
hyperLinkPrefix[3] = "http://www.dallascad.org/AcctHistory.aspx?ID=";
hyperLinkSuffix[3] = "";

hyperLinkLayers[4] = "Parcel 2007";
hyperLinkFields[4] = "GIS.ADM.PARCEL2007.Acct";
hyperLinkPrefix[4] = "http://www.dallascad.org/AcctHistory.aspx?ID=";
hyperLinkSuffix[4] = "";

hyperLinkLayers[5] = "Parcel 2006";
hyperLinkFields[5] = "GIS.ADM.PARCEL2006.Acct";
hyperLinkPrefix[5] = "http://www.dallascad.org/AcctHistory.aspx?ID=";
hyperLinkSuffix[5] = "";

/*
hyperLinkLayers[0] = "Winners";
hyperLinkFields[0] = "MISC.SAG.ID";
hyperLinkPrefix[0] = "http://gis.esri.com/uc2001/sag/display/index.cfm?id=";
hyperLinkSuffix[0] = "";
*/


// will the returned data be displayed in text frame?
var showSelectedData=true;
// will the returned features be drawn?
var showSelectedFeatures=true;
// maximum number of features returned from query
var maxFeaturesReturned=26;
// for ID All - List all visible layers in response - default is false
	// if false only visible layers with idenitified features written to table
	// if true the names of all visible layers will be diplayed even if no features returned
var listAllLayersInIDAll = false;


// number of data samples retrieved for query form
var numberDataSamples = 50;



/**************************************
* Legend parameters - aimsLegend.js
**************************************/

// legend map size
var legWidth=196;
var legHeight=240;
var legFont="Arial";
var legTitle="";

/**************************************
* Options parameters - aimsOptions.js
**************************************/

// allowing user to set options
var allowOptions=false;

/**************************************
* ClassRender parameters - aimsClassRender.js
**************************************/

// parameters for custom class rendering... overrides default renderer
var ClassRenderLayer = new Array();  // layers to have custom renderers
var ClassRenderString = new Array(); // initial custom renderer XML string for the layers
ClassRenderLayer[0] = "Cities";
ClassRenderString[0] = "";
/*
ClassRenderString[0] ='<VALUEMAPRENDERER lookupfield="population">\n<RANGE LOWER="0" UPPER="1000000">\n<SIMPLEMARKERSYMBOL color="255,0,255" type="circle" size="4" />\n</RANGE>';
ClassRenderString[0] = ClassRenderString[0] + '<RANGE LOWER="1000000" UPPER="2500000">\n<SIMPLEMARKERSYMBOL color="255,0,255" type="circle" size="6" />\n</RANGE>';
ClassRenderString[0] = ClassRenderString[0] + '<RANGE LOWER="2500000" UPPER="5000000">\n<SIMPLEMARKERSYMBOL color="255,0,255" type="circle" size="9" />\n</RANGE>';
ClassRenderString[0] = ClassRenderString[0] + '<RANGE LOWER="5000000" UPPER="10000000">\n<SIMPLEMARKERSYMBOL color="255,0,255" type="circle" size="12" />\n</RANGE>';
ClassRenderString[0] = ClassRenderString[0] + '<RANGE LOWER="10000000" UPPER="30000000">\n<SIMPLEMARKERSYMBOL color="255,0,255" type="circle" size="16" />\n</RANGE>\n</VALUEMAPRENDERER>';
*/

/**************************************
* Geocode parameters - aimsGeocode.js
**************************************/

// maximum geocode candidates returned - default = 20
var maxGeocodeCandidates=20;
// minimal acceptable geocode score for candidate
var minGeocodeScore=50;
var geocodePointColor = "255,0,0";
var geocodePointSize = "15";
var geocodeLabelSize = "12";
var geocodePointType = "star";
var currentGeocodePointIndex = 0;

// custom functions needed for Reverse Geocoding - RouteServer extension required
var useReverseGeocode = false;
var useRoute=false;

// the starting point. . . it all starts here on loading
function checkParams() {
	
        appDir = getPath(document.location.pathname);

        // global for overview map. . . change if not on same frame as Map
	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 (parent.TOCFrame==null) hasTOC = false;
	if (parent.ModeFrame==null) useModeFrame = false;
	
	
	if (isIE)	{
		if (hasLayer("theTop")) document.all.theTop.style.cursor = "crosshair";
		if (hasOVMap) ovImageVar.style.cursor = "hand";
	}
		
	if (hasOVMap) {
		// size of ov map image
		i2Width = parseInt(ovImageVar.width);
		i2Height = parseInt(ovImageVar.height);
		forceNewOVMap = false;
		// position of ov map
		//ovMapLeft = iWidth - (i2Width + 6);
		//ovMapTop = 2;
	}
	if (webParams!="") {
		//alert(webParams);
		getCommandLineParams(webParams);

	}
	// if starting extents zero'd then flag to get start from mapservice
	if ((startLeft!=0) && (startRight!=0)) getStartingExtent=false;
	// if limit extents zero'd then flag to get max from mapservice
	if ((limitLeft!=0) && (limitRight!=0)) {
		getLimitExtent=false;
		enforceFullExtent=true;
	}
	if (ovBoxColor=="") ovBoxColor = "255,0,0";
	//ovBoxColor = convertHexToDec(ovBoxColor);
	checkCoords();
	if (aimsNavigationPresent) {
		// Set up event capture for mouse movement
		if (isNav4) {
			document.captureEvents(Event.MOUSEMOVE);
			document.captureEvents(Event.MOUSEDOWN);
			document.captureEvents(Event.MOUSEUP);
			//document.captureEvents(Event.MOUSEOUT);
		}
		document.onmousemove = getMouse;
		//document.onmousedown = chkMouseDown;
		document.onmousedown = mapTool;
		document.onmouseup = chkMouseUp;
		//document.onmouseout = chkMouseOut;
	} else {
		usePan=false;
		usePanNorth=false;
		usePanWest=false;
		usePanEast=false;
		usePanSouth=false;
		useMeasure=false;
		useZoomIn=false;
		useZoomOut=false
		//useFullExtent=false;
		useZoomActive=false;
		//useZoomLast=false;	
	}
	
	if (!aimsBufferPresent) {
		useBuffer=false;
	}
	if (!aimsQueryPresent) {
		aimsBufferPresent=false;
		useQuery=false;
		useFind=false;
		useBuffer=false;
		useStoredQuery=false;
	}
	if (!aimsSelectPresent) {
		aimsQueryPresent=false;
		aimsBufferPresent=false;
 		useSelect=false;
		useQuery=false;
		useFind=false;
		useBuffer=false;
		useStoredQuery=false;
		useClearSelect=false;
	}
	if (!aimsIdentifyPresent) {
		aimsSelectPresent=false;
		aimsQueryPresent=false;
		aimsBufferPresent=false;
		canQuery=false;
		useIdentify=false;
 		useSelect=false;
		useQuery=false;
		useFind=false;
		useBuffer=false;
		useStoredQuery=false;
		useHyperLink=false;
		useHyperLinkAny=false;
		useIdentifyAll=false;
	}
	if (!aimsGeocodePresent) {
		useGeocode=false;
		useReverseGeocode=false;
	}
	if (!aimsPrintPresent) {
		usePrint=false;
	}
	if (!aimsOptionsPresent) {
		allowOptions=false;
	}
	if ((aimsXMLPresent) && (aimsMapPresent)) {
		if (aimsClickPresent) clickFunction("zoomin");
		if (parent.ToolFrame!=null) parent.ToolFrame.document.location="toolbar.htm";
		startMap();
	} else {
		alert(msgList[0]);
	}
}
