//*********************************************************************
//*			  USGS_NATMAP_OgcParams.js
//*********************************************************************

nmOgcParamsPresent = true;

//Define all the variables used in the custom categories of toc.htm

var TOC_Hash = 'theTop';

// ======================== THEME ARRAYS ==============================

// This is the Theme listing in order of display in TOC 
// Elements stored are the theme names, eg. "TRANSPORTATION"; numerically indexed
var ThemeName = new Array();

// This is the Class listing in order of display in TOC;
// in parallel with the ThemeName array. Numerically indexed.
// Contains a pipe '|' separated list of numbers. Each number in the list 
// is an index into the Class* arrays for classes in the Theme.
// Order of index in list is the order the class is listed in the theme.
var ThemeClassMap = new Array();

// Whether a theme twist-tie is expanded or collapsed (true = expanded)
// Numerically indexed
var ThemeExpanded = new Array();

// ======================== CLASS ARRAYS ==============================

// All are numerically indexed and parallel.
var ClassName      = new Array();
var ClassID        = new Array();
var ClassVisible   = new Array(); // true false 
var ClassLayerMap  = new Array(); // pipe-separated list of WMS layers belonging to the class 
var ClassThemeName = new Array(); // string - corresponds to enclosing ThemeName value  

// ======================== WMS LAYER ARRAYS ==============================

// All arrays are parallel and have the same length.
// These Arrays get refreshed each map load, contain all 
// possible layers at a given scale and extent
var WmsLayerId          = new Array(); // number correspondes to Id in Catalog
var WmsLayerName        = new Array(); // string
var WmsLayerTitle       = new Array(); // string
var WmsLayerRecommended = new Array(); // true false
var WmsLayerQueryable   = new Array(); // true false
var WmsLayerTransparent = new Array(); // true false
var WmsLayerExtractable = new Array(); // true false
var WmsLayerVisible     = new Array(); // true false
var WmsLayerZDepth      = new Array(); // number
var WmsLayerLogoUrl     = new Array(); // string
var WmsLayerMetadataUrl = new Array(); // string
var WmsLayerCapDocUrl   = new Array(); // string
var WmsLayerServiceName = new Array(); // string
var WmsLayerDescription = new Array(); // string
var WmsLayerLegendUrl   = new Array(); // string
var WmsLayerPartnerName = new Array(); // string
var WmsLayerPartnerUrl  = new Array(); // string
var WmsLayerClassId     = new Array(); // string - enclosing (catalog) class id

// Arrays to hold additional layer ids to be added to  
// request (vis or hidden). Example: Used when zooming to a GNIS feature
// from an arbitrary starting scale. Saves having to send
// two requests: one to zoom to scale where GNIS layers are visible,
// another to turn GNIS layer on.
// Cleared upon every request to middleware.
// Contains catalog layer ids 
var AddVisibleLayers = new Array(); 
var AddHiddenLayers  = new Array(); 

// Structures to hold GETFEATUREINFO response data
var FeatureInfoQueryUrls   = new Array(); // string
var FeatureInfoLayerId     = new Array(); // number
var FeatureInfoLayerTitle  = new Array(); // string
var FeatureInfoLayerFormat = new Array(); // string

// ======================== MAP STACK ARRAYS ===================================
// parallel arrays to hold attributes of the available map images returned by response
// These Arrays get refreshed with each new extent
var MapStackUrl          = new Array(); // string, the url of the WMS request for the map image
var MapStackWmsLayerId   = new Array(); // number
                                        // The catalog id of the wms layer or layers represented in the Image.
                                        // For Image that has multible ids, value is a comma separated list of ids
var MapStackVisible      = new Array(); // boolean

// ======================== DISPLAY STACK ARRAYS ===============================
// parallel arrays to hold attributes of DHTML layers used to diplay maps
// these attributes are used for populating the DHTML Layers for showing the map
// The last three Arrays get refreshed with each new extent
var DisplayStackLayerName  = new Array(); // string, the name of DHTML Layer associated with this element
var DisplayStackImgName    = new Array(); // string, the name of img tag in DHTML Layer associated with this element
var DisplayStackCurrSrc  = new Array(); // string, src of image to be shown in this layer for new map draw
var DisplayStackCurrVisible  = new Array(); // boolean, if should be shown in new map draw
var DisplayStackPrevSrc  = new Array(); // string, src of image previously shown in this layer for last map draw
var DisplayStackPrevVisible = new Array(); //boolean, if was visible

