function Layer(name,group,status,minscale,maxscale,type,connectiontype,norm_style,sel_style,hov_style,label_fields,default_label_field,extent,metadata)
{
  this.name = name;
  this.group = group;
  this.default_status = status;
  this.status = status;
  this.minscale = minscale;
  this.maxscale = maxscale;
  this.type = type;
  this.connectiontype = connectiontype;
  this.norm_style = norm_style;
  this.sel_style = sel_style;
  this.hov_style = hov_style;
  this.label_fields = label_fields;
  this.default_label_field = default_label_field;
  this.extent = extent;
  this.metadata = metadata;
}
Layer.MS_OFF = 0;
Layer.MS_ON = 1;
Layer.MS_DEFAULT = 2;
Layer.MS_DELETE = 4;

Layer.MS_LAYER_POINT = 0;
Layer.MS_LAYER_LINE = 1;
Layer.MS_LAYER_POLYGON = 2;
Layer.MS_LAYER_RASTER = 3;
Layer.MS_LAYER_ANNOTATION = 4;
Layer.MS_LAYER_QUERY = 5;
Layer.MS_LAYER_CIRCLE = 6;
Layer.MS_LAYER_TILEINDEX = 7;

Layer.MS_POSTGIS = 6;
Layer.MS_ORACLESPATIAL = 8;
Layer.MS_MYGIS = 11;

Layer.lightenAmount = 30;

Layer.extractColors = function(rgb_str)
{
  var c_arr = null;
  if (rgb_str)
  {
    c_arr = rgb_str.match(/^\s*rgb\s*\(\s*(\d{1,3})[,\s]*(\d{1,3})[,\s]*(\d{1,3})\s*\)\s*$/);
  }
  return c_arr;
}

Layer.invertColor = function(rgb_str)
{
  var inv = null;
  var a = Layer.extractColors(rgb_str);
  if (a)
  {
    var dark_amt = 255 - Layer.lightenAmount;
    inv = 'rgb(' + Math.max(dark_amt - parseInt(a[1]), 0) + ',' + Math.max(dark_amt - parseInt(a[2]), 0) + ',' + Math.max(dark_amt - parseInt(a[3]), 0) + ')';
  }
  return inv;
}

Layer.lightenColor = function(rgb_str)
{
  var ltn = null;
  var a = Layer.extractColors(rgb_str);
  if (a)
  {
    var la = Layer.lightenAmount;
    ltn = 'rgb(' + Math.min(parseInt(a[1]) + la, 255) + ',' + Math.min(parseInt(a[2]) + la, 255) + ',' + Math.min(parseInt(a[3]) + la, 255) + ')';
  }
  return ltn;
}



Layer.prototype.isStatusVis = function()
{
  return (this.status == Layer.MS_ON || this.status == Layer.MS_DEFAULT);
}

Layer.prototype.setStatusVis = function(visBool)
{
  this.status = visBool ? Layer.MS_ON : Layer.MS_OFF;
}

Layer.prototype.isTypeRaster = function()
{
  return (this.type == Layer.MS_LAYER_RASTER || this.type == Layer.MS_LAYER_TILEINDEX);
}

Layer.prototype.isTypeVector = function()
{
  return (this.type == Layer.MS_LAYER_POINT ||
    this.type == Layer.MS_LAYER_LINE ||
    this.type == Layer.MS_LAYER_POLYGON);
}

Layer.prototype.isTypePoint = function()
{
  return (this.type == Layer.MS_LAYER_POINT);
}

Layer.prototype.isTypeLine = function()
{
  return (this.type == Layer.MS_LAYER_LINE);
}

Layer.prototype.isTypePolygon = function()
{
  return (this.type == Layer.MS_LAYER_POLYGON);
}

Layer.prototype.isTypeAnnotation = function()
{
  return (this.type == Layer.MS_LAYER_ANNOTATION);
}

