/* ------------------------------------------------------------------------------------------------
 * This is the DOQQ98 IR Mosaic Javascript for Business Code.
 * This File contains all the Functions for the DOQQMosaic web page and subpages to separate Content from 
 * Code.  Loaded before this file is the DOQQM_Data.js file which contains the data that these functions use.

 * Calls to the functions are made from the Visual aspect of the Web Page.
 * 
 * This Javascript is called by the GISDOQQMosaic.html file.
 ----------------------------------------------------------------------------------------------- */ 

	// * Variables
	var selected_info;

	// * Function used to open up page 
	// * Called before makeTitle()
	function beginFrame()
	{
		document.writeln('');
		document.writeln('<TABLE border="0" cellSpacing="0" cellPadding="3" width="745" bgColor="#ffffff" border="0">');
			document.writeln('<TR>');
		document.writeln('<!-- Header Text -->');
				document.writeln('<TD colspan="3" align="center" vAlign="center" height="50" width="740">');
	}

	// * Non-GIS Frame Title
	// * The GIS Frame is the Frame work provided by the IT dept. (look and feel)
	// * This is simply a String for which we want to express the first letter.
	// * Since it is called after beginFrame() it must be followed by a simple document.writeln('</td></tr>') statement.
	function makeTitle(gTitle)
	{
		firstLetter = gTitle.substr(0,1);
		remainder = gTitle.substr(1);

		lType = checkURL();
			switch(lType[0][1])
			{
				case 'City':
					remainder = remainder + '<br>' + 'by City Name';
					break;
				case 'County':
					remainder = remainder + '<br>' + 'by County Name';
					break;
				case 'Division':
					remainder = remainder + '<br>' + 'by NCDOT Division';
					break;
				case 'Map':
					remainder = remainder + '<br>' + 'by Interactive Map';
					break;
				default:
					break;
			}

		document.write('<span class=Title1>',firstLetter,'</span><span class=Title1>',remainder,'</span>');

	}

	// * Paragraph group writing function
	function paraWrite(pArray)
	{
		for(i=0;i<pArray.length;i++)
		{
			document.writeln('<span class="',pArray[i][0],'">',pArray[i][1],'</span><br><br>');
		}
	}

	// * Links to associated Pages
	function jumpLinks(lArray)
	{
		document.writeln('<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="4" WIDTH="720">');
		for(i=0;i<lArray.length;i++)
		{
			document.writeln('<TR class="text2b"><td style="padding-left:35px;">',lArray[i][1].link(lArray[i][0]),'</td></tr>');
			if(lArray[i][2] != '')
				document.writeln('<TR class="text2"><td style="padding-left:55px;">',lArray[i][2],'</td></tr>');
		}
		document.writeln('</table>');
	}

	// * Grabs any variables from the URL
	// * THis function currently does not support more than 1 variable.
	function checkURL()
	{
		strURL = new String(window.location);
		startOfVars = strURL.indexOf('?');
		strVars = strURL.substr(startOfVars+1);

		varSep = strVars.indexOf('=');
		tVar = strVars.substr(0,varSep);
		tValue = strVars.substr(varSep+1);
		
		listType = new Array();
		listType[0] = [tVar, tValue];

		return listType;
	}

	// * orgList receives the Value of 'by' and outputs the appropriate organzied List.
	function orgList()
	{
		var d = document; columns = 1;
		/*switch(by)
		{
			case 'DOQQ':
				// * This option takes over a minute to display the data.  It is turned off.
				//document.writeln(by);
				//tArray = dMc; columns = 4;
				break;
			case 'County':
				//document.writeln(by);
				tArray = dMd; columns = 4;
				break;
			case 'City':
				//document.writeln(by);
				tArray = dMe; columns = 4;
				break;
			case 'Division':
				//document.writeln(by);
				tArray = dMf; columns = 8;
				break;
			default:*/
				tArray = new Array();
				//break;
		//}

		d.writeln('<table');
		for(tElem in tArray)
		{
			if(!(tElem=='trimArray' || tElem=='inArray' || tElem=='indexOf'))
			{
			d.writeln('<tr><td>');
				d.writeln('<table><tr><th style="border-bottom:thick solid #273b7c; text-align:left;">');
			d.writeln(tElem);
				d.writeln('</th></tr></table>');
			d.writeln('</td></tr>');

			count = 0;
			d.writeln('<tr><td width="40px">&nbsp;</td>');
			for(tTile in tArray[tElem])
			{
				if(!(tElem=='trimArray' || tElem=='inArray' || tElem=='indexOf'))
				{
					if(count==columns) { d.writeln('</tr><tr>'); d.writeln('<tr><td>&nbsp;</td>'); count=0; }
					d.writeln('<td width="50px">');
					d.writeln(tArray[tElem][tTile].link('GISDOQQMosaic_Info.html?tile='+tArray[tElem][tTile]));
					d.writeln('</td>');
					count++;
				}
			}
			d.writeln('</tr>');
			d.writeln('<tr><td><hr></td></tr>');
			}
		}
		d.writeln('</table>');

		//if(by=='Map') {
			d.writeln('<hr>');
			d.writeln('<center><span class="title1" style="color:#000000;">North Carolina Counties by Division</span> ');
			d.writeln('<br> <span class="title1" style="color:#000000; font-size:14pt;">Click on a county to see available data.</spsn></center>');
			d.writeln('<img src="java/stateoutline_final_LIGHT.jpg" alt="Map" usemap="#IMap" border="0">'); 
			d.writeln('<table name="info" id="info" style="position:relative; left:60px; top:-60px; visibility:hidden; border-color:#000000;" border="1" bgcolor="#ffffbb" cellspacing="0" cellpadding="3"><tr><td name="infotd" id="infotd">Information Box</td></tr></table>'); 
		//	}
	}

	// * orgList receives the Value of 'by' and outputs the appropriate organzied List.
	function orgListDeep()
	{
		var d = document; columns = 1;
		/*switch(by)
		{
			case 'DOQQ':
				// * This option takes over a minute to display the data.  It is turned off.
				//document.writeln(by);
				//tArray = dMc; columns = 4;
				break;
			case 'County':
				//document.writeln(by);
				tArray = dMd; columns = 4;
				break;
			case 'City':
				//document.writeln(by);
				tArray = dMe; columns = 4;
				break;
			case 'Division':
				//document.writeln(by);
				tArray = dMf; columns = 8;
				break;
			default:*/
				tArray = new Array();
				//break;
		//}

		d.writeln('<table');
		for(tElem in tArray)
		{
			if(!(tElem=='trimArray' || tElem=='inArray' || tElem=='indexOf'))
			{
			d.writeln('<tr><td>');
				d.writeln('<table><tr><th style="border-bottom:thick solid #273b7c; text-align:left;">');
			d.writeln(tElem);
				d.writeln('</th></tr></table>');
			d.writeln('</td></tr>');

			count = 0;
			d.writeln('<tr><td width="40px">&nbsp;</td>');
			for(tTile in tArray[tElem])
			{
				if(!(tElem=='trimArray' || tElem=='inArray' || tElem=='indexOf'))
				{
					if(count==columns) { d.writeln('</tr><tr>'); d.writeln('<tr><td>&nbsp;</td>'); count=0; }
					d.writeln('<td width="50px">');
					d.writeln(tArray[tElem][tTile].link('GISDOQQMosaic_Info.html?tile='+tArray[tElem][tTile]));
					d.writeln('</td>');
					count++;
				}
			}
			d.writeln('</tr>');
			d.writeln('<tr><td><hr></td></tr>');
			}
		}
		d.writeln('</table>');

		//if(by=='Map') {
			d.writeln('<hr>');
			d.writeln('<center><span class="title1" style="color:#000000;">North Carolina Counties by Division</span> ');
			d.writeln('<br> <span class="title1" style="color:#000000; font-size:14pt;">Click on a county to see available data.</spsn></center>');
			d.writeln('<img src="../java/stateoutline_final_LIGHT.jpg" alt="Map" usemap="#IMap" border="0">'); 
			d.writeln('<table name="info" id="info" style="position:relative; left:60px; top:-60px; visibility:hidden; border-color:#000000;" border="1" bgcolor="#ffffbb" cellspacing="0" cellpadding="3"><tr><td name="infotd" id="infotd">Information Box</td></tr></table>'); 
		//	}
	}

	// * This is called by InfoList and returns an Array of only those 
	// * array elements that are for the designated tile number. (GRID_ID)
	// * Calls on the DOQQM_Data_Full.js dqmc table.
	function filterByTile(tile)
	{
		xArr = new Array(); n=0;
		for(tArr in dqmc)
		{
			if(dqmc[tArr][0]==tile)
				xArr[n++] = dqmc[tArr];
		}
		return xArr;
	}

	// * This is called by InfoList and returns an Array of only those 
	// * unique array elements that are for the designated tile number. (GRID_ID)
	// * Calls on filterByTile subset culled in InfoList from the DOQQM_Data_Full.js dqmc table.
	function uniqueItems(dArray, field, bDisplay)
	{
		xArr = new Array(); n=0; exists=0;
		for(tArr in dArray)
		{
			if(dArray[tArr][field] != '')
			{
				for(noDup in xArr)
				{
					if(dArray[tArr][field] == xArr[noDup])
						exists = 1;
				}
				if(exists != 1) xArr[n++] = dArray[tArr][field];
				exists=0;
			}
		}

		// * return string?
		xArr.sort();
		if(bDisplay) nDisplay(xArr, field, dArray);
		return xArr;
	}

	// * This is called by InfoList and returns an Array of only those 
	// * unique array elements that are for the designated tile number. (GRID_ID)
	// * Calls on filterByTile subset culled in InfoList from the DOQQM_Data_Full.js dqmc table.
	function uniqueItems_citySub(dArray, field, qq)
	{
		xArr = new Array(); n=0; exists=0;
		for(tArr=0;tArr<dArray.length;tArr++)
		//for(tArr in dArray)
		{
			if(dArray[tArr][field] != '' && dArray[tArr][field+1]==qq)
			{
				for(noDup in xArr)
				{
					if(dArray[tArr][field] == xArr[noDup])
						exists = 1;
				}
				if(exists != 1) xArr[n++] = dArray[tArr][field];
				exists=0;
			}
		}

		// * return string?
		xArr.sort();
		nDisplaySub(xArr, field);
		return xArr;
	}

	// * This is called by InfoList and displays an Array of Unqiue items.
	function nDisplay(pArr, field, dArray)
	{
		if(pArr.length==0) document.writeln('none');
		for(i=0;i<pArr.length;i++)
		{
			switch(field)
			{
				case 1: // * Cities
					document.write(pArr[i]);
					if(pArr.length>0 && i-1+2 != pArr.length) document.writeln('<br>');
					break;
				case 2: // * Counties
					//document.write(pArr[item].substr(0,1),pArr[item].substr(1).toLowerCase()); // * Stop to think about New Hanover
					document.write(pArr[i]);
					if(pArr.length>0 && i-1+2 != pArr.length) document.writeln('<br>');
					break;
				case 5: // * Divisions
					document.write(pArr[i]);
					if(pArr.length>0 && i-1+2 != pArr.length) document.writeln(', ');
					break;
				//case 6: // * DOQQs
				//	document.write(pArr[i]);
				//	if(pArr.length>0 && i-1+2 != pArr.length) document.writeln(', ');
				//	break;
				case 7: // * DOQQs
					document.writeln('<b>',pArr[i], '</b><br>');
					document.write('<span style="font-size:10pt; font-weight:normal; margin-left:25px;">[ ');
					uniqueItems_citySub(dArray, 6, pArr[i]);
					document.write(' ]</span>');
					if(pArr.length>0 && i-1+2 != pArr.length) document.writeln('<br>');
					break;
			}
			//document.write(pArr[item]);
			//if(pArr.length>0 && item != pArr.length) document.writeln('<br>');*/
		}
	}

	function nDisplaySub(pArr, field, dArray)
	{
		if(pArr.length==0) document.writeln('none');
		for(j=0;j<pArr.length;j++)
		{
			document.write(pArr[j]);
			if(pArr.length>0 && j+1 != pArr.length) document.writeln(', ');
		}
	}

	// * A pair of functions for the pop up display on the Listing Page for the Image Map.
	// * Include statement to modify innerHTML value.
	function myClick2() {
		if (document.all) { // * IE
			document.all('info').style.visibility = 'hidden';
			document.all('infotd').innerHTML = '';
			document.all('info').style.height = '25px';
		}
		else if (document.getElementById) { // * NS
			document.getElementById('info').style.visibility = 'hidden';
			document.getElementById('infotd').innerHTML = '';
			document.getElementById('info').style.height = '25px';
		}
	}
	function myoClick2(tile) {
		if (document.all) { // * IE
			document.all('info').style.visibility = 'visible';
			document.all('info').style.height = '25px';
			tArray = dMd;
			ihtml = '<b>Data For ' + tile + ' County</b><br>';
			/*for(tElem in tArray)
			{
				thisDOQQ = false;
				for(j=0;j<tArray[tElem].length;j++)
					if(tArray[tElem][j]==tile) thisDOQQ = true;
				if(thisDOQQ)
					ihtml += tElem + '<br>';
			}*/
			document.all('infotd').innerHTML = ihtml;
		}
		else if (document.getElementById) { // * NS
			document.getElementById('info').style.visibility = 'visible';
			document.getElementById('info').style.height = '25px';
			tArray = dMd;
			ihtml = '<b>Data For ' + tile + ' County</b><br>';
			/*for(tElem in tArray)
			{
				thisDOQQ = false;
				for(j=0;j<tArray[tElem].length;j++)
					if(tArray[tElem][j]==tile) thisDOQQ = true;
				if(thisDOQQ)
					ihtml += tElem + '<br>';
			}*/
			document.getElementById('infotd').innerHTML = ihtml;
		}
	}

	// * Create the map tag and area data for an image map.
	function makeImageMap(name)
	{
		fileInfo = 'imagemap/ImageMap_Info.html?county=';
		
		document.writeln('<map name="',name,'">');
		for(i=0;i<jCoords.length;i++)
		{
			tFile = fileInfo + jCoords[i][1]; // * target File
			document.writeln('<area shape="',jCoords[i][0],'" coords="',jCoords[i][2],'" href="',tFile,'" alt="',jCoords[i][1],'" onMouseOver="myoClick2(\'',jCoords[i][1],'\');" onMouseOut="myClick2()">');
		}
		document.writeln('</map>');
	}

	// * Create the map tag and area data for an image map.
	function makeImageMapDE(name)
	{
		fileInfo = 'DESearch.html?Division=0&County=';
		var CountyNumber;
		fileInfo2 = '&Year=-1';
		
		document.writeln('<map name="',name,'">');
		for(i=0;i<jCoords.length;i++)
		{
			for(v=0;v<CountyData.length;v++)
				if(CountyData[v][0]==jCoords[i][1])
					CountyNumber = v;
			tFile = fileInfo + CountyNumber + fileInfo2; // * target File
			document.writeln('<area shape="',jCoords[i][0],'" coords="',jCoords[i][2],'" href="',tFile,'" alt="',jCoords[i][1],'" onMouseOver="myoClick2(\'',jCoords[i][1],'\');" onMouseOut="myClick2()">');
		}
		document.writeln('</map>');
	}

	// * Create the Warning about Downloading Large Files	
	function largeFileWarning() 
	{
		warningText = 'The files available for download are quite large.  Downloads can take up to 30 minutes using slow internet connections (e.g. modem).  Please be patient.  Thank You.';

		document.writeln('<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="7" WIDTH="720">');
		document.writeln('<TR class="text2b">');
		document.writeln('<td><font color="Red">',warningText,'</font></td>');
		document.writeln('</TR>');
		document.writeln('</TABLE>');
	}

	// * Create the small link to the Disclaimer if necessary	
	function readDisclaimer()  { deepDisclaimer(); }


	function showdata(name, ht)
	{
		if (document.all) { // * IE
			namepm = name + 'pm';
			if(document.all(name).style.visibility == 'visible')
			{
				document.all(name).style.visibility = 'hidden';
				document.all(name).style.display = 'none';
				document.all(name).style.height = '0px';
				document.all(namepm).innerHTML = '&nbsp;+&nbsp;';
			} else {
				document.all(name).style.visibility = 'visible';
				document.all(name).style.display = 'inline';
				document.all(name).style.height = ht+'px';
				document.all(namepm).innerHTML = '&nbsp;-&nbsp;';
			}
		}
		else if (document.getElementById) { // * NS
			if(document.getElementById(name).style.visibility == 'visible')
			{
				document.getElementById(name).style.visibility = 'hidden';
				document.getElementById(name).style.display = 'none';
				document.getElementById(name).style.height = '0px';
				document.getElementById(name+'pm').innerHTML = '&nbsp;+&nbsp;';
			} else {
				document.getElementById(name).style.visibility = 'visible';
				document.getElementById(name).style.display = 'inline';
				document.getElementById(name).style.height = ht+'px';
				document.getElementById(name+'pm').innerHTML = '&nbsp;-&nbsp;';
			}			
		}		
	}
	
	function showinfo(name) // * DataInfo
	{
		text_dotData = '<b>Data Type:</b> xxx.zip<br><br><b>Info:</b> The DOT GIS Data Layers are a collection of shapefiles generated from our County Map data and LRS data.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/DOTData.jpg" width="150px" height="150px">';
		text_gisCountyMaps = '<b>Data Type:</b> xxx.dgn<br><br><b>Info:</b> These files are updated each night and should have the exact same information provided by the Mapping Section. The Map Unit can be meters or feet depending on your application. The metric version of the designfiles should have information for all counties.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/CountyMapData.jpg" width="150px" height="150px">';
		text_contourElevationData = '<b>Data Type:</b> xxx.zip<br><br><b>Info:</b> Download contour and elevation data generated from LIght Detection And Ranging (LIDAR) data obtained from the North Carolina Flood Mapping Program (www.ncfloodmaps.com). <br><br><b>Example result</b>: <img align="top" src="../../graphics/C_Elevation.jpg" width="150px" height="150px">';
		text_femaFloodData = '<b>Data Types:</b> <br>xxx.dgn<br>xxx.zip<br><br><b>Info:</b> FEMA flood maps have been edited to remove quad lines and communities. Map Units are available in meters or feet. Contact FEMA for additional data. Flood Map data is not available for all N.C. counties at this time. The links below list the counties with available data. More counties will be added in the future. <br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/FEMAFloodData.jpg" width="150px" height="150px">';
		text_1993AerialPhoto = '<b>Data Type:</b> xxx.sid<br><br><b>Info:</b> 1993 - 1 Meter digital orthophotography SID images  are available by county.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/1993AerialPhoto.jpg" width="150px" height="150px">';
		text_usgsTopoMaps = '<b>Data Type:</b> xxx.sid<br><br><b>Info:</b> USGS 1:24000-scale Topographic Quadrangle Map SID images  are available by county.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/USGSTopoDRG.jpg" width="150px" height="150px">';
		text_stateTravelMap = '<b>Data Type:</b> <br>xxx.jpg<br>xxx.zip<br>xxx.pdf<br><br><b>Info:</b> Presented through the following page are images from the State Travel Map. The State Travel Map has been scanned and extracted County by County in a JPG format. To view these JPG images, simply click on the county name you wish to view.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/StateTravelMap.jpg" width="150px" height="150px">';
		text_countyMaps = '<b>Data Type:</b> <br>xxx.tif<br>xxx.pdf<br>xxx.jpg<br><br><b>Info:</b> Official NCDOT County Maintenance Maps are being generated into TIF and PDF images. In each county, sheet number one always shows the entire county. Each supplemental sheet shows area insets, usually congested areas. A sheet key is shown for any county that requires more than 2 sheets.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/CountyMapTIF.gif" width="150px" height="150px">';
		text_bridgeMaps = '<b>Data Type:</b> <br>xxx.tif<br>xxx.jpg<br><br><b>Info:</b> These are phase one bridge maps showing numbers and points only. The next phase will be out in March.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/BridgeMapTIF.jpg" width="150px" height="150px">';
		text_trafficSurveyMaps = '<b>Data Type:</b> xxx.tif<br><br><b>Info:</b> By clicking on the Traffic Survey Maps link you can access the individual county sheets in TIF format. The Name of the county will be followed by a number or string of numbers. These numbers represent each sheet as it is presented on the sheets themselves, i.e., Sheet 2 of 9.<br><br><b>Example result</b>: <img align="top" src="../../graphics/DataDistRollOver/TrafficSurveyMap.jpg" width="150px" height="150px">';
		text_baseinfo = 'Click <div class="infobox" id="ax1nf">&nbsp;?&nbsp;</div> for additional information on Data Topic.<br> Click <div class="plusminus" id="ax1pm">&nbsp;+&nbsp;</div> in order to expand the Data Category for download links.<br> Additionally Click <div class="plusminus" id="ax1pm">&nbsp;-&nbsp;</div> in order to collapse the Data Category.';

		switch(name)
		{
			case 'ax1io': infotext = text_dotData; break;
			case 'ax2io': infotext = text_gisCountyMaps; break;
			case 'ax3io': infotext = text_contourElevationData; break;
			case 'ax4io': infotext = text_contourElevationData; break;
			case 'ax5io': infotext = text_contourElevationData; break;
			case 'ax6io': infotext = text_femaFloodData; break;
			case 'ax7io': infotext = text_1993AerialPhoto; break;
			case 'ax8io': infotext = text_usgsTopoMaps; break;
			case 'ax9io': infotext = text_stateTravelMap; break;
			case 'ax10io': infotext = text_countyMaps; break;
			case 'ax11io': infotext = text_bridgeMaps; break;
			case 'ax12io': infotext = text_trafficSurveyMaps; break;
			default: infotext = text_baseinfo; break;
		}
		if(name==selected_info) 
		{
			infotext = text_baseinfo;
			selected_info="";
		} else {
			selected_info=name;
		}
			
		if (document.all) { // * IE
			document.all('datainfo').innerHTML = infotext;
		}
		else if (document.getElementById) { // * NS
			document.getElementById('datainfo').innerHTML = infotext;
		}		
	}

	function thumbnail(filename) // * DataInfo
	{
		selected_info="";
		infotext = "<img width='400px' src='" + filename + "'>";
			
		if (document.all) { // * IE
			document.all('datainfo').innerHTML = infotext;
		}
		else if (document.getElementById) { // * NS
			document.getElementById('datainfo').innerHTML = infotext;
		}		
	}
	
	// * Access DD_County_LiDAR.js to get the correct county number for file size checking.
	function get_LiDAR_County_Number(county)
	{
		if(county=='NewHanover') county='New Hanover';
		for(lcn=0;lcn<CountyDataL.length;lcn++)
			if(CountyDataL[lcn][0]==county) return lcn;
	}
	
	// * InfoList receives the Value of 'County' and outputs the appropriate Information.
	function InfoList(county)
	{
		var d = document;
		if(county=='NewHanover') {county='New Hanover';}
		d.writeln('<div id="bodyHeader"><div><b>',county,' County</b></div></div>');
		if(county=='New Hanover') {county='NewHanover';}
		var FTPPath = "http://dotw-xfer01.dot.state.nc.us/gisdot/"
			var ab = new Date(); var after5=0;
			if(ab.getHours()>=17 || ab.getHours()<=7 || ab.getDay()==0 || ab.getDay()==6) {after5 = 1;}
			if(ab.getHours()>=8 && ab.getHours()<=16  && (ab.getDay()>0 && ab.getDay()<6)) {after5 = 0;}
		NoTwos = new Array('Buncombe', 'Cherokee', 'Cleveland', 'Clay', 'Graham', 'Haywood', 'Henderson', 'Jackson', 'Macon', 'Madison', 'Mitchell', 'Polk', 'Rutherford', 'Swain', 'Transylvania', 'Yancey'); no2 = 0;
		for(l=0;l<NoTwos.length;l++) { if(NoTwos[l]==county) no2=1; }
		cNum = get_LiDAR_County_Number(county);
		MBLimit = 50;

	// ***** ***** ***** ***** STYLE
		d.writeln('<style>');
		d.writeln('.ax1, .ax2, .ax3, .ax4, .ax5, .ax6, .ax7, .ax8, .ax9, .ax10, .ax11, .ax12');
			d.writeln('{visibility:hidden; display:none; height:0px;}');
		d.writeln('.plusminus {border:1px solid #000000; background:#ffffff; display:inline; cursor:pointer;}');
		d.writeln('.infobox {border:1px solid #000000; background:#ffffff; display:inline; cursor:pointer;}');
		d.writeln('.infotable {border:1px solid #000000; background:#ffffff;}');
		d.writeln('</style>');

	// ***** ***** ***** ***** ShapeFiles
		// * Shapefiles English
		DataPath_a = FTPPath + "DistDOTData/DOT-Unrestricted/County/shpe/";
		DataPath_a = DataPath_a + county.substr(0,8).toUpperCase() + ".zip"
		// * Shapefiles Metric
		DataPath_b= FTPPath+"DistDOTData/DOT-Unrestricted/County/shpm/";
		DataPath_b = DataPath_b + county.substr(0,8).toUpperCase() + ".zip"

		d.writeln('<table width="100%"><tr>');
		d.writeln('<td valign="top">');

	//	d.writeln('<table width="300px" cellspacing="0" cellpadding="3"><tr>')
	//	d.writeln('<th colspan="2" style="background:#BFD9ED;" align="right">ArcView Shapefiles');
	//	d.writeln('<div class="infobox" id="ax1nf" onClick="showinfo(\'ax1io\');">&nbsp;?&nbsp;</div>');
		//	d.writeln('<div class="plusminus" id="ax1pm" onClick="showdata(\'ax1\',40);">&nbsp;+&nbsp;</div>');
	//	d.writeln('</th></tr></table>');
		//	d.writeln('<div class="ax1" id="ax1">');
	//	d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
	//	d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">English</th>');
	//		d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_a,'">Download</a></td></tr>');
	//	d.writeln('<tr><th width="200px" align="right">Metric</th>');
	//		d.writeln('<td><a style="text-decoration:none;" href="',DataPath_b,'">Download</a></td></tr>');
	//	d.writeln('</table>');
		//	d.writeln('</div>');
		
	// ***** ***** ***** ***** Microstations
		// * Microstation English
		// * Microstation Metric (lin, plt)

	// ***** ***** ***** ***** Contours
		// * Arcviews Contours by County (2ft, 5ft, 10ft, 20ft)
		// * 2ft Data is Time Sensitive.
		DataPath_e= FTPPath+"DOTContours2/Lidar_con/";
		//if(county=='NewHanover') {county='New_Hanover';}
		DataPath_e2 = DataPath_e + "con_" + county.substr(0,8) + "_02.zip"
		DataPath_e20 = DataPath_e + "con_" + county.substr(0,8) + "_20.zip"
		DataPath_e100 = DataPath_e + "con_" + county.substr(0,8) + "_100.zip"
		//if(county=='New_Hanover') {county='NewHanover';}
		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
		d.writeln('<tr><th colspan="2" style="background:#BFD9ED;" align="right">Contour Files'); // Arcview Contours
		d.writeln('<div class="infobox" id="ax3nf" onClick="showinfo(\'ax3io\');">&nbsp;?&nbsp;</div>');
	//	d.writeln('<div class="plusminus" id="ax3pm" onClick="showdata(\'ax3\',90);">&nbsp;+&nbsp;</div>');
		d.writeln('</th></tr></table>');
	//	d.writeln('<div class="ax3" id="ax3">');
		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');

		d.writeln('<tr><th align="right" colspan="2" style="color:#F7FBFF; background-color:#365C9A;">Arcview Contours</th></tr>');
		d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">2ft</th>');
		if(CountyDataL[cNum][1]>MBLimit && !after5)
			d.writeln('<td style="border-bottom:1px solid #273B7C;">(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_e2,'">Download</a></td></tr>');

		d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">20ft</th>');
		if(CountyDataL[cNum][2]>MBLimit && !after5)
			d.writeln('<td style="border-bottom:1px solid #273B7C;">(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_e20,'">Download</a></td></tr>');

		d.writeln('<tr><th width="200px" align="right">100ft</th>');
		if(CountyDataL[cNum][3]>MBLimit && !after5)
			d.writeln('<td>(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td><a style="text-decoration:none;" href="',DataPath_e100,'">Download</a></td></tr>');
		
//		d.writeln('</table>');
//		d.writeln('</div>');
		
	// ***** ***** ***** ***** AutoCAD DXF
		// * AutoCAD DXF by County (2ft, 5ft, 10ft, 20ft)
		// * 2ft Data is Time Sensitive.
		DataPath_f= FTPPath+"DOTContours2/Lidar_dwg/";
		//if(county=='NewHanover') {county='New_Hanover';}
		DataPath_f2 = DataPath_f + "dwg_" + county.substr(0,8) + "_02.zip"
		DataPath_f20 = DataPath_f + "dwg_" + county.substr(0,8) + "_20.zip"
		//if(county=='New_Hanover') {county='NewHanover';}

//		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
//		d.writeln('<tr><th colspan="2" style="background:#BFD9ED;" align="right">AutoCAD DXFs');
//		d.writeln('<div class="infobox" id="ax4nf" onClick="showinfo(\'ax4io\');">&nbsp;?&nbsp;</div>');
//		d.writeln('<div class="plusminus" id="ax4pm" onClick="showdata(\'ax4\',90);">&nbsp;+&nbsp;</div>');
//		d.writeln('</th></tr></table>');
//		d.writeln('<div class="ax4" id="ax4">');
//		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');

		d.writeln('<tr><th align="right" colspan="2" style="color:#F7FBFF; background-color:#365C9A;">AutoCAD DXFs</th></tr>');
		d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">2ft</th>');
		if(CountyDataL[cNum][8]>MBLimit && !after5)
			d.writeln('<td style="border-bottom:1px solid #273B7C;">(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_f2,'">Download</a></td></tr>');

		d.writeln('<tr><th width="200px" align="right">20ft</th>');
		if(CountyDataL[cNum][9]>MBLimit && !after5)
			d.writeln('<td>(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td><a style="text-decoration:none;" href="',DataPath_f20,'">Download</a></td></tr>');

//		d.writeln('</table>');
//		d.writeln('</div>');

	// ***** ***** ***** ***** Contours
		// * Elevation Grid by County
		//if(county=='NewHanover') {county='New_Hanover';}
		DataPath_g= FTPPath+"DOTContours2/Lidar_elev/";
		DataPath_g = DataPath_g + "elev_" + county.substr(0,8) + ".zip"
		// * Hillside Shade by County
		// * Hillside Shade Data is Time Sensitive.
		DataPath_h= FTPPath+"DOTContours2/Lidar_hillside/";
		DataPath_h = DataPath_h + "hill_" + county.substr(0,8) + ".zip"
		// * Slope Grid by County
		DataPath_i= FTPPath+"DOTContours2/Lidar_slope/";
		DataPath_i = DataPath_i + "slope_" + county.substr(0,8) + ".zip"
		// * Hours of Sunshone by County
		DataPath_ix= FTPPath+"DOTContours2/Lidar_sunshine/";
		DataPath_ix = DataPath_ix + "sunshine_" + county.substr(0,8) + ".zip"
		//if(county=='New_Hanover') {county='NewHanover';}

//		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
//		d.writeln('<tr><th colspan="2" style="background:#BFD9ED;" align="right">Contour Files');
//		d.writeln('<div class="infobox" id="ax5nf" onClick="showinfo(\'ax5io\');">&nbsp;?&nbsp;</div>');
//		d.writeln('<div class="plusminus" id="ax5pm" onClick="showdata(\'ax5\',66);">&nbsp;+&nbsp;</div>');
//		d.writeln('</th></tr></table>');
//		d.writeln('<div class="ax5" id="ax5">');
//		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');

		d.writeln('<tr><th align="right" colspan="2" style="color:#F7FBFF; background-color:#365C9A;">Other Contour Files</th></tr>');
		d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">Elevation Grid</th>');
		if(CountyDataL[cNum][4]>MBLimit && !after5)
			d.writeln('<td style="border-bottom:1px solid #273B7C;">(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_g,'">Download</a></td></tr>');

		d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">Hillside Shade</th>');
		if(CountyDataL[cNum][5]>MBLimit && !after5)
			d.writeln('<td style="border-bottom:1px solid #273B7C;">(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_h,'">Download</a></td></tr>');

		d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">Slope</th>');
		if(CountyDataL[cNum][7]>MBLimit && !after5)
			d.writeln('<td style="border-bottom:1px solid #273B7C;">(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_i,'">Download</a></td></tr>');

		d.writeln('<tr><th width="200px" align="right">Hours of Sunshine</th>');
		if(CountyDataL[cNum][6]>MBLimit && !after5)
			d.writeln('<td>(After 5<sup><sub>pm</sub></sup>)</td></tr>');
		else
			d.writeln('<td><a style="text-decoration:none;" href="',DataPath_ix,'">Download</a></td></tr>');

		d.writeln('</table>');
	//	d.writeln('</div>');

	// ***** ***** ***** ***** Flood Data
		// * Flood Map by County (AV Eng, AV Met, MS Eng, MS Met)
		// * Flood Data Does NOT exist for every county!
		FEMACOUNTY = 0;
		for(i=0;i<CountyData.length;i++) { if(CountyData[i][0]==county) if(CountyData[i][5]==1) FEMACOUNTY = 1; }
		if(FEMACOUNTY==1) 
		{		
			DataPath_j= FTPPath+"FEMAFlood/";
			if(county=='NewHanover') {county='New_Hanover';}
			DataPath_j1 = DataPath_j + "cove/" + county.substr(0,8).toLowerCase() + ".zip"
			DataPath_j2 = DataPath_j + "covm/" + county.substr(0,8).toLowerCase() + ".zip"
			DataPath_j3 = DataPath_j + "dgne/fld_" + county.substr(0,8).toLowerCase() + ".dgn"
			DataPath_j4 = DataPath_j + "dgnm/fld_" + county.substr(0,8).toLowerCase() + ".dgn"
			if(county=='New_Hanover') {county='NewHanover';}
	
			d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
			d.writeln('<tr><th colspan="2" style="background:#BFD9ED;" align="right">Flood Maps');
			d.writeln('<div class="infobox" id="ax6nf" onClick="showinfo(\'ax6io\');">&nbsp;?&nbsp;</div>');
	//		d.writeln('<div class="plusminus" id="ax6pm" onClick="showdata(\'ax6\',85);">&nbsp;+&nbsp;</div>');
			d.writeln('</th></tr></table>');
	//		d.writeln('<div class="ax6" id="ax6">');
			d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
			d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">Arcview Coverage English</th>');
				d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_j1,'">Download</a></td></tr>');
			d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">Arcview Coverage Metric</th>');
				d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_j2,'">Download</a></td></tr>');
			d.writeln('<tr><th width="200px" align="right" style="border-bottom:1px solid #273B7C;">Microstation DGN English</th>');
				d.writeln('<td style="border-bottom:1px solid #273B7C;"><a style="text-decoration:none;" href="',DataPath_j3,'">Download</a></td></tr>');
			d.writeln('<tr><th width="200px" align="right">Microstation DGN Metric</th>');
				d.writeln('<td><a style="text-decoration:none;" href="',DataPath_j4,'">Download</a></td></tr>');
			d.writeln('</table>');
	//		d.writeln('</div>');
		}

	// ***** ***** ***** ***** 1993 Aerial
		// * 1993 Aerial Photography
		DataPath_k= FTPPath+"DOTAerialMosaic/";
		if(county=='NewHanover') {county='New_Hanover';}
		DataPath_k1 = DataPath_k + "doq_" + county + "/" + county + "_1993.sid"
		DataPath_k2 = DataPath_k + "doq_" + county + "/" + county + "_1993.sdw"
		if(county=='New_Hanover') {county='NewHanover';}

		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
		d.writeln('<tr><th colspan="2" style="background:#BFD9ED;" align="right">1993 Aerial Photography');
		d.writeln('<div class="infobox" id="ax7nf" onClick="showinfo(\'ax7io\');">&nbsp;?&nbsp;</div>');
	//	d.writeln('<div class="plusminus" id="ax7pm" onClick="showdata(\'ax7\',20);">&nbsp;+&nbsp;</div>');
		d.writeln('</th></tr></table>');
	//	d.writeln('<div class="ax7" id="ax7">');
		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
		d.writeln('<tr><th width="200px" align="right">Downloads</th>');
			d.writeln('<td><a style="text-decoration:none;" href="',DataPath_k1,'">sid</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
			d.writeln('<a style="text-decoration:none;" href="',DataPath_k2,'">sdw</a></td></tr>');
		d.writeln('</table>');
	//	d.writeln('</div>');

	// ***** ***** ***** ***** USGS Topographic
		// * USGS Topographic Maps
		DataPath_l= FTPPath+"DOTUSGSMosaic/";
		if(county=='NewHanover') {county='New_Hanover';}
		DataPath_l1 = DataPath_l + "drg_" + county + "/" + county + ".sid"
		DataPath_l2 = DataPath_l + "drg_" + county + "/" + county + ".sdw"
		if(county=='New_Hanover') {county='NewHanover';}

		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
		d.writeln('<tr><th colspan="2" style="background:#BFD9ED;" align="right">USGS Topographic Maps');
		d.writeln('<div class="infobox" id="ax8nf" onClick="showinfo(\'ax8io\');">&nbsp;?&nbsp;</div>');
	//	d.writeln('<div class="plusminus" id="ax8pm" onClick="showdata(\'ax8\',20);">&nbsp;+&nbsp;</div>');
		d.writeln('</th></tr></table>');
	//	d.writeln('<div class="ax8" id="ax8">');
		d.writeln('<table width="300px" cellspacing="0" cellpadding="3">');
		d.writeln('<tr><th width="200px" align="right">Downloads</th>');
			d.writeln('<td><a style="text-decoration:none;" href="',DataPath_l1,'">sid</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;');
			d.writeln('<a style="text-decoration:none;" href="',DataPath_l2,'">sdw</a></td></tr>');
		d.writeln('</table>');
	//	d.writeln('</div>');

	// ***** ***** ***** ***** STM
		// * State Travel Map Images
		
	// ***** ***** ***** ***** County Maps
		// * County Maps (TIFs, PDFs, by # of Sheets)
		
	// ***** ***** ***** ***** Bridge Maps
		// * Bridge Maps (TIFs by # of Sheets)

	// ***** ***** ***** ***** Traffic Survey Maps
		// * Traffic Survey County Maps (by Years, by # of Sheets)

		d.writeln('</td>');
		d.writeln('<td align="right" valign="top">');
		d.writeln('<table class="infotable"><tr><td width="400" class="datainfo" id="datainfo">');
			d.writeln(' Click <div class="infobox" id="ax1nf">&nbsp;?&nbsp;</div> for additional information on Data Topic.<br>');
			//d.writeln(' Click <div class="plusminus" id="ax1pm">&nbsp;+&nbsp;</div> in order expand the Data Category for download links.<br>');
			//d.writeln(' Additionally Click <div class="plusminus" id="ax1pm">&nbsp;-&nbsp;</div> in order collapse the Data Category.');
			d.writeln('</td></tr></table>');
		d.writeln('</td></tr></table>');
		
	}

	function CountyMaps_TIFPDF(xy)
	{
		columnUsed = 8;
		xfer_path = 'http://dotw-xfer01.dot.state.nc.us/gisdot/DOTCountyMaps/ODTiff/';
		xfer_pathPDF = 'http://dotw-xfer01.dot.state.nc.us/gisdot/DOTCountyMaps/PDFs/';
		return_text = "";

		// * County Sheets Numbered TIFs
		return_text += '<nobr><font style="font-size:8pt; font-weight:bold; font-family:courier;">TIFs</font> -> ';
		for(a=1;a<=CountyData[xy][columnUsed];a++) {
			if(CountyData[xy][columnUsed]>=12 && a==7) return_text += '<br>';
			return_text += '<a style="border:1px solid #BFD9ED; padding-left:3px; padding-right:3px; margin:0px; text-decoration:none;" href="' + xfer_path + (CountyData[xy][0].toLowerCase()).slice(0,5) + '_plt';
			if(a<10) { return_text += '0'; }
			return_text += a + 'GIS-Tif600.tif' + '">' + a + '</a></nobr>';
			} // * End For

		// * County Sheets Numbered PDFs
		return_text += '<br>';
		return_text += '<nobr><font style="font-size:8pt; font-weight:bold; font-family:courier;">PDFs</font> -> ';
		for(a=1;a<=CountyData[xy][columnUsed];a++) {
			if(CountyData[xy][columnUsed]>=12 && a==7) return_text += '<br>';
			return_text += '<a style="border:1px solid #BFD9ED; padding-left:3px; padding-right:3px; margin:0px; text-decoration:none;" href="' + xfer_pathPDF + (CountyData[xy][0].toLowerCase()).slice(0,5) + '_plt';
			if(a<10) { return_text += '0'; }
			return_text += a + 'GIS-Tif800.pdf' + '">' + a + '</a></nobr>';
			} // * End For

		// * County Thumbnail if available
		if(CountyData[xy][columnUsed]>2) {
			thumbfile = '../thumbs/' + (CountyData[xy][0].toLowerCase()).slice(0,5) + '.jpg';
			return_text += '<br><br><div ="infotable" onClick="thumbnail(\'' + thumbfile + '\');"><nobr><span style="text-decoration:underline; color:#00f; cursor:pointer;">Thumbnail of Sheet Key</span></nobr></div>'; 
			}
		return return_text;
	}
	
	function BridgeMaps_TIFs(xy)
	{
		columnUsed = 2;
		xfer_path = 'http://dotw-xfer01.dot.state.nc.us/gisdot/DOTBridgeMaps/';
		return_text = ""; cto=0;

		// * County Sheets Numbered
		cto = CountyData[xy][columnUsed];
		var jName = (CountyData[xy][0].toLowerCase()).slice(0,5);
		if(jName=='crave' || jName=='meckl' || jName=='wake') cto++;
		if(jName=='newha') cto=cto+3;
		for(a=1;a<=cto;a++) {
			return_text += '<a style="border:1px solid #BFD9ED; padding-left:3px; padding-right:3px; margin:0px; text-decoration:none;" ';
			return_text += 'href="' + xfer_path + jName + '_gis_BrMp_Sheet';
			return_text += a + 'CO.pdf">' + a + '</a>';
			} // * End For

		// * Grid Sheet and Second Sheet if Applicable.
		// * 2nd Sheet for [Buncombe, Forsythe, Guilford, Mecklenburg, Wake]
		SecSheet = ['bunco', 'forsy', 'guilf', 'meckl', 'wake'];
		ss = 0;
		for(se=0;se<SecSheet.length;se++)
		{ if(SecSheet[se]==jName) { ss=1; } }
		
		if(ss==1) {
			return_text += '<br><nobr><a style="margin-left:25px;" href="' + xfer_path + jName + '_gis_BrMp_Grid_Sheet1CO.pdf">Grid Sheet 1</a></nobr>'; 
			return_text += '<br><nobr><a style="margin-left:25px;" href="' + xfer_path + jName + '_gis_BrMp_Grid_Sheet2CO.pdf">Grid Sheet 2</a></nobr>'; 
			ss=0;
		} else {
			return_text += '<br><nobr><a style="margin-left:25px;" href="' + xfer_path + jName + '_gis_BrMp_Grid_SheetCO.pdf">Grid Sheet</a></nobr>'; 
		}
		
		// * County Thumbnail if available
		if(CountyData[xy][columnUsed]>2) {
			thumbfile = '../thumbs/' + (CountyData[xy][0].toLowerCase()).slice(0,5) + '.jpg';
			return_text += '<br><br><div ="infotable" onClick="thumbnail(\'' + thumbfile + '\');"><nobr><span style="text-decoration:underline; color:#00f; cursor:pointer;">Thumbnail of Sheet Key</span></nobr></div>'; 
			}
		return return_text;
	}

	function TrafficSurveyMaps(xy)
	{
		// * Will Need to Cycle through all the available years.
		return_text = "";
		var eachyear = ['1999', '2000', '2001', '2002', '2003', '2004'];
		for(i=0;i<eachyear.length;i++)
		{
			switch(eachyear[i]) {
				case '1999': // Traffic Survey Maps: 1999
					DataPath= "http://dotw-xfer01.dot.state.nc.us/gisdot/DOTTSUMaps/AADT_COUNTIES_1999/"; 
					DataType=".tif";
					Title="Traffic Survey County Maps 1999";
						dataset = 'TSU_ALL';
						column = 3;
					break;
				case '2000': // Traffic Survey Maps: 2000
					DataPath= "http://dotw-xfer01.dot.state.nc.us/gisdot/DOTTSUMaps/AADT_COUNTIES_2000/"; 
					DataType=".tif";
					Title="Traffic Survey County Maps 2000";
						dataset = 'TSU_ALL';
						column = 4;
					break;
				case '2001': // Traffic Survey Maps: 2001
					DataPath= "http://dotw-xfer01.dot.state.nc.us/gisdot/DOTTSUMaps/AADT_COUNTIES_2001/"; 
					DataType=".tif";
					Title="Traffic Survey County Maps 2001";
						dataset = 'TSU_ALL';
						column = 4;
					break;
				case '2002': // Traffic Survey Maps: 2002
					DataPath= "http://dotw-xfer01.dot.state.nc.us/gisdot/DOTTSUMaps/AADT_COUNTIES_2002/"; 
					DataType=".tif";
					Title="Traffic Survey County Maps 2002";
						dataset = 'TSU_ALL';
						column = 2;
					break;
				case '2003': // Traffic Survey Maps: 2003
					DataPath= "http://dotw-xfer01.dot.state.nc.us/gisdot/DOTTSUMaps/AADT_COUNTIES_2003/"; 
					DataType=".pdf";
					Title="Traffic Survey County Maps 2003";
						dataset = 'TSU_ALL';
						column = 6;
					break;
				case '2004': // Traffic Survey Maps: 2004
					DataPath= "http://dotw-xfer01.dot.state.nc.us/gisdot/DOTTSUMaps/AADT_COUNTIES_2004/"; 
					DataType=".pdf";
					Title="Traffic Survey County Maps 2004";
						dataset = 'TSU_ALL';
						column = 6;
					break;
				
				default:
					DataPath="http://www.ncdot.org/";
					DataType=".zip";
					Title="You have reached this in error please contact <a href=MAILTO:jjeskiewicz@dot.state.nc.us?subject=javascript_error>Joe Jeskiewicz</a>";
					break;
			}
			xfer_path = DataPath;
			// * County Sheets Numbered
			return_text += '<nobr><span style="margin-left:15px; font-weight:bold;">' + eachyear[i] + '</span></nobr>';
			for(a=1;a<=CountyData[xy][column];a++) {
				if(CountyData[xy][0]=='NewHanover') {CountyData[xy][0]='New_Hanover';}
				var jName = CountyData[xy][0];
				if(CountyData[xy][0]=='New_Hanover') {CountyData[xy][0]='NewHanover';}
				return_text += '<a style="border:1px solid #BFD9ED; padding-left:3px; padding-right:3px; margin:0px; text-decoration:none;" ';
				return_text += 'href="' + xfer_path + jName + '/' + 'Sheet';
				return_text += a + DataType + '">' + a + '</a>';
				} // * End For
				return_text += '<br>';
			} // * End For (year cycle)
		return return_text;
	}
	
