function exec(command, id) {
  form = document.search;
  if(command == 'reset'){
    for(i = 0; i < form.elements.length; i++){
      if(form.elements[i].type != 'submit' && form.elements[i].type != 'button'){form.elements[i].value = '';}}
     document.search.action = "/";
  }
  if(command == 'page'){
    form.page.value=id;
  }
  if(command == 'advanced'){
    form.advanced.value=id;
  }
  if(command == 'search'){
    var url = '/';
    if(form.city.value){
      url = url + "ci_" + form.city.value.replace(/\//g, "*_*") + "/";
    }if(form.medicare_code.value){
      url = url + "me_" + form.medicare_code.value.replace(/\//g, "*_*") + "/";
    }if(form.name.value){
      url = url + "na_" + form.name.value.replace(/\//g, "*_*") + "/";
    }if(form.state.value){
      url = url + "st_" + form.state.value.replace(/\//g, "*_*") + "/";
    }if(document.search.zip.value){
      url = url + "zi_" + document.search.zip.value.replace(/\//g, "*_*") + "/";
    }if(form.page.value){
      url = url + "pa_" + form.page.value.replace(/\//g, "*_*") + "/";
      document.search.action = url;
    }
  }
  form.command.value=command;
  form.submit();
}
