<% if not request.xhr? %>
<table class="ajax-scaffold" cellpadding="0" cellspacing="0">
  <tbody>
<% end %>
<tr id="<%= "edit-tag-#{@tag.id}" %>" class="edit" <%= "style=\"display: none;\"" if request.xhr? %> >
	<td colspan="<%= num_columns %>">
		<%= form_remote_tag :url => { :controller => 'Tags', :action => 'update', :id => @tag },
  		                   :loading => "AjaxScaffold.updateOnLoading(request,'tag',#{@tag.id});", 
		                     :success => "AjaxScaffold.updateOnSuccess(request,'tag',#{@tag.id});", 
		                     :failure => "AjaxScaffold.updateOnFailure(request,'tag',#{@tag.id});", 
		                     :html => { :action => url_for(:controller => 'Tags', :action => 'update', :id => @tag),
		                                :id => "edit-tag-#{@tag.id}-form" } %>
  	
      <% # Its actually okay to leave both of these elements (ex: form_errors will only generate HTML when in fallback mode) %>
      <% if request.xhr? %>
        <div id="<%= "update-tag-#{@tag.id}-errors" %>" style="display: none;" ></div>
      <% else %>
        <%= render :partial => 'form_errors' %>
      <% end %>

	<div class="red">Edit Page</div>
	  	
  	<div class="articles">
  	
  	  <%= render :partial => 'form' %>
  	
  	  	<%= submit_tag "Update", :class => "submit" %>
  	  	<%= link_to_function "Cancel", "AjaxScaffold.updateOnCancel('tag',#{@tag.id});",
	                              :href => url_for(:controller => 'Tags', :action => 'return_to_main') %>
  	  	<%= loading_indicator_tag 'tag', "update-#{@tag.id}" %>
  	 
  	<%= end_form_tag %>
  	</div>
	</td>
</tr>
<% if not request.xhr? %>
  </tbody>
</table>
<% end %>