Layer.prototype.buildIconElement = function()
{
  var icon = null;
  if (this.isTypeRaster())
  {
    icon = document.createElement('img');
    icon.width = icon.height = 12;
    icon.src = "http://reportallusa.com/images/raster.png";
    icon.style.marginRight = '3px';
  }
  else if (this.norm_style !== null)
  {
    icon = document.createElement('span');
    icon.style.display = 'inline-block';
    icon.style.fontSize = '1px';
    icon.style.lineHeight = '1px';
    icon.style.marginRight = '3px';
    icon.style.width = icon.style.height = '10px';
    $(icon).css('float','left');
    icon.style.marginTop = '2px';
    if (this.type == Layer.MS_LAYER_LINE) 
    {
      icon.style.height = (this.norm_style.stroke_width / 2.0) + 'px';
      //icon.style.verticalAlign = 'bottom';
      icon.style.marginTop = '7px';
    }
    icon.style.border = '1px solid transparent';
    if (this.norm_style.fill !== null)
    {
      icon.style.backgroundColor = this.norm_style.fill;
    }
    if (this.norm_style.stroke !== null)
    {
      icon.style.borderColor = this.norm_style.stroke; 
    }
    else
    {
      if (jQuery.browser.msie && jQuery.browser.version < 7)
      {
        icon.style.borderWidth = '0px';
      }
    }
    if (this.norm_style.stroke_width !== null)
    {
      icon.style.borderWidth = this.norm_style.stroke_width + 'px';
    }
  }
  return icon;
}

Layer.prototype.isConnectionTypeDb = function()
{
  return (this.connectiontype == Layer.MS_POSTGIS || this.connectiontype == Layer.MS_ORACLESPATIAL || this.connectiontype == Layer.MS_MYGIS);
}

Layer.prototype.isVisibleAtScale = function(scaleDenom)
{
  if (!scaleDenom)
  {
    scaleDenom = MapTool.getMapExtRect().getScaleDenom(ol_mapObj.getSize().w);
  }
  var enabled = ((this.minscale == -1 || this.minscale <= scaleDenom) && (this.maxscale == -1 || this.maxscale >= scaleDenom));
  return enabled;
}

Layer.prototype.getNormStyle = function()
{
  return this.norm_style;
}

Layer.prototype.getSelStyle = function()
{
  if (this.sel_style == null)
  {
    var ns = this.getNormStyle();
    var sw = ns.stroke_width;
    var fill = Layer.invertColor(ns.fill);
    var stroke = Layer.invertColor(ns.stroke);
    if (this.isTypeLine())
    {
      sw = Math.max(sw, 4);
      stroke = fill;
      fill = null;
    }
    this.sel_style = new Layer.Style(fill, stroke, sw, Math.min(ns.fill_opacity, 0.5), ns.symbol_size);
  }
  return this.sel_style;
}

Layer.prototype.getHovStyle = function()
{
  if (this.hov_style == null)
  {
    var ss = this.getSelStyle();
    this.hov_style = new Layer.Style(Layer.lightenColor(ss.fill), Layer.lightenColor(ss.stroke), Math.max(ss.stroke_width, 2), ss.fill_opacity);
  }
  return this.hov_style;
}

Layer.prototype.getRowElement = function()
{
  return document.getElementById('lRow_' + this.name.replace(/ /g,'_'));
}

Layer.prototype.isGroup = function()
{
  return false;
}

Layer.prototype.isTopLevel = function()
{
  return !this.group;
}

Layer.prototype.getLabelFields = function()
{
  return this.label_fields;
}

Layer.prototype.getDefaultLabelField = function()
{
  return this.default_label_field;
}

Layer.prototype.isBasemap = function()
{
  return (this.metadata ? (!(!this.metadata.basemap)) : false);
}

Layer.Style = function(color, outline_color, stroke_width, fill_opacity, symbol_size)
{
  this.fill = color;
  this.stroke = outline_color;
  this.stroke_width = stroke_width;
  this.fill_opacity = fill_opacity;
  this.stroke_opacity = 1.0;
  this.symbol_size = symbol_size;
}

