anchor.diff:  max_size = 20.megabyte
   allow_multiple_files = true
   url = photos_path
  +photo_field = '#photo_photo'
   %>
   <%- session_key_name = ActionController::Base.session_options[:key] -%>
   <% content_for :jstemplates do -%>
  
positive.code: 
  <h1>New photo</h1>
  
  <% form_for(:photo, :html => { :multipart => true}) do |f| %>
    <%= f.error_messages %>
    <div id="photo_uploader">
    <%= f.file_field :photo %>
    </div>
    <p><a href="javascript:jQuery('#uploadify').uploadifyClearQueue()">Cancel All Uploads</a></p>  
  <% end %>
  
negative.code: <script type="text/javascript">
  
  $(document).ready(function() {
  
    $('<%= photo_field %>').uploadify({
      method        : 'get',
      uploader      : '/javascripts/uploadify/uploadify.swf',
      script        : '<%= url %>',
      fileDataName  : $('#photo_uploader input:file')[0].name, // Extract correct name of upload field from form field
      cancelImg     : '/images/cancel.png',
      buttonText    : 'Browse',
      //buttonImg     : '/images/browse-background.png',    
      fileDesc      : '<%= dialog_file_description %> (<%= allowed_extensions.collect { |ext| "*.#{ext}" }.join(';') %>)',
      fileExt       : '<%= allowed_extensions.collect { |ext| "*.#{ext}" }.join(';') %>',
      sizeLimit     : <%= max_size %>,    
      multi         : <%= allow_multiple_files %>,
      onComplete    : function(event, queueID, fileObj, response, data) { var data = eval('(' + response + ')');$.getScript(data.photo)},
      onAllComplete : function(event, data){
        $('#uploadify_cancel').hide('blind');
        $('#uploadify_submit').show('blind');      
      },
      onSelect: function(event, queueID, fileObj){
        if (fileObj.size > <%= max_size %>) {
          alert('The image' + fileObj.name + ' is too large.')
          return false;
        }
      },  
      scriptData  : {
          'format': 'json', 
          '<%= session_key_name %>' : encodeURIComponent('<%= u cookies[session_key_name] %>'),
          'authenticity_token'  : encodeURIComponent('<%= u form_authenticity_token if protect_against_forgery? %>')
      }    
    });
    
    $('#uploadify_submit').click(function(event){
      event.preventDefault();
      $('<%= photo_field %>').uploadifyUpload();
      $('#uploadify_submit').hide();
      $('#uploadify_cancel').show();
    });
  
    $('#uploadify_cancel').click(function(event){
      event.preventDefault();
      $('<%= photo_field %>').uploadifyClearQueue();
      $('#uploadify_cancel').hide();
      $('#uploadify_submit').show();
    });
    
    
  });
  
  </script>
  <% end -%>
  <h1>Listing photos</h1>
  