/*
	Navigation Program for www.AsheNCEDC.com
			This program is copyrighted by Jason Carlton, on December 30, 2004. No
			part of this program may be modified or copied without the written consent
			of the author. JCarlton@goWilkes.com
*/

var home = "http://www.ashencedc.com";
var xx;

function menu(x, offset, width) {
	var showMenu;

// ABOUT ASHE 
// Local Info, Location, Government, Workforce, Major Employers 
	if (x == 2) {
		names = new Array (
			"LOCAL INFO",
			"LOCATION",
			"GOVERNMENT",
			"WORKFORCE",
			"MAJOR EMPLOYERS"
		);
		links = new Array (
			home + "/local/",
			home + "/location/",
			home + "/government/",
			home + "/workforce/",
			home + "/employers/"
		);
	}

// REPRESENTATION 
// Meetings Calendar, Officials, Town Manager 
	if (x == 3) {
		names = new Array (
			"OFFICIALS",
			"TOWN MANAGER",
			"MEETINGS CALENDAR"
		);
		links = new Array (
			home + "/officials/",
			home + "/townmanager/",
			home + "/cgi-bin/meetings.cgi" 
		);
	}

// PLANNING & ZONING 
// Administration, Planning and Inspections, Finance, Street Maintenance, Sanitation, Leaf Collection, 
// Recreation, Public Utilities, Fire Department, Police Department 
	if (x == 4) {
		names = new Array (
			"ADMINISTRATION",
			"FINANCE",
			"FIRE DEPARTMENT",
			"LEAF COLLECTION",
			"PLANNING &amp; INSPECTIONS",
			"POLICE DEPARTMENT",
			"PUBLIC UTILITIES",
			"RECREATION",
			"SANITATION",
			"STREET MAINTENANCE"
		);
		links = new Array (
			home + "/departments/#admin",
			home + "/departments/#finance",
			home + "/departments/#fire",
			home + "/departments/#leaf",
			home + "/planning/",
			home + "/departments/#police",
			home + "/departments/#utilities",
			home + "/departments/#recreation",
			home + "/departments/#sanitation",
			home + "/departments/#street"
		);
	}

// ECONOMIC DEVELOPMENT 
// Population, Demographics, Education, Earnings Statistics, Employment Data, Tax Rates & Utilities, Traffic Counts, Available Properties, Business & Industry Links 
	if (x == 5) {
		names = new Array (
			"INTRODUCTION",
			"POPULATION",
			"DEMOGRAPHICS",
			"EDUCATION",
			"EARNINGS STATISTICS",
			"EMPLOYMENT DATA",
			"TAX RATES &amp; UTILITIES",
			"TRAFFIC COUNTS",
			"AVAILABLE PROPERTIES",
			"BUSINESS &amp; INDUSTRY LINKS"
		);
		links = new Array (
			home + "/economicdevelopment/",
			home + "/economicdevelopment/population.php",
			home + "/economicdevelopment/demographics.php",
			home + "/economicdevelopment/education.php",
			home + "/economicdevelopment/earnings.php",
			home + "/economicdevelopment/employment.php",
			home + "/economicdevelopment/tax_utilities.php",
			home + "/economicdevelopment/traffic.php",
			home + "/cgi-bin/properties.cgi",
			home + "/economicdevelopment/businesslinks.php"
		);
	}

// ORGANIZATION 
// Contact Info 
	if (x == 6) {
		names = new Array (
			"CONTACT INFO"
		);
		links = new Array (
			home + "/contact/"
		);
	}


	if (x == 0) { showMenu = "&nbsp;" }
	else {
			// Change OffSet for Netscape 6.0+ 
//		if (navigator.userAgent.indexOf("Netscape") >= 5) { offset = offset + 280 }

		showMenu = "<table cellpadding='3' cellspacing='0' border='0' width='" + width + "' bgcolor='#E2E4E3' class='menu_transparent' style='border-collapse: collapse; position: relative; left: " + offset + "px'>";  // ; top: 190px

		for (count=0; count < names.length; count++) {
			showMenu = showMenu + "<tr>";
			showMenu = showMenu + "<td align=\"center\" onMouseOver=\"clearTimeout(xx); this.style.cursor='hand'\" onMouseOut=\"xx=setTimeout('menu(0), changeColor(0, " + x + ")', 1000)\" onClick=\"window.location.href='" + links[count] + "'\">";
			showMenu = showMenu + "<font face='Tahoma, Verdana, Arial, Helvetica' color='#808080' size='-1' class='small'><a href='" + links[count] + "' class='submenu'>" + names[count] + "</a></font>";
			showMenu = showMenu + "</td>";
			showMenu = showMenu + "</tr>";
		}

		showMenu = showMenu + "</table>";
	}

	// Show Sub Menu 
	if (document.getElementById) { document.getElementById("Menu").innerHTML = showMenu; }
	else if (document.all) { document.Menu.innerHTML = showMenu; }
	else if (document.layers) { 
		document.layers.Menu.document.write(showMenu);
		document.layers.Menu.document.close();
	}
}


function changeColor(toggle, y) {
	var item, text_item;

	if (toggle == "1") { cellcolor = '#E2E4E3'; textcolor = '#808080'; }
	else { cellcolor = '#AEB3B0'; textcolor = '#FFFFFF'; }

	if (document.getElementById) {
		item = document.getElementById(y);
		text_item = document.getElementById("text_" + y);
	}

	else if (document.all) {
		item = document.all(y);
		text_item = document.all("text_" + y);
	}

   if (item && item.style) {
	 	item.style.backgroundColor = cellcolor;
		text_item.style.color = textcolor;
	}
}