function LayerTree(inpLayers)
{
  this.layerArr = new Array();
  this.layerHash = new Object();
  this.mapfile = null;
  this.metadata = new Object();

  if (inpLayers)
  {
    for (var i=0; i<inpLayers.length; ++i)
    {
      var layer = inpLayers[i];
      this.push(layer);
    }
  }
}

LayerTree.MS_OFF = 0;
LayerTree.MS_ON = 1;

LayerTree.prototype.isStatusOn = function()
{
  return (this.status == LayerTree.MS_ON);
}

LayerTree.prototype.getMapName = function()
{
  var ms = this.mapfile.split('/');
  var mfname = ms[ms.length - 1];
  var ms_dot = mfname.indexOf('.');
  return mfname.substr(0, ms_dot);
}

// if the map has a layer with STATUS DEFAULT, its a basemap
LayerTree.prototype.isBasemap = function()
{
  for (var i=0; i<this.layerArr.length; ++i)
  {
    if (this.layerArr[i].status == Layer.MS_DEFAULT)
    {
      return true;
    }
  }
  return false;
}

LayerTree.prototype.push = function(inpLayer)
{
  //alert('pushing ' + inpLayer.name);
  this.layerArr.push(inpLayer);
  this.layerHash[inpLayer.name] = inpLayer;
}

LayerTree.prototype.getCgiLayerStr = function()
{
  var lStr = '';
  for (var i=0; i<this.layerArr.length; ++i)
  {
    var layer = this.layerArr[i];
    if (layer.isStatusVis())
    {
      if (lStr != '')
      {
        lStr += '&';
      }
      lStr += 'layer=' + layer.name;
    }
  }
  return lStr;
}

/// returns layers which match boolean func
LayerTree.prototype.getFuncLayers = function(func)
{
  var ln = new LayerTree();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    var layer = this.layerArr[i];
    if (func.call(layer))
    {
      ln.push(layer);
    }
  }
  return ln;
}

LayerTree.prototype.getEnabledLayers = function()
{
  return this.getFuncLayers(Layer.prototype.isStatusVis);
}

LayerTree.prototype.getVisibleLayers = function(scaleDenom)
{
  var ln = new LayerTree();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    var layer = this.layerArr[i];
    if (layer.isStatusVis() && layer.isVisibleAtScale(scaleDenom))
    {
      ln.push(layer);
    }
  }
  return ln;
}

LayerTree.prototype.getLayerNames = function()
{
  var ln = new Array();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    ln.push(this.layerArr[i].name);
  }
  return ln;
}

LayerTree.prototype.getLayerRowElems = function()
{
  var ln = new Array();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    ln.push(this.layerArr[i].getRowElement());
  }
  return ln;
}

LayerTree.prototype.getRasterLayers = function()
{
  return this.getFuncLayers(Layer.prototype.isTypeRaster);
}

LayerTree.prototype.getVectorLayers = function()
{
  var lt = new LayerTree();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    var l = this.layerArr[i];
    if (l.isTypeVector()) lt.push(l);
  }
  return lt;
  //this.getFuncLayers(Layer.prototype.isTypeVector);
}

LayerTree.prototype.getConnectionTypeDbLayers = function()
{
  var lt = new LayerTree();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    var layer = this.layerArr[i];
    if (layer.isConnectionTypeDb()) lt.push(layer);
  }
  return lt;
  //return this.getFuncLayers(Layer.prototype.isConnectionTypeDb);
}

LayerTree.prototype.getTopLevelLayers = function()
{
  var lt = new LayerTree();
  for (var i=0; i<this.layerArr.length; ++i)
  {
    if (this.layerArr[i].isTopLevel())
    {
      lt.push(this.layerArr[i]);
    }
  }
  return lt;
}

LayerTree.prototype.getImagetype = function(scaleDenom)
{
  //return (this.getRasterLayers().getVisibleLayers(scaleDenom).getLength() > 0) ? 'AGG_JPEG' : 'AGG_PNG8';
  return (this.getRasterLayers().getLength() > 0) ? 'AGG_JPEG' : 'AGG_PNG8';
}

