// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function lookup_postcode(index) {
  var postcode = $(index+'_postcode').value;
  if(postcode != '') {
    $(index+'_address_loader').show();
    new Ajax.Request('/postcode/lookup/'+index+'?postcode='+postcode, {evalJS: true});    
  }
}

function hide_address_fields(index) {
  if($(index+'_postcode').value == "") {
    $(index+'_address').hide();
  }
}
