Refactored javascript for hiding/showing editable sections.