function remove_fields(link) {
  $(link).previous("input[type=hidden]").setValue("1");
  $(link).up(".fields").hide();
}

function add_fields(link, association, content) {
  var new_id = new Date().getTime();
  var regexp = new RegExp("new_" + association, "g")
  $(link).up().insert({
    before: content.replace(regexp, new_id)
  });
  Tooltips.activate($$('tooltipTrigger'));
}

function payment_method(element, value) {
  var txt = '';
  switch (value) {
    case "Credit Card": txt =  "We'll contact you"; break;
    case "Cheque": txt = "<strong>Post to:</strong><br/>Kimberley Cruise Centre<br/>Po Box 216 Cronulla NSW 2230        <br/>"; break;
    case "Direct Deposit": txt = "We will contact you and provide details"; break;
  }
  $('instruct_method').innerHTML = txt;
  if (txt == '') {
    $('instruct_method').hide();
  } else {
    $('instruct_method').show();
  }
}
