<div class="comment">
<p>
<script type="text/javascript">
function updateLog() {
  new Ajax.Updater({success: 'log'},
                   <%= action(context).dump %>,
                   {
                     method: 'get',
                     parameters: <%= ajax_param("comment") %>
                   })
}

function appendComment() {
  Form.disable(<%= comment_form_name.dump %>);
  new Ajax.Updater({success: 'log'},
                   <%= action(context).dump %>,
                   {
                     method: 'get',
                     parameters:
                       <%= ajax_param("comment", comment_param_name) %>,
                     onSuccess: function() {
                       $(<%= comment_param_name.dump %>).value = "";
                       Form.enable(<%= comment_form_name.dump %>);
		     },
                     onFailure: function() {
                       Form.enable(<%= comment_form_name.dump %>);
		     }
                   });
}
</script>
<%= form2({"id" => comment_form_name,
           "onsubmit" => "appendComment(); return false;"},
          "comment", context) %>
<input type="text" class="comment" value=""
       id="<%= comment_param_name %>" name="<%= comment_param_name %>" />
<input type="submit" name="submit-comment" value="GO!" />
</form>
</p>
<p class="log" id="log">
</p>
<script type="text/javascript">
updateLog();
new PeriodicalExecuter(updateLog, 10);
</script>
</div>
