/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Global Config */
/*---------------------------------------------------------------------------------------------------------------------------------------*/
var weedsvar = "";
var weedData = new Array; //for the data about weeds
var windowOpen = 0;
var maxWeedResults = 70; //load from a config file
var plantNumId = '0000';
var features;
var numWeedsInt = 0;
var map;
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";

var host = "http://hermes.freac.fsu.edu";
var baseRequestFolderURL = "http://hermes.freac.fsu.edu/requests/"

/*These change for each map*/
var EPSG = "EPSG:2284" //Projection
var imiStateCode = "va" //Statecode
var imiStateFullName = "Virginia" //State Name

var filters = [{'plid':"plantSNameSelect", 'filter':'scientific'}]
var listToClear = null;

var sciname = "species_na";
var comname = "common_nam";

/*Set the field to use for the atlas links.  Will usually be either plantid_number or usda_sybmol*/
var atlasField = "plantid_number";
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Map Config */
/*---------------------------------------------------------------------------------------------------------------------------------------*/
function loadMapConfig()
{	
	/*Controls - if null, use default controls.*/
		/*Otherwise, pass in the desired controls as strings 
			ex - var controls = "nav, zi, zo"; */
	var controls = null;

	/*Bounds - [mixx,miny,maxx,maxy]*/
	var bounds = [9960000, 3340000, 12430000, 4440000];
	
	/*Number of zoom levels - default 10*/
	var numZoomLevels = 10;
	
	/*WMS Server URL - set the WMS server URL*/
	var wmsServerURL = "http://bsm07.freac.fsu.edu:8399/arcgis/services/imI_Virginia2/MapServer/WMSServer?"
	
	/*Overview Map - If includeOverview is "no" or null / undefined, the overview map will not be included*/
	var includeOverview = "yes"; //Show the overview map
	
	/*Scalebar - If includeScalebar is "no" or null / undefined, the scalebar will not be included*/
	var includeScalebar = "yes"; //Show the scalebar
	
	/*Load the map with the above settings*/
	loadMap(controls, bounds, numZoomLevels, wmsServerURL, includeOverview, includeScalebar);
}

