    //<![CDATA[
      
		function CreateCustomTileLayer(MapServerBaseURL) {
      // === Create the tilelayer ===
			var tileCSI= new GTileLayer(new GCopyrightCollection(""),1,17);
			tileCSI.myLayers="hucs";
			tileCSI.myFormat="image/png";
			tileCSI.myBaseURL=MapServerBaseURL;
			tileCSI.getTileUrl=CustomGetTileUrl;
			tileCSI.getOpacity = function() {return 0.65;};

			// Build a path to the appropriate MapServer Map file, based on Species.
			var MapFilePath;
			switch (SpeciesKey) {
				case 1:	
					MapFilePath = "gb.map";
					break;
				case 2: 
					switch (Region) {
						case "ME" : 
							MapFilePath = "bt/bt_ME.map";
							break;
						case "NH_VT" : 
							MapFilePath = "bt/bt_NH_VT.map";
							break;
						case "MA_CT_RI" : 
							MapFilePath = "bt/bt_MA_CT_RI.map";
							break;
						case "NY" : 
							MapFilePath = "bt/bt_NY.map";
							break;
						case "PA_NJ" : 
							MapFilePath = "bt/bt_PA_NJ.map";
							break;
						case "VA_WV_MD" : 
							MapFilePath = "bt/bt_VA_WV_MD.map";
							break;
						case "NC_SC_TN_GA" : 
							MapFilePath = "bt/bt_NC_SC_TN_GA.map";
							break;
						default: 
							alert("Unrecognized Region");
							break;
					}
					break;
				case 4:	
					MapFilePath = "srfs.map";
					break;
				case 5:	
					MapFilePath = "yct.map";
					break;
				case 6:	
					MapFilePath = "wct.map";
					break;
				case 7:	
					MapFilePath = "crct.map";
					break;
				case 8:	
					MapFilePath = "rgct.map";
					break;
				case 10:	
					MapFilePath = "at.map";
					break;
				case 11:	
					MapFilePath = "blmw.map";
					break;
				case 14:	
					MapFilePath = "lct.map";
					break;
				case 15:	
					MapFilePath = "dabt.map";
					break;
				case 16:	
					MapFilePath = "npwt/npwt.map";
					break;
				case 18:	
					MapFilePath = "mag.map";
					break;
				case 19:	
					MapFilePath = "blwt/blwt.map";
					break;
				case 21:	
					MapFilePath = "mcrr/mcrr.map";
					break;
				case 22:	
					MapFilePath = "elrb/elrb.map";
					break;
				case 23:	
					MapFilePath = "pct/pct.map";
					break;
				case 24:	
					MapFilePath = "lkgt/lkgt.map";
					break;
				case 25:	
					MapFilePath = "cgt/cgt.map";
					break;
				case 27:	
					MapFilePath = "glrt.map";
					break;
				case 31:	
					MapFilePath = "bct.map";
					break;
				case 33:
					MapFilePath = "dbnt.map";
					break;
	            case 35:
	                MapFilePath = "gila.map";
	                break;
	            case 37:
	                MapFilePath = "coho.map";
	                break;
	            case 38:
	                MapFilePath = "CentWinSthd.map";
	                break;
	            case 40:
	                MapFilePath = "NWinSthd.map";
	                break;
	            case 41:
	                MapFilePath = "SWinSthd.map";
	                break;
	            case 43:
	                MapFilePath = "NSumSthd.map";
	                break;
	            case 46:
	                MapFilePath = "CentFallChin.map";
	                break;
	            case 48:
	                MapFilePath = "NFallChin.map";
	                break;
	            case 49:
	                MapFilePath = "NSprChin.map";
	                break;
	            case 50:
	                MapFilePath = "CentSprChin.map";
	                break;
	            case 51:
					MapFilePath = "glc.map";
					break;
	            case 52:
	                MapFilePath = "CentWinChin.map";
	                break;
	            case 54:
	                MapFilePath = "AtlSmn.map";
	                break;
	            case 55:
	                MapFilePath = "WTColoRiv.map";
	                break;
	            case 57:
	                MapFilePath = "WTGreatBasin.map";
	                break;
	            case 58:
	                MapFilePath = "WTColumbia.map";
	                break;
					
				default: 
					alert("Unrecognized Species Key");
					break;
			}

			tileCSI.myBaseURL += MapFilePath;

/////////////////
// TESTING GEOSERVER
//if (SpeciesKey == 1)
//{
//			tileCSI.myBaseURL = "http://192.168.129.41:8080/geoserver/wms?";
//			tileCSI.myLayers = "csi:gb_scores";
//}
/////////////////			
			var layer1=[G_NORMAL_MAP.getTileLayers()[0],tileCSI]; 

			return custommap1 = new GMapType(layer1, G_SATELLITE_MAP.getProjection(), "Map 1", G_SATELLITE_MAP);
		}

//		function CreateStreamTileLayer() {
//      // === Create the tilelayer ===
//			var tileStreams= new GTileLayer(new GCopyrightCollection(""),1,17);
//			tileStreams.myLayers="hucs";
//			tileStreams.myFormat="image/png";
//			tileStreams.myBaseURL="http://nhdgeo.usgs.gov/wmsconnector/com.esri.wms.Esrimap/nhdgeowms?request=getmap&LAYERS=nhdflowline_med&version=1&srs=EPSG:54004&";
//			tileStreams.getTileUrl=CustomGetTileUrl;
//			tileStreams.getOpacity = function() {return 0.65;};

//			var layer2=[G_NORMAL_MAP.getTileLayers()[0],tileStreams]; 

//			return custommap2 = new GMapType(layer2, G_SATELLITE_MAP.getProjection(), "Map 1", G_SATELLITE_MAP);
//		}
    //]]>

