function updateSelect($targetElement, options, emptyOptionHtml) { $targetElement.children().not('[value=""]').remove(); $j.each(options, function(index, value){ $j(value).appendTo($targetElement); }); if (options.length > 0) { $targetElement.removeAttr('disabled'); $targetElement.children('[value=""]').first().html(emptyOptionHtml || "Selecione uma opção"); } else $targetElement.children(':first').html('Sem opções'); } function resetSelect($targetElement) { $targetElement.children().not('[value=""]').remove(); $targetElement.children().first().attr('checked', 'checked'); //$targetElement.attr('disabled', 'disabled'); } function xmlResourcesToSelectOptions(resources, parentNodeName, nodeIdAttrName, nodeValueAttrName) { var options = []; $j.each($j(resources).find(parentNodeName).children(), function(index, value){ var $value = $j(value); var text; var $option = $j('