// build the makes array
// used on the search page
function Build_Makes()
{
  var x = document.all.make;
  for (var i=0;i < makes.length;i++)
  {
    if (makes[i] == "")
    {
      x.options[i] = new Option("All Makes","");
    }
    else
    {
      x.options[i] = new Option(makes[i],makes[i]);
    }
  }
}

// build the models array
// used on the search page
function Build_Models()
{
  var i = document.all.make.selectedIndex;
  var x = document.all.model;
  x.options.length = 1;
  for (var j=0;j < models[i].length;j++)
  {
    if (models[i][j] == "#")
    {
      x.options[j] = new Option("All Models","");
    }
    else
    {
      x.options[j] = new Option(models[i][j],models[i][j]);
    }
  }
}

// initialize the search form
function Initialize_Form ()
{
  if (document.all.make)
  {
    Build_Makes();
    document.all.make.value = default_make;
  }
  if (document.all.model)
  {
    Build_Models();
    document.all.model.value = default_model;
  }
}