LayerTree.prototype.getLayerByName = function(layerName)
{
  return this.layerHash[layerName];
}

LayerTree.prototype.getLayerById = function(layerId)
{
  return this.layerArr[layerId];
}

LayerTree.prototype.getLength = function()
{
  return this.layerArr.length;
}

LayerTree.defaultLayerTree = new LayerTree();

LayerTree.root = new Object();

LayerTree.getBaseBranches = function()
{
  var bb = [ ];
  for (var mapfile in LayerTree.root)
  {
    var branch = LayerTree.root[mapfile];
    if (branch.isBasemap())
    {
      bb.push(branch);
    }
  }
  return bb;
}

LayerTree.getNonBaseBranches = function()
{
  var nbb = [ ];
  for (var mapfile in LayerTree.root)
  {
    var branch = LayerTree.root[mapfile];
    if (!branch.isBasemap())
    {
      nbb.push(branch);
    }
  }
  return nbb;
}

LayerTree.root.Aerial = new LayerTree();
LayerTree.root.Aerial.mapfile = 'siteroot/Aerial.map';
LayerTree.root.Aerial.status = 0;
LayerTree.root.Aerial.push(new Layer('Blue Marble Imagery',null,2,1000000,-1,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Global Mosaic Imagery',null,2,-1,1000000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Ohio OSIP Imagery',null,2,-1,50000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Florida E 2ft',null,2,-1,100000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Florida N 2ft',null,2,-1,100000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Florida W 2ft',null,2,-1,100000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('OSIP-Imagery-N','OSIP-Imagery-N',2,-1,-1,3,7, null, null, null, null, null, null, {"basemap":"1"}));
LayerTree.root.Aerial.push(new Layer('Mass','Mass',2,-1,-1,3,7, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Penn','Penn',2,-1,-1,3,7, null, null, null, null, null, null, {"basemap":"1"}));
LayerTree.root.Aerial.push(new Layer('US Counties','US Counties',2,-1,-1,2,6, new Layer.Style(null,'rgb(0,0,0)',null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','county_name','state_name','num_parcels','state_id','last_updated','population_2000','population_2004','auditor_url','recorder_url','state_abbr','parcel_attrs','ansi_code','full_name','lsad','classfp','funcstat'], 'county_name', [-13885234,2819924,-7452828,6340332.5], null));
LayerTree.root.Aerial.push(new Layer('Geauga County 2008 4in',null,2,-1,50000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Cuyahoga County 2008 6in',null,2,-1,50000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Jackson County OH 2005 6in',null,2,-1,50000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Franklin County OSIP',null,2,-1,50000,3,1, null, null, null, null, null, null, null));
LayerTree.root.Aerial.push(new Layer('Streets',null,2,-1,50000,1,6, new Layer.Style('rgb(0,0,0)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','ogc_fid','fedirp','fename','fetype','fedirs','cfcc','source'], 'fename', [-13825665,2034214.875,-7332117.5,6274464], null));
LayerTree.root.Aerial.push(new Layer('Rail',null,2,-1,3000,1,6, new Layer.Style(null,null,null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','tlid','county_id','fename','cfcc','source'], null, [-13813704,2947163.25,-7485219,6273928], null));
LayerTree.root.Aerial.push(new Layer('Misc Transport',null,2,-1,35000,1,6, new Layer.Style('rgb(40,100,40)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','tlid','county_id','fename','cfcc','source'], 'fename', [-13852209,3048172.25,-7573720.5,6253615.5], null));

LayerTree.root.Overlays = new LayerTree();
LayerTree.root.Overlays.mapfile = 'siteroot/Overlays.map';
LayerTree.root.Overlays.status = 1;
LayerTree.root.Overlays.push(new Layer('Parcels',null,1,-1,40000,2,6, new Layer.Style(null,'rgb(255,167,72)',null,0,null), new Layer.Style('rgb(230,170,170)','rgb(200,0,0)',null,0,null), new Layer.Style('rgb(144,238,144)','rgb(0,128,0)',null,0.5,null), ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','parcel_id','addr_number','addr_street_prefix','addr_street_name','addr_street_suffix','addr_street_type','owner','trans_date','sale_price','bldg_sqft','ngh_code','land_use_code','acreage','muni_id','school_dist_id','mkt_val_tot','mkt_val_land','mkt_val_bldg','zip_code','load_table_gid','is_parid_uniq','orig_addr','xattr'], null, [-19951913.227845,-1643352.8198073,20021888.103161,11554793.570993], null));
LayerTree.root.Overlays.push(new Layer('Parcel Labels',null,0,-1,2000,4,6, new Layer.Style(null,null,null,null,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','parcel_id','addr_number','addr_street_prefix','addr_street_name','addr_street_suffix','addr_street_type','owner','trans_date','sale_price','bldg_sqft','ngh_code','land_use_code','acreage','muni_id','school_dist_id','mkt_val_tot','mkt_val_land','mkt_val_bldg','zip_code','load_table_gid','is_parid_uniq','orig_addr','xattr'], 'parcel_id', [-19951913.227845,-1643352.8198073,20021888.103161,11554793.570993], null));
LayerTree.root.Overlays.push(new Layer('Census Blocks',null,0,-1,75000,2,6, new Layer.Style(null,'rgb(255,234,0)',null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','state','logrecno','county_id','tract','block','blkgrp','population','families','avg_household_size','families_married_w_children','families_married_wo_children','households','median_age','pct_population_65_plus','pct_population_18_minus','avg_family_size','single_mothers_w_children','single_fathers_w_children','pct_65_plus_in_nursing'], 'population', [-13845063,2947414.5,-7485589.5,6271260], null));
LayerTree.root.Overlays.push(new Layer('Census Block Groups',null,0,-1,100000,2,6, new Layer.Style('rgb(217,241,248)','rgb(17,168,154)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','state','logrecno','county_id','tract','blkgrp','travel_time_min','median_hh_income','per_capita_income','median_year_built','total_housing_units','median_rooms_in_bldg','median_gross_rent','pct_college_degrees_25_older','median_housing_value','median_real_estate_taxes'], 'median_hh_income', [-13825423,2941784.75,-7560723.5,6274979], null));
LayerTree.root.Overlays.push(new Layer('Flood Zones Ohio',null,0,-1,500000,2,6, new Layer.Style('rgb(0,177,182)','rgb(0,60,150)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','area','perimeter'], null, [-9442094,4637393.5,-8963320,5153098.5], null));
LayerTree.root.Overlays.push(new Layer('Floodway',null,0,-1,500000,2,6, new Layer.Style('rgb(143,68,54)','rgb(243,128,133)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','area','perimeter'], null, [-9442122,4640201.5,-8963325,5147385.5], null));
LayerTree.root.Overlays.push(new Layer('Tree Coverage',null,0,-1,-1,2,6, new Layer.Style('rgb(160,210,20)','rgb(50,0,0)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','id','f_code','f_code_des','dmt','dmt_descri','exs','exs_descri','nam','nam_descri','pht','pht_descri','veg','veg_descri','tile_id','fac_id'], null, [-20022496,1179956.125,-1816134.625,10849832], null));
LayerTree.root.Overlays.push(new Layer('Hydrography',null,0,-1,500000,1,6, new Layer.Style('rgb(0,130,205)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','tlid','county_id','fename','cfcc'], 'fename', [-13823518,2033399.25,-7418455.5,6269164], null));
LayerTree.root.Overlays.push(new Layer('Wetlands','Wetlands',0,-1,-1,2,6, new Layer.Style('rgb(66,180,70)','rgb(0,0,250)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','area','perimeter','grid_code'], 'grid_code', [-9440746,4640332.5,-8963376,5153161], null));
LayerTree.root.Overlays.push(new Layer('EPA Incident Sites',null,0,-1,-1,0,6, new Layer.Style('rgb(0,0,0)',null,null,100,22), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','reg_id','fac_name','loc_add','loc_city','loc_state','loc_zip','latitude83','longitude8','latitude','longitude','hor_datum','col_mth','ref_name','src_scale','fac_url','afs_url','cerc_url','pcs_url','tsd_url','lqg_url','tri_url','acres_url','corract_ur','st_tsd_url','rmp_url','ssts_url','cerc1','cerc1_int','cerc1_name','cerc2','cerc2_int','cerc2_name','pcs1','pcs1_int','pcs1_name','pcs2','pcs2_int','pcs2_name','pcs3','pcs3_int','pcs3_name','pcs4','pcs4_int','pcs4_name','pcs5','pcs5_int','pcs5_name','rcra1','rcra1_int','rcra1_name','rcra2','rcra2_int','rcra2_name','rcra3','rcra3_int','rcra3_name','rcra4','rcra4_int','rcra4_name','rcra5','rcra5_int','rcra5_name','rcra6','rcra6_int','rcra6_name','tris1','tris1_int','tris1_name','tris2','tris2_int','tris2_name','tris3','tris3_int','tris3_name','tris4','tris4_int','tris4_name','tris5','tris5_int','tris5_name','tris6','tris6_int','tris6_name','tris7','tris7_int','tris7_name','afs1','afs1_int','afs1_name','afs2','afs2_int','afs2_name','afs3','afs3_int','afs3_name','afs4','afs4_int','afs4_name','afs5','afs5_int','afs5_name','afs6','afs6_int','afs6_name','afs7','afs7_int','afs7_name','afs8','afs8_int','afs8_name','afs9','afs9_int','afs9_name','afs10','afs10_int','afs10_name','afs11','afs11_int','afs11_name','afs12','afs12_int','afs12_name','afs13','afs13_int','afs13_name','afs14','afs14_int','afs14_name','acres1','acres1_int','acres1_nam','acres2','acres2_int','acres2_nam','rmp1','rmp1_int','rmp1_name','rmp2','rmp2_int','rmp2_name','rmp3','rmp3_int','rmp3_name','ssts1','ssts1_int','ssts1_name','ssts2','ssts2_int','ssts2_name','ssts3','ssts3_int','ssts3_name','ssts4','ssts4_int','ssts4_name'], null, [-13829110,2931454.75,-7562953,6265958], null));
LayerTree.root.Overlays.push(new Layer('PowerGrid',null,0,-1,-1,1,6, new Layer.Style('rgb(118,59,24)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','id','f_code','f_code_des','tile_id','edg_id'], null, [-14127356,1532952.375,-6003901,7754405], null));
LayerTree.root.Overlays.push(new Layer('Metro Statistical Areas',null,0,-1,-1,2,6, new Layer.Style(null,'rgb(0,0,0)',null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','cbsa','cbsa_name','type','status','geocode'], null, [-13885234,2024070.5,-7298670,6275285], null));
LayerTree.root.Overlays.push(new Layer('Watersheds',null,0,-1,-1,2,6, new Layer.Style('rgb(0,30,0)','rgb(0,200,200)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','huc_8','huc_10','huc_12','acres','ncontrb_a','hu_10_gnis','hu_12_gnis','hu_10_ds','hu_10_name','hu_10_mod','hu_10_type','hu_12_ds','hu_12_name','hu_12_mod','hu_12_type','meta_id','states'], null, [-13889498,2965172.25,-7445653,6275281], null));

LayerTree.root.Street_Map = new LayerTree();
LayerTree.root.Street_Map.mapfile = 'siteroot/Street_Map.map';
LayerTree.root.Street_Map.status = 0;
LayerTree.root.Street_Map.push(new Layer('Countries','Countries',2,-1,-1,2,6, new Layer.Style('rgb(255,255,204)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','left_fid','right_fid'], null, [-15696382,-6868723,15795121,11097707], null));
LayerTree.root.Street_Map.push(new Layer('States','States',2,-1,4000000,2,6, new Layer.Style('rgb(0,0,0)',null,null,100,2), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','state_id','state_name','state_abbr'], 'state_name', [-18924338,1087591.625,5320252.5,12338868], null));
LayerTree.root.Street_Map.push(new Layer('US Counties','US Counties',2,4000,2500000,2,6, new Layer.Style('rgb(250,255,204)','rgb(0,0,0)',null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','county_name','state_name','num_parcels','state_id','last_updated','population_2000','population_2004','auditor_url','recorder_url','state_abbr','parcel_attrs','ansi_code','full_name','lsad','classfp','funcstat'], 'county_name', [-13885234,2819924,-7452828,6340332.5], null));
LayerTree.root.Street_Map.push(new Layer('US Counties Loaded','US Counties Loaded',2,25000,-1,2,6, new Layer.Style('rgb(150,204,93)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','county_name','state_name','num_parcels','state_id','last_updated','population_2000','population_2004','auditor_url','recorder_url','state_abbr','parcel_attrs','ansi_code','full_name','lsad','classfp','funcstat'], null, [-13885234,2819924,-7452828,6340332.5], null));
LayerTree.root.Street_Map.push(new Layer('Municipalities','Municipalities',2,-1,400000,2,6, new Layer.Style('rgb(213,168,88)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','cousubcu','muni_id','muni_name','census_class_code','muni_type','state_id'], 'muni_name', [-13867118,2830724.25,-7474359,6275240.5], null));
LayerTree.root.Street_Map.push(new Layer('Inland Lakes/Water',null,2,-1,-1,2,6, new Layer.Style('rgb(186,213,232)','rgb(0,20,150)',null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','id','f_code','f_code_des','hyc','hyc_descri','nam','nam_descri','tile_id','fac_id'], null, [-18559176,1478590.5,-1668326,14962817], null));
LayerTree.root.Street_Map.push(new Layer('Interstates','Interstates',2,1000,10000000,1,6, new Layer.Style('rgb(0,0,0)','rgb(0,0,0)',null,100,18), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','gid','status','signt1','signn1'], null, [-14818094,2031864.125,-7308225.5,7468934], null));
LayerTree.root.Street_Map.push(new Layer('Streets',null,2,-1,50000,1,6, new Layer.Style('rgb(0,0,0)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','county_id','ogc_fid','fedirp','fename','fetype','fedirs','cfcc','source'], 'fename', [-13825665,2034214.875,-7332117.5,6274464], null));
LayerTree.root.Street_Map.push(new Layer('Rail',null,2,-1,3000,1,6, new Layer.Style(null,null,null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','tlid','county_id','fename','cfcc','source'], null, [-13813704,2947163.25,-7485219,6273928], null));
LayerTree.root.Street_Map.push(new Layer('Misc Transport',null,2,-1,35000,1,6, new Layer.Style('rgb(40,100,40)',null,null,100,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','tlid','county_id','fename','cfcc','source'], 'fename', [-13852209,3048172.25,-7573720.5,6253615.5], null));
LayerTree.root.Street_Map.push(new Layer('State Border','State Border',2,-1,-1,1,6, new Layer.Style(null,null,null,0,null), null, null, ['tableoid','cmax','xmax','cmin','xmin','ctid','state_id','state_name','state_abbr'], null, [-18924338,2024070.5,5320252.5,9077679], null));

LayerTree.root.Web_Resources = new LayerTree();
LayerTree.root.Web_Resources.mapfile = 'siteroot/Web_Resources.map';
LayerTree.root.Web_Resources.metadata['single_tile'] = true;
LayerTree.root.Web_Resources.status = 1;
LayerTree.root.Web_Resources.push(new Layer('Weather-Radar(Live)',null,0,-1,-1,3,7, null, null, null, null, null, null, null));
LayerTree.root.Web_Resources.push(new Layer('Storm Precip. Total',null,0,-1,-1,3,7, null, null, null, null, null, null, null));
LayerTree.root.Web_Resources.push(new Layer('FEMA DFIRM Flood Maps','FEMA DFIRM Flood Maps',0,-1,20000,3,7, null, null, null, null, null, null, null));
LayerTree.root.Web_Resources.push(new Layer('USGS Topo',null,0,6000,-1,3,7, null, null, null, null, null, null, {"basemap":"1"}));


