	function findstyle()
	{
		for(var i=0; i < document.menuform.elements.length; i++)
		{
			if(document.menuform.elements[i].name == 'style')
			{
				return document.menuform.elements[i];
			}
		}// end for
	}// end function findstyle

	/**********************************************************
	 * Function sets up the form with the default menus and
	 * 	adds the event handlers needed
	*/
	function initform()
	{
		var makes,
		    models,
		    styles,
		    first,
		    funct;
		
		var yearmenu    = document.menuform.year;
		var makemenu    = document.menuform.make;
		var modelmenu   = document.menuform.model;
		var stylemenu   = document.menuform.style;

		if(curmake == '')
		{
			curmake = makeoptions[0];
		}
		GenJS_ResetOptions(makemenu,makeoptions,curmake);

		curmake = curmake.replace(/[ ]/g,"_");
		funct = new Function("return years_for_" + curmake);
		years = funct();
		if(curyear == '')
		{
			curyear = years[0];
		}
		GenJS_ResetOptions(yearmenu,years,curyear);

		if(curyear != 'none available')
		{
			funct = new Function("return models_for_" + curyear + "_" + curmake);
			models = funct();
		}
		else
		{
			models = ['none available'];
		}

		if(curmodel == '')
		{
			curmodel = models[0];
		}
		GenJS_ResetOptions(modelmenu,models,curmodel);

		if(curmodel != 'none available')
		{
			curmodel = curmodel.replace(/[ ]/g,"_");
			funct = new Function("return styles_for_" + curyear + "_" + curmake + "_" + curmodel);
			styles = funct();

		}
		else
		{
			styles = ['none available'];
		}
		
		if(curstyle == '')
		{
			curstyle = styles[0];
		}
		GenJS_ResetOptions(stylemenu,styles,curstyle);

		makemenu.onchange  = new Function("choicechanged('make')");
		yearmenu.onchange  = new Function("choicechanged('year')");
		modelmenu.onchange = new Function("choicechanged('model')");
	}// end function initform

	/**********************************************************
	 * Function resets the child menus to the new options for
	 * 	value selected.
	*/
	function choicechanged(type) {
		var types,
		    typemenus,
		    end,
		    curyear,
		    curparent,
		    childoptions,
		    parent,
		    child,
		    parentmenu,
		    childmenu;

		curmake   = GenJS_GetSelected(document.menuform.make);
		curmake   = curmake.replace(/[ ]/g,'_');
		
		types     = ['make','year','model','style'];
		typemenus = [
			document.menuform.make,
			document.menuform.year,
			document.menuform.model,
			document.menuform.style];

		parent = type;
		while(parent != 'style') {

			// find the parent and child menus
			for(var i=0; i<types.length; i++) {
				if(parent == types[i]) {
					parentmenu = typemenus[i];
					childmenu  = typemenus[i+1];
					child      = types[i+1];
				}
			}

			// find the selected value of the parent
			curparent = GenJS_GetSelected(parentmenu);

			if(parent != 'make') {
				curyear   = GenJS_GetSelected(document.menuform.year);
			}


			if(curparent == 'none available') {
				childoptions = ['none available'];
			} else {
				curparent = curparent.replace(/[ ]/g, '_');
				if(parent == 'make') {
					end = curparent;
				} else if(parent == 'year') {
					end = curparent + "_" + curmake;
				} else {
					end = curyear + "_" + curmake + "_" + curparent;
				}
				funct = new Function("return " + child + "s_for_" + end);
				childoptions = funct();
			}
			childsetting = childoptions[0];
			GenJS_ResetOptions(childmenu,childoptions,childsetting);

			// move down to the next menu
			parent = child;
		}// end while
	}// end of choicechanged function
