function lawyer_company_still_in_position_click(chx_el, prefix) {
  var field =$(prefix + "_end_date_field")
	if (chx_el && chx_el.checked) {
    field.hide();
		$(prefix + "_end_date_2i").disabled = true;
		$(prefix + "_end_date_1i").disabled = true;
	} else {
    field.show();
		$(prefix + "_end_date_2i").disabled = false;
		$(prefix + "_end_date_1i").disabled = false;
	}	
}

function billing_type_change(select_el, prefix) {

  var billing_type = select_el.options[select_el.selectedIndex].value;
  var divs = ["min_max_hourly", "min_max_contingency", "acceptance", "percent", "minutes"]
  var type_divs = {
    "hourly": "min_max_hourly",
    "contingency": "min_max_contingency",
    "fixed": "acceptance",
    "retainer": "acceptance",
    "probono": "percent",
    "free_consultation": "minutes"
  }
  var div = type_divs[billing_type];
  var el;
  for(var i = 0; i < divs.length; i++) {
    el = $(prefix + '_' + divs[i]);
    if(el) {
      if(div == divs[i]) {
        el.show();
      } else {
        el.hide();
      }
    }
  }
}

function show_fields(prefix, coremetrics_event_name) {
  var fields = $(prefix + '_hidden_fields');
  if(fields.style.display == 'none') {
    fields.blindDown();
    cmCreateConversionEventTag(coremetrics_event_name, '1', 'Lawyer Profile', '1');
  }
  var action = $(prefix + '_action');
  if(action) {
    action.hide();
  }
}

function hide_fields(prefix) {
  var fields = $(prefix + '_hidden_fields');
  if(fields.style.display != 'none') {
    fields.blindUp();
  }
  var action = $(prefix + '_action');
  if(action) {
    action.show();
  }
}
