<% form_remote_tag :url      => @article.comment_url,
                    :position => :bottom,
                    :update   => {:success => 'commentList'},
                    :loading  => "loading()",
                    :complete => "complete(request)",
                    :failure  => "failure(request)",
                    :html     => {:id => 'commentform', :class => 'comments' } \
    do %>

<div id="preview" style="display:none"></div>

<fieldset>
  <legend><%= _("Comments") %></legend>
  <p>
    <label><%= _("Name")%>:<br />
      <%= text_field "comment", "author" %>
      <small>(<%= link_to_function(_("leave url/email") + " &#187;", "Effect.toggle('extra_fields', 'blind', {duration: .3})") %>)</small>
    </label>
  </p>

  <div id="extra_fields" style="display:none;">
      <p>
        <label><%= _("Email") %>: <%= content_tag('small', "(#{link_to('gravatar', 'http://gravatar.com')} "+ _("enabled") + ")") if this_blog.use_gravatar %><br />
          <%= text_field "comment", "email" %>
        </label>
      </p>
      <p>
        <label><%= _("Url")%>:<br />
          <%= text_field "comment", "url" %>
        </label>
      </p>
  </div>

  <p>
    <label>
      <%= _("Comments")%>:
      <%= content_tag('small', link_to(_("Textile enabled"), "http://hobix.com/textile/")) if this_blog.comment_text_filter.include? 'textile' %>
      <%= content_tag('small', link_to(_("Markdown enabled"), "http://daringfireball.net/projects/markdown/")) if this_blog.comment_text_filter.include? 'markdown' %>
      <br />
      <%= text_area 'comment', 'body' %>
    </label>
  </p>

  <p>
    <%= submit_to_remote('preview', _('Preview') + '!',
                         :update => 'preview',
                         :complete => "Element.show('preview')",
                         :url    => @article.preview_comment_url) %>
    <%= submit_tag _('Submit'), :id => 'form-submit-button',  :onclick => "$('commentform').onsubmit();this.disabled=true;Element.hide('preview');return false;" %>
    <%= image_tag '/images/theme/spinner.gif', :id => 'comment_loading', :style => 'display:none' %>
  </p>
</fieldset>
<% end %>
