var moduleService = new Array();
var moduleDescription = new Array();

moduleService[0]="CDPAppeal";
moduleDescription[0]="Coastal Development Permit Appeal Map";

moduleService[1]="CityTree";
moduleDescription[1]="City Maintained Trees";

moduleService[2]="CityOwned";
moduleDescription[2]="City Owned Property";

moduleService[3]="Constraints";
moduleDescription[3]="Environmental Constraints";

moduleService[4]="FEMAFloodplain";
moduleDescription[4]="FEMA 100 Year Flood Plain";

moduleService[5]="GenPlan";
moduleDescription[5]="General Plan & Local Coastal Plan";

moduleService[6]="GeoReports";
moduleDescription[6] = "Geotechnical Reports";

moduleService[7]="Noise";
moduleDescription[7]="Noise Contours";

moduleService[8]="Parcels";
moduleDescription[8]="Parcels";

moduleService[9]="SafetyDistricts";
moduleDescription[9] = "Public Safety Districts";

moduleService[10]="Storm";
moduleDescription[10]="Storm Drain Systems";

moduleService[11]="Trails";
moduleDescription[11]="Trail Network";

moduleService[12]="Sewer";
moduleDescription[12]="Wastewater System";

moduleService[13]="Zoning";
moduleDescription[13]="Zoning";


function showModuleOptions()
{
  var lastMap = readCookie("lastMap");
  var lastSelected = "";
  for (var i=0; i<moduleService.length; i++)
  {
    lastSelected = "";
    if (moduleService[i] == lastMap)
      lastSelected = " SELECTED";
      document.write("<option" + lastSelected + " value=\""+moduleService[i]+"\">"+moduleDescription[i]+"</option>");
  }
}

function createCookie(name,value,days) {
	if (days) {
		var eDate = new Date();
		eDate.setTime(eDate.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+eDate.toGMTString();
	}
	else
	{
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

