/* When user click checkbox with id 'id_use_current_addr',
 * copy values over from the permanent address section
 * to the current address section
 */
function use_curr_addr_as_perm(e) {
  if (e.target.checked) {
    Ext.get('id_permanent_address').dom.value = Ext.get('id_current_address').dom.value;
    Ext.get('id_permanent_city').dom.value = Ext.get('id_current_city').dom.value;
    Ext.get('id_permanent_state').dom.value = Ext.get('id_current_state').dom.value;
    Ext.get('id_permanent_zip').dom.value = Ext.get('id_current_zip').dom.value;
    Ext.get('id_permanent_phone').dom.value = Ext.get('id_current_phone').dom.value;
  }
}


Ext.onReady(function() {
    Ext.get('id_use_current_addr').on('click', use_curr_addr_as_perm);
  });