/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* Array Config */
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/*Each array is created in a function and the return value is the array itself. createLayout.js calls the function and uses the returned array*/
function loadCounties(){
	var counties = new Array();
		counties[0] = "Select County"
		counties[1] = "Accomack"
		counties[2] = "Albemarle"
		counties[3] = "Alleghany"
		counties[4] = "Amelia"
		counties[5] = "Amherst"
		counties[6] = "Appomattox"
		counties[7] = "Arlington"
		counties[8] = "Augusta"
		counties[9] = "Bath"
		counties[10] = "Bedford"
		counties[11] = "Bland"
		counties[12] = "Botetourt"
		counties[13] = "Brunswick"
		counties[14] = "Buchanan"
		counties[15] = "Buckingham"
		counties[16] = "Campbell"
		counties[17] = "Caroline"
		counties[18] = "Carroll"
		counties[19] = "Charles City"
		counties[20] = "Charlotte"
		counties[21] = "Chesterfield"
		counties[22] = "City of Alexandria"
		counties[23] = "City of Bedford"
		counties[24] = "City of Bristol"
		counties[25] = "City of Buena Vista"
		counties[26] = "City of Charlottesville"
		counties[27] = "City of Chesapeake"
		counties[28] = "City of Colonial Heights"
		counties[29] = "City of Covington"
		counties[30] = "City of Danville"
		counties[31] = "City of Emporia"
		counties[32] = "City of Fairfax"
		counties[33] = "City of Falls Church"
		counties[34] = "City of Franklin"
		counties[35] = "City of Fredericksburg"
		counties[36] = "City of Galax"
		counties[37] = "City of Hampton"
		counties[38] = "City of Harrisonburg"
		counties[39] = "City of Hopewell"
		counties[40] = "City of Lexington"
		counties[41] = "City of Lynchburg"
		counties[42] = "City of Manassas"
		counties[43] = "City of Manassas Park"
		counties[44] = "City of Martinsville"
		counties[45] = "City of Newport News"
		counties[46] = "City of Norfolk"
		counties[47] = "City of Norton"
		counties[48] = "City of Petersburg"
		counties[49] = "City of Poquoson"
		counties[50] = "City of Portsmouth"
		counties[51] = "City of Radford"
		counties[52] = "City of Richmond"
		counties[53] = "City of Roanoke"
		counties[54] = "City of Salem"
		counties[55] = "City of Staunton"
		counties[56] = "City of Suffolk"
		counties[57] = "City of Virginia Beach"
		counties[58] = "City of Waynesboro"
		counties[59] = "City of Williamsburg"
		counties[60] = "City of Williamsburg"
		counties[61] = "City of Winchester"
		counties[62] = "Clarke"
		counties[63] = "Craig"
		counties[64] = "Culpeper"
		counties[65] = "Cumberland"
		counties[66] = "Dickenson"
		counties[67] = "Dinwiddie"
		counties[68] = "Essex"
		counties[69] = "Fairfax"
		counties[70] = "Fauquier"
		counties[71] = "Floyd"
		counties[72] = "Fluvanna"
		counties[73] = "Franklin"
		counties[74] = "Frederick"
		counties[75] = "Giles"
		counties[76] = "Gloucester"
		counties[77] = "Goochland"
		counties[78] = "Grayson"
		counties[79] = "Grayson"
		counties[80] = "Greene"
		counties[81] = "Greensville"
		counties[82] = "Halifax"
		counties[83] = "Hanover"
		counties[84] = "Henrico"
		counties[85] = "Henry"
		counties[86] = "Highland"
		counties[87] = "Isle of Wight"
		counties[88] = "James City"
		counties[89] = "King and Queen"
		counties[90] = "King George"
		counties[91] = "King William"
		counties[92] = "Lancaster"
		counties[93] = "Lee"
		counties[94] = "Loudoun"
		counties[95] = "Louisa"
		counties[96] = "Lunenburg"
		counties[97] = "Madison"
		counties[98] = "Mathews"
		counties[99] = "Mathews"
		counties[100] = "Mecklenburg"
		counties[101] = "Middlesex"
		counties[102] = "Montgomery"
		counties[103] = "Nelson"
		counties[104] = "New Kent"
		counties[105] = "Northampton"
		counties[106] = "Northumberland"
		counties[107] = "Northumberland"
		counties[108] = "Nottoway"
		counties[109] = "Orange"
		counties[110] = "Page"
		counties[111] = "Patrick"
		counties[112] = "Pittsylvania"
		counties[113] = "Powhatan"
		counties[114] = "Prince Edward"
		counties[115] = "Prince George"
		counties[116] = "Prince William"
		counties[117] = "Pulaski"
		counties[118] = "Rappahannock"
		counties[119] = "Richmond"
		counties[120] = "Roanoke"
		counties[121] = "Rockbridge"
		counties[122] = "Rockingham"
		counties[123] = "Russell"
		counties[124] = "Scott"
		counties[125] = "Shenandoah"
		counties[126] = "Smyth"
		counties[127] = "Southampton"
		counties[128] = "Spotsylvania"
		counties[129] = "Stafford"
		counties[130] = "Surry"
		counties[131] = "Sussex"
		counties[132] = "Tazewell"
		counties[133] = "Warren"
		counties[134] = "Washington"
		counties[135] = "Westmoreland"
		counties[136] = "Wise"
		counties[137] = "Wythe"
		counties[138] = "York"
			
	return counties;
}
function loadPrisms(){
	var prisms = new Array();
		prisms[0] = "Select PRISM";
		prisms[1] = "APIPP";
		prisms[2] = "Capital Region";
		prisms[3] = "CRISP";
		prisms[4] = "Finger Lakes";
		prisms[5] = "Lake Ontario";
		prisms[6] = "LIISMA";
		prisms[7] = "Lower Hudson";
		prisms[8] = "SLELO";
		prisms[9] = "Western NY";
	return prisms;
}

function loadWatersheds(){
	var watersheds = new Array();
		watersheds[0] = "By Watershed";
		watersheds[1] = "Allegheny River";
		watersheds[2] = "Connecticut Coastal";
		watersheds[3] = "Lake Champlain";
		watersheds[4] = "Lake Erie-Niagara River";
		watersheds[5] = "Long Island";
		watersheds[6] = "Lower Hudson";
		watersheds[7] = "North Eastern Lake Ontario";
		watersheds[8] = "Oswego";
		watersheds[9] = "South Eastern Lake Ontario";
		watersheds[10] = "South Western Lake Ontario";
		watersheds[11] = "St. Lawrence";
		watersheds[12] = "Upper Delaware";
		watersheds[13] = "Upper Hudson";
		watersheds[14] = "Upper Susquehanna";	
	return watersheds
}

