rendered paste body'submissionCheckpoints' : (function(){ // Replace a tag of type tag_type contained by parent_el with new_el var swapSubmitElement = function(tag_type, parent_el, new_el) { var old_el = parent_el.getElementsByTagName(tag_type); if (old_el.length) { parent_el.removeChild(old_el[0]); parent_el.appendChild(new_el); } }; // Curry swapSubmitElement to substitute buttons for labels var makeSubmitEnabler = function(parent_id, caption) { return function() { swapSubmitElement('p', gebi(parent_id), _E('input', { 'type' : 'button', 'value' : caption })); } }; // Curry swapSubmitElement to substitute labels for buttons var makeSubmitDisabler = function(parent_id, caption) { return function() { swapSubmitElement('input', gebi(parent_id), _E('p', { 'children' : [ _T(caption) ] })); } }; // Export the composite functions return { 'details' : { 'enable' : makeSubmitEnabler('submit_details', 'Submit Details'), 'disable' : makeSubmitDisabler('submit_details', 'Complete all sections to finalize the details of your event') }, 'location' : { 'enable' : makeSubmitEnabler('reserve_location', 'Reserve Location'), 'disable' : makeSubmitDisabler('reserve_location', 'Complete these sections to reserve the time and location for your event') } };})(),