// JavaScript Document

function writeMenu(mNum, cPage, sNum, sPage) {
	var menuStr;
	var menuURL=new Array();
	var menuItm=new Array();
	
	var subMenuURL=new Array();
	var subMenuItm=new Array();
		
	menuStr = "<ul>";

	switch (mNum) {
	case 1:
		//Home
	break    
	
	case 2:
	//NEWS
	  	menuItm[0]="Chimney Cleaning Activity"
	  	menuURL[0]="/news/ChimneyCleaning.html"
		menuItm[1]="Fireworks"
	  	menuURL[1]="/news/fireworks.html"
	  	menuItm[2]="Coyote Attack"
	  	menuURL[2]="/news/coyote.html"
	  	menuItm[3]="Route 7"
	  	menuURL[3]="/news/widening.html"
	  	menuItm[4]="Identity Theft"
	  	menuURL[4]="/news/identity.html"
	  	menuItm[5]="Cell Phones"
	  	menuURL[5]="/news/cellphones.html"
	  	menuItm[6]="Internet Safety"
	  	menuURL[6]="/news/internetsafety.html"
	  	menuItm[7]="Halloween Safety"
	  	menuURL[7]="/news/halloween.html"
		menuItm[8]="U.S. Census Scam"
	  	menuURL[8]="/news/USCensusScam.html"
		
		break
	
	case 3:
	//COMMUNITY
	  	menuItm[0]="Crime Prevention"
	  	menuURL[0]="/community/index.html"
		menuItm[1]="Crime Watch"
	  	menuURL[1]="/community/crimewatch.html"
	  	menuItm[2]="Dog Laws"
	  	menuURL[2]="/community/doglaws.html"
	  	menuItm[3]="Emergency Information"
	  	menuURL[3]="/community/emergency.html"
		menuItm[4]="Police Explorers"
	  	menuURL[4]="/community/explorers.html"
		menuItm[5]="Lost and Found"
	  	menuURL[5]="/community/lostfound.html"
		menuItm[6]="Citizen Police Academy"
	  	menuURL[6]="/community/citizenpoliceacademy.html"
		menuItm[7]="RUOK System"
	  	menuURL[7]="/community/ruok.html"
		menuItm[8]="Special Olympics<br/>Torch Run"
	  	menuURL[8]="/community/specialolympics.html"
		break
	
	case 4:
	//STAFF
		menuItm[0]="E-mail the Staff"
	  	menuURL[0]="/staff/index.html"
		menuItm[1]="Accident Reconstruction"
	  	menuURL[1]="/staff/accident.html"
	  	menuItm[2]="Wilton Police Awards"
	  	menuURL[2]="/staff/awards.html"
	  	menuItm[3]="Bike Patrol"
	  	menuURL[3]="/staff/bikepatrol.html"
		menuItm[4]="Recent Promotions"
	  	menuURL[4]="/staff/promotions.html"
		menuItm[5]="Recruitment"
	  	menuURL[5]="/staff/recruitment.html"
		menuItm[6]="School Resource Officer"
	  	menuURL[6]="/staff/resourceofficer.html"
		menuItm[7]="Retirements"
	  	menuURL[7]="/staff/retirements.html"
		menuItm[8]="Dive Rescue Team"
	  	menuURL[8]="/staff/scuba.html"
		menuItm[9]="Traffic Patrol"
	  	menuURL[9]="/staff/trafficpatrol.html"
		menuItm[9]="Commissioners"
	  	menuURL[9]="/staff/Commissioners.html"
		break	
	
	case 5:
	//INFO
		menuItm[0]="Frequently Asked Questions"
	  	menuURL[0]="/info/faq.html"
		menuItm[1]="Road Closures"
	  	menuURL[1]="/info/closures.html"
	  	menuItm[2]="DWI Info"
	  	menuURL[2]="/info/dwi.html"
	  	menuItm[3]="Emergency Email List"
	  	menuURL[3]="/info/emaillist.html"
		menuItm[4]="Important Links"
	  	menuURL[4]="/info/links.html"
		menuItm[5]="Patch Collectors"
	  	menuURL[5]="/info/patch.html"
		menuItm[6]="Pool Safety"
	  	menuURL[6]="/info/pool.html"
		menuItm[7]="Annual Report"
	  	menuURL[7]="/info/report.html"
		menuItm[8]="Online Tour"
	  	menuURL[8]="/info/tour.html"
		break	
	
	//switch (mNum) {
	//case 1:
		//Home
	//break    
	
	//case 2:
	//NEWS
	  	//menuItm[0]="Fireworks"
	  	//menuURL[0]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/fireworks.html"
	  	//menuItm[1]="Coyote"
	  	//menuURL[1]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/coyote.html"
	  	//menuItm[2]="Blasting"
	  	//menuURL[2]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/blasting.html"
	  	//menuItm[3]="Route 7"
	  	//menuURL[3]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/widening.html"
	  	//menuItm[4]="Identity Theft"
	  	//menuURL[4]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/identity.html"
	  	//menuItm[5]="Cell Phones"
	  	//menuURL[5]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/cellphones.html"
	  	//menuItm[6]="Internet Safety"
	  	//menuURL[6]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/internetsafety.html"
	  	//menuItm[7]="Halloween Safety"
	  	//menuURL[7]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/halloween.html"

//menuItm[8]="Test"
	  	//menuURL[8]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/news/halloween.html"

//break
	
	//case 3:
	//COMMUNITY
		//menuItm[0]="Crime Prevention"
	  	//menuURL[0]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/index.html"
	  	//menuItm[1]="Dog Laws"
	  	//menuURL[1]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/doglaws.html"
	  	//menuItm[2]="Emergency Information"
	  	//menuURL[2]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/emergency.html"
		//menuItm[3]="Police Explorers"
	  	//menuURL[3]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/explorers.html"
		//menuItm[4]="Lost and Found"
	  	//menuURL[4]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/lostfound.html"
		//menuItm[5]="Citizen Police Academy"
	  	//menuURL[5]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/policeacademy.html"
		//menuItm[6]="Crime Watch"
	  	//menuURL[6]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/crimewatch.html"
		//menuItm[7]="RUOK System"
	  	//menuURL[7]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/ruok.html"
		//menuItm[8]="Special Olympics<br/>Torch Run"
	  	//menuURL[8]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/community/specialolympics.html"
		//break
	
	//case 4:
	//STAFF
		//menuItm[0]="Email the Staff"
	  	//menuURL[0]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/index.html"
		//menuItm[1]="Accident Reconstruction"
	  	//menuURL[1]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/accident.html"
	  	//menuItm[2]="Wilton Police Awards"
	  	//menuURL[2]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/awards.html"
	  	//menuItm[3]="Bike Patrol"
	  	//menuURL[3]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/bikepatrol.html"
		//menuItm[4]="New Police Officers"
	  	//menuURL[4]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/newofficers.html"
		//menuItm[5]="Recent Promotions"
	  	//menuURL[5]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/promotions.html"
		//menuItm[6]="Recruitment"
	  	//menuURL[6]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/recruitment.html"
		//menuItm[7]="School Resource Officer"
	  	//menuURL[7]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/resourceofficer.html"
		//menuItm[8]="Retirements"
	  	//menuURL[8]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/retirements.html"
		//menuItm[9]="Dive Rescue Team"
	  	//menuURL[9]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/scuba.html"
		//menuItm[10]="Traffic Patrol"
	  	//menuURL[10]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/staff/trafficpatrol.html"
		//break	
	
	//case 5:
	//INFO
		//menuItm[0]="FAQ"
	  	//menuURL[0]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/index.html"
		//menuItm[1]="Road Closures"
	  	//menuURL[1]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/closures.html"
	  	//menuItm[2]="DWI Info"
	  	//menuURL[2]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/dwi.html"
	  	//menuItm[3]="Emergency Email List"
	  	//menuURL[3]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/emaillist.html"
		//menuItm[4]="Important Links"
	  	//menuURL[4]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/links.html"
		//menuItm[5]="Patch Collectors"
	  	//menuURL[5]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/patch.html"
		//menuItm[6]="Pool Safety"
	  	//menuURL[6]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/pool.html"
		//menuItm[7]="Annual Report"
	  	//menuURL[7]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/report.html"
		//menuItm[8]="Online Tour"
	  	//menuURL[8]="file:///POLYGON/Sites/Town%20of%20Wilton/wwwroot/wiltonpolicebeta/info/tour.html"
		//break
	
	default:
	
	
	}
	
	

//-----------------------------------------------------------------
//SECOND TIER MENUs
//-----------------------------------------------------------------
	switch (sNum) {
	case 1: 
		//Home
	break
	
	case 2:
		//General Information
	break
	
	case 3: 
		//Safety
		//subMenuItm[0]="Smoke Alarm FAQs"
		//subMenuURL[0]="/safety/faq1.html"
	break
	
	case 4: 
		//Links
	break
	
	case 5:
		//Emergency Information
	break

	default:
	}

	for (i=0; i< menuItm.length; i++) {
		menuStr += "<li><a href='";
		menuStr += menuURL[i];
		menuStr += "'";
		if (menuURL[i] == cPage) {
			menuStr += " class='selected' ";
		}
		menuStr += ">";
		menuStr += menuItm[i];
		menuStr += "</a>";
	//ADD Second tier menu here
		if (sNum && (menuURL[i] == cPage)) {
			menuStr += "<div id='subMenu'><ul>";
			for (ix=0; ix< subMenuItm.length; ix++) {
				menuStr += "<li><a href='";
				menuStr += subMenuURL[ix];
				menuStr += "'";
				if (subMenuURL[ix] == sPage) {
					menuStr += " class='selected' ";
				}
				menuStr += ">";
				menuStr += subMenuItm[ix];
				menuStr += "</a>";
				menuStr += "</li>";
			}
			menuStr += "</ul></div>";
		}
		//END second tier submenu declaration
		menuStr += "</li>";
	}

	menuStr += "</ul>";

document.write(menuStr);

}