<!--

    //create the initial array to hold the different records.
    var aryCars = new Array();
    var cBox = '', yBox = '', mBox = '', oBox = '';

    //Now to bring in the data. This is a combination of
    //ColdFusion and JavaScript
    
    //The next lines create an array of 4 items in the outer array.

      aryCars[20] = new Array("chevrolet", "Corvette", "Z06", "2006 - 2007");
	  aryCars[19] = new Array("chevrolet", "Corvette", "Convertible", "2005 - 2007");
	  aryCars[18] = new Array("chevrolet", "Corvette", "Coupe", "2005 - 2007");
	  aryCars[17] = new Array("chevrolet", "Corvette", "Z06", "2008");
	  aryCars[16] = new Array("chevrolet", "Corvette", "Convertible", "2008");
	  aryCars[15] = new Array("chevrolet", "Corvette", "Coupe", "2008");
	  aryCars[14] = new Array("scion", "xD", "Hatchback", "2008");
	  aryCars[13] = new Array("scion", "xB", "Hatchback", "2008");
	  aryCars[12] = new Array("nissan", "Rogue", "SUV", "2008");
	  aryCars[11] = new Array("nissan", "350Z", "NISMO", "2007");
	  aryCars[10] = new Array("nissan", "350Z", "Roadster", "2007");
	  aryCars[9] = new Array("nissan", "350Z", "Coupe", "2007");
	  aryCars[8] = new Array("mercedesbenz", "SLR McLaren", "722", "2004 - 2007");
	  aryCars[7] = new Array("mercedesbenz", "SLR McLaren", "Coupe", "2004 - 2007");
	  aryCars[6] = new Array("mercedesbenz", "C-Class", "Sedan", "2008");
	  aryCars[5] = new Array("dodge", "Caliber", "SRT4", "2007 - 2008");
	  aryCars[4] = new Array("dodge", "Caliber", "Hatchback", "2007 - 2008");
      aryCars[3] = new Array("dodge", "Avenger", "Sedan", "2008");
	  aryCars[2] = new Array("chevrolet", "Silverado", "Crew Cab", "2007");
	  aryCars[1] = new Array("chevrolet", "Silverado", "Extended Cab", "2007");
	  aryCars[0] = new Array("chevrolet", "Silverado", "Regular Cab", "2007");	  
	  aryCars.sort();

    function updateSelects(frstSel, scndSel, thrdSel, frthSel, thisSel) {
    //This function takes four arguments.
    /*
    They will be
    the frstSel (the Class select box),
    the scndSel (the Year select box),
    the thrdSel (the Make select box)
    the frthSel (The Model select box)
    and thisSel (the select box that actually called for the change to occur).
    */

    //local variables
    var i; var chkModel = ""; var chkYear = ""; var chkStyle = "";

    //see if we just changed the first select box (Class).
    if(thisSel.name == frstSel.name) {

      //set the length of the other selects to zero to empty them
      scndSel.options.length = 0;
      thrdSel.options.length = 0;
      frthSel.options.length = 0;

      //set the first option for each (being messages to do a select).
      scndSel.options[scndSel.length] = new Option("Choose Model", "");
      thrdSel.options[thrdSel.length] = new Option("Choose Style", "");
      frthSel.options[frthSel.length] = new Option("Choose Year", "");

      //Now loop through and set the second option list (Year)

      //if a class was chosen. There is also code to prevent duplicates
      if(thisSel.options[thisSel.selectedIndex].value != "") {
	 for (i = 0; i < aryCars.length; i++) {
	    if ((aryCars[i][0].indexOf(thisSel.options[thisSel.selectedIndex].value) != -1) &&
		(chkModel.lastIndexOf(aryCars[i][1]) == -1)) {
		  scndSel.options[scndSel.length] = new Option(aryCars[i][1], aryCars[i][1]);
		  chkModel = chkModel + "," + aryCars[i][1];
		   }		 
	    }
	 }

      //change the text on the submit
	  cBox = thisSel.options[thisSel.selectedIndex].value;
      document.VSelForm.GoButton.value = 'Select this vehicle';
      document.VSelForm.GoButton.disabled = false;
	  document.VSelForm2.GoButton.value = 'Select this vehicle';
      document.VSelForm2.GoButton.disabled = false;
	  document.VSelForm3.GoButton.value = 'Select this vehicle';
      document.VSelForm3.GoButton.disabled = false;
      }

    //see if we just changed the second select box(Make).
    if(thisSel.name == scndSel.name) {

      //set the length of the third and fourth select to zero.
      thrdSel.options.length = 0;
      frthSel.options.length = 0;

      //set the first option.
      thrdSel.options[thrdSel.length] = new Option("Choose Style", "");
      frthSel.options[frthSel.length] = new Option("Choose Year", "");

      //set the rest of the values if a make was chosen skipping duplicates
      for(i=0; i < aryCars.length; i++) {
	 if(aryCars[i][0].indexOf(frstSel.options[frstSel.selectedIndex].value) != -1 &&
	    aryCars[i][1] == scndSel.options[scndSel.selectedIndex].value &&
	    (chkStyle.lastIndexOf(aryCars[i][2]) == -1)) {
	       thrdSel.options[thrdSel.length] = new Option(aryCars[i][2], aryCars[i][2]);
	       chkStyle = chkStyle + "," + aryCars[i][2];
	     }
	  }

      //change the text on the submit
      yBox = thisSel.options[thisSel.selectedIndex].value;
      document.VSelForm.GoButton.value = 'Select this vehicle';
	  document.VSelForm2.GoButton.value = 'Select this vehicle';
	  document.VSelForm3.GoButton.value = 'Select this vehicle';
       }


    //see if we just changed the third select box(Model).
    if(thisSel.name == thrdSel.name) {

      //set the length of the fourth select to zero.
      frthSel.options.length = 0;

      //set the first option.
      frthSel.options[frthSel.length] = new Option("Choose Year", "");

      //set the rest of the values if a model was chosen skipping duplicates
      for(i=0; i < aryCars.length; i++) {
	 if(aryCars[i][0].indexOf(frstSel.options[frstSel.selectedIndex].value) != -1 &&
	    aryCars[i][1] == scndSel.options[scndSel.selectedIndex].value &&
	    aryCars[i][2] == thrdSel.options[thrdSel.selectedIndex].value &&
	    (chkYear.lastIndexOf(aryCars[i][3]) == -1)) {
	       frthSel.options[frthSel.length] = new Option(aryCars[i][3], aryCars[i][3]);
	       chkYear = chkYear + "," + aryCars[i][3];
	     }
	  }

      //change the text on the submit
      mBox = thisSel.options[thisSel.selectedIndex].value;
      document.VSelForm.GoButton.value = 'Select this vehicle';
	  document.VSelForm2.GoButton.value = 'Select this vehicle';
	  document.VSelForm3.GoButton.value = 'Select this vehicle';
       }
    }

    //-->
