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

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

function category_select(supercategories) {  
  $('articol_category_id').value = $(supercategories).find($('articol_supercategory'.value)).all
}

