function submitForm() {
  document.getElementById('locatorform').submit();
}
function clearZipAndSubmit() {
  z = document.getElementById('id_zip');
  if (z) {
    if ( z.options.length > 0) {
    z.options[0].value = "";
    z.options[0].text = "";
    z.selectedIndex=0;
    }
  }
  submitForm(); 
}

function getFile(url) {
  if (window.XMLHttpRequest) {              
    AJAX=new XMLHttpRequest();              
  } else {                                  
    AJAX=new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (AJAX) {
     AJAX.open("GET", url, false);                             
     AJAX.send(null);
     return AJAX.responseText;                                         
  } else {
     return false;
  }                                             
}

function loadLocation(object_id) {
  var result = getFile('/locations/'+object_id+'/');
  document.getElementById('locationbox').innerHTML = result;
}


