function makeArray() {
var args = makeArray.arguments;
    for (var i = 0; i < args.length; i++) {
    this[i] = args[i];
    }
this.length = args.length;
}

// This array holds the descriptions and names of the pages.
var pages = new makeArray("Select a subject",
"Curfew",
"Daytime Curfew",
"Definitions",
"Drive-By Shooting",
"Enhanced Penalties&mdash;Sentencing",
"Eviction",
"Gang Membership",
"Gang Participation",
"Gang Recruitment",
"Graffiti",
"Graffiti Tools",
"Juvenile Gatherings",
"Law Enforcement Training",
"Loitering",
"Miscellaneous",
"Parental Responsibility",
"Public Nuisance",
"Truancy",
"Weapons");

// This array hold the URLs of the pages.
var urls = new makeArray("",
"municipal%20code--curfew.htm",
"municipal%20codes--daytime%20curfew.htm",
"municipal%20codes--definitions.htm",
"drive-by-shooting.htm",
"enhanced-penalties-sentencing.htm",
"municipal%20code--eviction.htm",
"gang-membership.htm",
"gang-participation.htm",
"municipal%20codes--gang%20recruitment.htm",
"municipal%20codes--graffiti.htm",
"municipal%20codes--graffiti%20tools.htm",
"municipal%20code--juvenile%20gatherings.htm",
"municipal%20codes--law%20enforcement%20training.htm",
"municipal%20code--loitering.htm",
"miscellaneous.htm",
"municipal%20codes--parent%20responsibility.htm",
"municipal%20codes--public%20nuisance.htm",
"municipal%20codes--truancy.htm",
"municipal%20code--weapons.htm");

// This function determines which page is selected and goes to it.
function goPage(form) {
i = form.menu.selectedIndex;
    if (i != 0) {
    window.location.href = urls[i];
	}
}

// display a drop down menu.
document.write('<div class="formnav"><FORM name="msubjects"><SELECT class="formstyle" NAME="menu" onChange="goPage(this.form)">');
    for (var i = 0; i < pages.length; i++) {
    document.write('<OPTION>' + pages[i]);
    }
document.write('</SELECT></FORM></div>');
document.close();
//note array starts at 0
//stateindex is defined in the HTML
if (document.msubjects) {document.msubjects.menu.selectedIndex = municipalindex;}
