//{{{ function progress_recipes_form()
/**
  This eliminates the button element in the form and changes recipes
  once the item is selected on the list. Javascript is used for this
  so those with Javascript disabled can still use the form
  */
function progress_recipes_form() {

  var i, option, 
    form = document.getElementById('recipe_list'),
    div = form.getElementsByTagName('div')[0],
    button = div.getElementsByTagName('button')[0],
    select = document.getElementById('recipe_choice');

  div.removeChild(button);

  select.onchange = function() {
    var options = this.getElementsByTagName('option'),
      index = this.selectedIndex;
    location.assign('eating.php?r=' + options[index].getAttribute('value'));
  }
}

//}}}

addLoadEvent(progress_recipes_form);
