<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/flash/swfupload.swf</filename>
    </added>
    <added>
      <filename>public/images/TestImageNoText_65x29.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 swfupload-rails-authentication
 ==============================
 
-Demo Rails 2.1 app showing SWFUpload working in tandem with restful-authentication, CSRF protection and attachment_fu.
+Demo Rails 2.1.2 app showing SWFUpload working in tandem with restful-authentication, CSRF protection and attachment_fu.
 
 
 Requirements</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -6,12 +6,25 @@
   window.onload = function () {
     swfu = new SWFUpload({
       upload_url : '&lt;%= assets_path -%&gt;?_swfupload_demo_session=&lt;%= u session.session_id %&gt;',
-      flash_url : '/flash/swfupload_f9.swf',
+      flash_url : '/flash/swfupload.swf',
+
+			// Button settings
+			button_image_url: &quot;/images/TestImageNoText_65x29.png&quot;,	// Relative to the Flash file
+			button_width: &quot;65&quot;,
+			button_height: &quot;29&quot;,
+			button_placeholder_id: &quot;spanButtonPlaceHolder&quot;,
+			button_text: '&lt;span class=&quot;theFont&quot;&gt;Hello&lt;/span&gt;',
+			button_text_style: &quot;.theFont { font-size: 16; }&quot;,
+			button_text_left_padding: 12,
+			button_text_top_padding: 3,
 
       file_size_limit : '10000',
       file_types : '*.jpg',
       file_types_description : 'JPG Images',
       file_upload_limit : '0',
+			custom_settings : {
+				progressTarget : &quot;fsUploadProgress&quot;
+			},
 
       file_queue_error_handler : fileQueueError,
       file_dialog_complete_handler : fileDialogComplete,
@@ -39,9 +52,10 @@
 
 		&lt;% form_for(@asset) do |f| %&gt;
 			&lt;fieldset&gt;
-				&lt;button id=&quot;btnBrowse&quot; type=&quot;button&quot; style=&quot;padding: 5px;&quot; onclick=&quot;swfu.selectFiles(); this.blur();&quot;&gt;
-				  Select Files &lt;span style=&quot;font-size: 7pt;&quot;&gt;(5 MB Max)&lt;/span&gt;
-			  &lt;/button&gt;
+				&lt;div id=&quot;divStatus&quot;&gt;0 Files Uploaded&lt;/div&gt;
+					&lt;div&gt;
+						&lt;span id=&quot;spanButtonPlaceHolder&quot;&gt;&lt;/span&gt;
+					&lt;/div&gt;
 			&lt;/fieldset&gt;
 		&lt;% end %&gt;
 </diff>
      <filename>app/views/assets/new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 # ENV['RAILS_ENV'] ||= 'production'
 
 # Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION
 
 # Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,27 @@
 /**
- * SWFUpload v2.1.0 by Jacob Roberts, Feb 2008, http://www.swfupload.org, http://swfupload.googlecode.com, http://www.swfupload.org
- * -------- -------- -------- -------- -------- -------- -------- --------
- * SWFUpload is (c) 2006 Lars Huring, Olov Nilz&#233;n and Mammon Media and is released under the MIT License:
+ * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
+ *
+ * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/,  http://www.vinterwebb.se/
+ *
+ * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilz&#233;n and Mammon Media and is released under the MIT License:
  * http://www.opensource.org/licenses/mit-license.php
  *
- * See Changelog.txt for version history
+ * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
  *
  */
 
 
-/* *********** */
-/* Constructor */
-/* *********** */
+/* ******************* */
+/* Constructor &amp; Init  */
+/* ******************* */
+var SWFUpload;
 
-var SWFUpload = function (settings) {
-	this.initSWFUpload(settings);
-};
+if (SWFUpload == undefined) {
+	SWFUpload = function (settings) {
+		this.initSWFUpload(settings);
+	};
+}
 
 SWFUpload.prototype.initSWFUpload = function (settings) {
 	try {
@@ -43,7 +49,7 @@ SWFUpload.prototype.initSWFUpload = function (settings) {
 /* *************** */
 SWFUpload.instances = {};
 SWFUpload.movieCount = 0;
-SWFUpload.version = &quot;2.1.0&quot;;
+SWFUpload.version = &quot;2.2.0 Beta 2&quot;;
 SWFUpload.QUEUE_ERROR = {
 	QUEUE_LIMIT_EXCEEDED	  		: -100,
 	FILE_EXCEEDS_SIZE_LIMIT  		: -110,
@@ -69,7 +75,20 @@ SWFUpload.FILE_STATUS = {
 	COMPLETE	 : -4,
 	CANCELLED	 : -5
 };
-
+SWFUpload.BUTTON_ACTION = {
+	SELECT_FILE  : -100,
+	SELECT_FILES : -110,
+	START_UPLOAD : -120
+};
+SWFUpload.CURSOR = {
+	ARROW : -1,
+	HAND : -2
+};
+SWFUpload.WINDOW_MODE = {
+	WINDOW : &quot;window&quot;,
+	TRANSPARENT : &quot;transparent&quot;,
+	OPAQUE : &quot;opaque&quot;
+};
 
 /* ******************** */
 /* Instance Members  */
@@ -88,6 +107,7 @@ SWFUpload.prototype.initSettings = function () {
 	this.ensureDefault(&quot;post_params&quot;, {});
 	this.ensureDefault(&quot;use_query_string&quot;, false);
 	this.ensureDefault(&quot;requeue_on_error&quot;, false);
+	this.ensureDefault(&quot;http_success&quot;, []);
 	
 	// File Settings
 	this.ensureDefault(&quot;file_types&quot;, &quot;*.*&quot;);
@@ -97,9 +117,23 @@ SWFUpload.prototype.initSettings = function () {
 	this.ensureDefault(&quot;file_queue_limit&quot;, 0);
 
 	// Flash Settings
-	this.ensureDefault(&quot;flash_url&quot;, &quot;swfupload_f9.swf&quot;);
-	this.ensureDefault(&quot;flash_color&quot;, &quot;#FFFFFF&quot;);
-
+	this.ensureDefault(&quot;flash_url&quot;, &quot;swfupload.swf&quot;);
+	this.ensureDefault(&quot;prevent_swf_caching&quot;, true);
+	
+	// Button Settings
+	this.ensureDefault(&quot;button_image_url&quot;, &quot;&quot;);
+	this.ensureDefault(&quot;button_width&quot;, 1);
+	this.ensureDefault(&quot;button_height&quot;, 1);
+	this.ensureDefault(&quot;button_text&quot;, &quot;&quot;);
+	this.ensureDefault(&quot;button_text_style&quot;, &quot;color: #000000; font-size: 16pt;&quot;);
+	this.ensureDefault(&quot;button_text_top_padding&quot;, 0);
+	this.ensureDefault(&quot;button_text_left_padding&quot;, 0);
+	this.ensureDefault(&quot;button_action&quot;, SWFUpload.BUTTON_ACTION.SELECT_FILES);
+	this.ensureDefault(&quot;button_disabled&quot;, false);
+	this.ensureDefault(&quot;button_placeholder_id&quot;, null);
+	this.ensureDefault(&quot;button_cursor&quot;, SWFUpload.CURSOR.ARROW);
+	this.ensureDefault(&quot;button_window_mode&quot;, SWFUpload.WINDOW_MODE.WINDOW);
+	
 	// Debug Settings
 	this.ensureDefault(&quot;debug&quot;, false);
 	this.settings.debug_enabled = this.settings.debug;	// Here to maintain v2 API
@@ -125,12 +159,25 @@ SWFUpload.prototype.initSettings = function () {
 	// Other settings
 	this.customSettings = this.settings.custom_settings;
 	
+	// Update the flash url if needed
+	if (this.settings.prevent_swf_caching) {
+		this.settings.flash_url = this.settings.flash_url + &quot;?swfuploadrnd=&quot; + Math.floor(Math.random() * 999999999);
+	}
+	
 	delete this.ensureDefault;
 };
 
-// Private: loadFlash generates the HTML tag for the Flash
-// It then adds the flash to the body
 SWFUpload.prototype.loadFlash = function () {
+	if (this.settings.button_placeholder_id !== &quot;&quot;) {
+		this.replaceWithFlash();
+	} else {
+		this.appendFlash();
+	}
+};
+
+// Private: appendFlash gets the HTML tag for the Flash
+// It then appends the flash to the body
+SWFUpload.prototype.appendFlash = function () {
 	var targetElement, container;
 
 	// Make sure an element with the ID we are going to use doesn't already exist
@@ -149,17 +196,41 @@ SWFUpload.prototype.loadFlash = function () {
 	container = document.createElement(&quot;div&quot;);
 	container.style.width = &quot;1px&quot;;
 	container.style.height = &quot;1px&quot;;
+	container.style.overflow = &quot;hidden&quot;;
 
 	targetElement.appendChild(container);
 	container.innerHTML = this.getFlashHTML();	// Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
 };
 
+// Private: replaceWithFlash replaces the button_placeholder element with the flash movie.
+SWFUpload.prototype.replaceWithFlash = function () {
+	var targetElement, tempParent;
+
+	// Make sure an element with the ID we are going to use doesn't already exist
+	if (document.getElementById(this.movieName) !== null) {
+		throw &quot;ID &quot; + this.movieName + &quot; is already in use. The Flash Object could not be added&quot;;
+	}
+
+	// Get the element where we will be placing the flash movie
+	targetElement = document.getElementById(this.settings.button_placeholder_id);
+
+	if (targetElement == undefined) {
+		throw &quot;Could not find the placeholder element.&quot;;
+	}
+
+	// Append the container and load the flash
+	tempParent = document.createElement(&quot;div&quot;);
+	tempParent.innerHTML = this.getFlashHTML();	// Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
+	targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
+
+};
+
 // Private: getFlashHTML generates the object tag needed to embed the flash in to the document
 SWFUpload.prototype.getFlashHTML = function () {
 	// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
-	return ['&lt;object id=&quot;', this.movieName, '&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;', this.settings.flash_url, '&quot; width=&quot;1&quot; height=&quot;1&quot; style=&quot;-moz-user-focus: ignore;&quot;&gt;',
+	return ['&lt;object id=&quot;', this.movieName, '&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;', this.settings.flash_url, '&quot; width=&quot;', this.settings.button_width, '&quot; height=&quot;', this.settings.button_height, '&quot; class=&quot;swfupload&quot;&gt;',
+				'&lt;param name=&quot;wmode&quot; value=&quot;', this.settings.button_window_mode , '&quot; /&gt;',
 				'&lt;param name=&quot;movie&quot; value=&quot;', this.settings.flash_url, '&quot; /&gt;',
-				'&lt;param name=&quot;bgcolor&quot; value=&quot;', this.settings.flash_color, '&quot; /&gt;',
 				'&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;',
 				'&lt;param name=&quot;menu&quot; value=&quot;false&quot; /&gt;',
 				'&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt;',
@@ -172,12 +243,14 @@ SWFUpload.prototype.getFlashHTML = function () {
 SWFUpload.prototype.getFlashVars = function () {
 	// Build a string from the post param object
 	var paramString = this.buildParamString();
-
+	var httpSuccessString = this.settings.http_success.join(&quot;,&quot;);
+	
 	// Build the parameter string
 	return [&quot;movieName=&quot;, encodeURIComponent(this.movieName),
 			&quot;&amp;amp;uploadURL=&quot;, encodeURIComponent(this.settings.upload_url),
 			&quot;&amp;amp;useQueryString=&quot;, encodeURIComponent(this.settings.use_query_string),
 			&quot;&amp;amp;requeueOnError=&quot;, encodeURIComponent(this.settings.requeue_on_error),
+			&quot;&amp;amp;httpSuccess=&quot;, encodeURIComponent(httpSuccessString),
 			&quot;&amp;amp;params=&quot;, encodeURIComponent(paramString),
 			&quot;&amp;amp;filePostName=&quot;, encodeURIComponent(this.settings.file_post_name),
 			&quot;&amp;amp;fileTypes=&quot;, encodeURIComponent(this.settings.file_types),
@@ -185,7 +258,18 @@ SWFUpload.prototype.getFlashVars = function () {
 			&quot;&amp;amp;fileSizeLimit=&quot;, encodeURIComponent(this.settings.file_size_limit),
 			&quot;&amp;amp;fileUploadLimit=&quot;, encodeURIComponent(this.settings.file_upload_limit),
 			&quot;&amp;amp;fileQueueLimit=&quot;, encodeURIComponent(this.settings.file_queue_limit),
-			&quot;&amp;amp;debugEnabled=&quot;, encodeURIComponent(this.settings.debug_enabled)].join(&quot;&quot;);
+			&quot;&amp;amp;debugEnabled=&quot;, encodeURIComponent(this.settings.debug_enabled),
+			&quot;&amp;amp;buttonImageURL=&quot;, encodeURIComponent(this.settings.button_image_url),
+			&quot;&amp;amp;buttonWidth=&quot;, encodeURIComponent(this.settings.button_width),
+			&quot;&amp;amp;buttonHeight=&quot;, encodeURIComponent(this.settings.button_height),
+			&quot;&amp;amp;buttonText=&quot;, encodeURIComponent(this.settings.button_text),
+			&quot;&amp;amp;buttonTextTopPadding=&quot;, encodeURIComponent(this.settings.button_text_top_padding),
+			&quot;&amp;amp;buttonTextLeftPadding=&quot;, encodeURIComponent(this.settings.button_text_left_padding),
+			&quot;&amp;amp;buttonTextStyle=&quot;, encodeURIComponent(this.settings.button_text_style),
+			&quot;&amp;amp;buttonAction=&quot;, encodeURIComponent(this.settings.button_action),
+			&quot;&amp;amp;buttonDisabled=&quot;, encodeURIComponent(this.settings.button_disabled),
+			&quot;&amp;amp;buttonCursor=&quot;, encodeURIComponent(this.settings.button_cursor)
+		].join(&quot;&quot;);
 };
 
 // Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
@@ -205,7 +289,7 @@ SWFUpload.prototype.getMovieElement = function () {
 // Private: buildParamString takes the name/value pairs in the post_params setting object
 // and joins them up in to a string formatted &quot;name=value&amp;amp;name=value&quot;
 SWFUpload.prototype.buildParamString = function () {
-	var postParams = this.settings.post_params;
+	var postParams = this.settings.post_params; 
 	var paramStringPairs = [];
 
 	if (typeof(postParams) === &quot;object&quot;) {
@@ -234,11 +318,11 @@ SWFUpload.prototype.destroy = function () {
 		} catch (ex) {
 		}
 		
-		if (movieElement != undefined &amp;&amp; movieElement.parentNode != undefined &amp;&amp; typeof(movieElement.parentNode.removeChild) === &quot;function&quot;) {
+		if (movieElement != undefined &amp;&amp; movieElement.parentNode != undefined &amp;&amp; typeof movieElement.parentNode.removeChild === &quot;function&quot;) {
 			var container = movieElement.parentNode;
 			if (container != undefined) {
 				container.removeChild(movieElement);
-				if (container.parentNode != undefined &amp;&amp; typeof(container.parentNode.removeChild) === &quot;function&quot;) {
+				if (container.parentNode != undefined &amp;&amp; typeof container.parentNode.removeChild === &quot;function&quot;) {
 					container.parentNode.removeChild(container);
 				}
 			}
@@ -254,6 +338,8 @@ SWFUpload.prototype.destroy = function () {
 		delete this.eventQueue;
 		delete this.movieName;
 		
+		delete window[this.movieName];
+		
 		return true;
 	} catch (ex1) {
 		return false;
@@ -271,30 +357,45 @@ SWFUpload.prototype.displayDebugInfo = function () {
 			&quot;Version: &quot;, SWFUpload.version, &quot;\n&quot;,
 			&quot;Movie Name: &quot;, this.movieName, &quot;\n&quot;,
 			&quot;Settings:\n&quot;,
-			&quot;\t&quot;, &quot;upload_url:             &quot;, this.settings.upload_url, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;use_query_string:       &quot;, this.settings.use_query_string.toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_post_name:         &quot;, this.settings.file_post_name, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;post_params:            &quot;, this.settings.post_params.toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_types:             &quot;, this.settings.file_types, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_types_description: &quot;, this.settings.file_types_description, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_size_limit:        &quot;, this.settings.file_size_limit, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_upload_limit:      &quot;, this.settings.file_upload_limit, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_queue_limit:       &quot;, this.settings.file_queue_limit, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;flash_url:              &quot;, this.settings.flash_url, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;flash_color:            &quot;, this.settings.flash_color, &quot;\n&quot;,
-			&quot;\t&quot;, &quot;debug:                  &quot;, this.settings.debug.toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;custom_settings:        &quot;, this.settings.custom_settings.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;upload_url:               &quot;, this.settings.upload_url, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;flash_url:                &quot;, this.settings.flash_url, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;use_query_string:         &quot;, this.settings.use_query_string.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;requeue_on_error:         &quot;, this.settings.requeue_on_error.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;http_success:             &quot;, this.settings.http_success.join(&quot;, &quot;), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_post_name:           &quot;, this.settings.file_post_name, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;post_params:              &quot;, this.settings.post_params.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_types:               &quot;, this.settings.file_types, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_types_description:   &quot;, this.settings.file_types_description, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_size_limit:          &quot;, this.settings.file_size_limit, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_upload_limit:        &quot;, this.settings.file_upload_limit, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_queue_limit:         &quot;, this.settings.file_queue_limit, &quot;\n&quot;,
+			&quot;\t&quot;, &quot;debug:                    &quot;, this.settings.debug.toString(), &quot;\n&quot;,
+
+			&quot;\t&quot;, &quot;prevent_swf_caching:      &quot;, this.settings.prevent_swf_caching.toString(), &quot;\n&quot;,
+
+			&quot;\t&quot;, &quot;button_placeholder_id:    &quot;, this.settings.button_placeholder_id.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_image_url:         &quot;, this.settings.button_image_url.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_width:             &quot;, this.settings.button_width.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_height:            &quot;, this.settings.button_height.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_text:              &quot;, this.settings.button_text.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_text_style:        &quot;, this.settings.button_text_style.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_text_top_padding:  &quot;, this.settings.button_text_top_padding.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_text_left_padding: &quot;, this.settings.button_text_left_padding.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_action:            &quot;, this.settings.button_action.toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;button_disabled:          &quot;, this.settings.button_disabled.toString(), &quot;\n&quot;,
+
+			&quot;\t&quot;, &quot;custom_settings:          &quot;, this.settings.custom_settings.toString(), &quot;\n&quot;,
 			&quot;Event Handlers:\n&quot;,
-			&quot;\t&quot;, &quot;swfupload_loaded_handler assigned:  &quot;, (typeof(this.settings.swfupload_loaded_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_dialog_start_handler assigned: &quot;, (typeof(this.settings.file_dialog_start_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_queued_handler assigned:       &quot;, (typeof(this.settings.file_queued_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;file_queue_error_handler assigned:  &quot;, (typeof(this.settings.file_queue_error_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;upload_start_handler assigned:      &quot;, (typeof(this.settings.upload_start_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;upload_progress_handler assigned:   &quot;, (typeof(this.settings.upload_progress_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;upload_error_handler assigned:      &quot;, (typeof(this.settings.upload_error_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;upload_success_handler assigned:    &quot;, (typeof(this.settings.upload_success_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;upload_complete_handler assigned:   &quot;, (typeof(this.settings.upload_complete_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
-			&quot;\t&quot;, &quot;debug_handler assigned:             &quot;, (typeof(this.settings.debug_handler) === &quot;function&quot;).toString(), &quot;\n&quot;
+			&quot;\t&quot;, &quot;swfupload_loaded_handler assigned:  &quot;, (typeof this.settings.swfupload_loaded_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_dialog_start_handler assigned: &quot;, (typeof this.settings.file_dialog_start_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_queued_handler assigned:       &quot;, (typeof this.settings.file_queued_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;file_queue_error_handler assigned:  &quot;, (typeof this.settings.file_queue_error_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;upload_start_handler assigned:      &quot;, (typeof this.settings.upload_start_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;upload_progress_handler assigned:   &quot;, (typeof this.settings.upload_progress_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;upload_error_handler assigned:      &quot;, (typeof this.settings.upload_error_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;upload_success_handler assigned:    &quot;, (typeof this.settings.upload_success_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;upload_complete_handler assigned:   &quot;, (typeof this.settings.upload_complete_handler === &quot;function&quot;).toString(), &quot;\n&quot;,
+			&quot;\t&quot;, &quot;debug_handler assigned:             &quot;, (typeof this.settings.debug_handler === &quot;function&quot;).toString(), &quot;\n&quot;
 		].join(&quot;&quot;)
 	);
 };
@@ -328,36 +429,32 @@ SWFUpload.prototype.getSetting = function (name) {
 SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
 	argumentArray = argumentArray || [];
 	
-	var self = this;
-	var callFunction = function () {
-		var movieElement = self.getMovieElement();
-		var returnValue;
-		if (typeof(movieElement[functionName]) === &quot;function&quot;) {
-			// We have to go through all this if/else stuff because the Flash functions don't have apply() and only accept the exact number of arguments.
-			if (argumentArray.length === 0) {
-				returnValue = movieElement[functionName]();
-			} else if (argumentArray.length === 1) {
-				returnValue = movieElement[functionName](argumentArray[0]);
-			} else if (argumentArray.length === 2) {
-				returnValue = movieElement[functionName](argumentArray[0], argumentArray[1]);
-			} else if (argumentArray.length === 3) {
-				returnValue = movieElement[functionName](argumentArray[0], argumentArray[1], argumentArray[2]);
-			} else {
-				throw &quot;Too many arguments&quot;;
-			}
-			
-			// Unescape file post param values
-			if (returnValue != undefined &amp;&amp; typeof(returnValue.post) === &quot;object&quot;) {
-				returnValue = self.unescapeFilePostParams(returnValue);
-			}
-			
-			return returnValue;
+	var movieElement = this.getMovieElement();
+	var returnValue;
+
+	if (typeof movieElement[functionName] === &quot;function&quot;) {
+		// We have to go through all this if/else stuff because the Flash functions don't have apply() and only accept the exact number of arguments.
+		if (argumentArray.length === 0) {
+			returnValue = movieElement[functionName]();
+		} else if (argumentArray.length === 1) {
+			returnValue = movieElement[functionName](argumentArray[0]);
+		} else if (argumentArray.length === 2) {
+			returnValue = movieElement[functionName](argumentArray[0], argumentArray[1]);
+		} else if (argumentArray.length === 3) {
+			returnValue = movieElement[functionName](argumentArray[0], argumentArray[1], argumentArray[2]);
 		} else {
-			throw &quot;Invalid function name&quot;;
+			throw &quot;Too many arguments&quot;;
 		}
-	};
-	
-	return callFunction();
+		
+		// Unescape file post param values
+		if (returnValue != undefined &amp;&amp; typeof returnValue.post === &quot;object&quot;) {
+			returnValue = this.unescapeFilePostParams(returnValue);
+		}
+		
+		return returnValue;
+	} else {
+		throw &quot;Invalid function name: &quot; + functionName;
+	}
 };
 
 
@@ -368,7 +465,7 @@ SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
    ***************************** */
 
 // Public: selectFile causes a File Selection Dialog window to appear.  This
-// dialog only allows 1 file to be selected.
+// dialog only allows 1 file to be selected. WARNING: this function does not work in Flash Player 10
 SWFUpload.prototype.selectFile = function () {
 	this.callFlash(&quot;SelectFile&quot;);
 };
@@ -377,7 +474,7 @@ SWFUpload.prototype.selectFile = function () {
 // dialog allows the user to select any number of files
 // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
 // If the selection name length is too long the dialog will fail in an unpredictable manner.  There is no work-around
-// for this bug.
+// for this bug.  WARNING: this function does not work in Flash Player 10
 SWFUpload.prototype.selectFiles = function () {
 	this.callFlash(&quot;SelectFiles&quot;);
 };
@@ -389,11 +486,11 @@ SWFUpload.prototype.startUpload = function (fileID) {
 	this.callFlash(&quot;StartUpload&quot;, [fileID]);
 };
 
-/* Cancels a the file upload.  You must specify a file_id */
-// Public: cancelUpload cancels any queued file.  The fileID parameter
-// must be specified.
-SWFUpload.prototype.cancelUpload = function (fileID) {
-	this.callFlash(&quot;CancelUpload&quot;, [fileID]);
+// Public: cancelUpload cancels any queued file.  The fileID parameter may be the file ID or index.
+// If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
+// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
+SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
+	this.callFlash(&quot;CancelUpload&quot;, [fileID, triggerErrorEvent]);
 };
 
 // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
@@ -513,12 +610,79 @@ SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
 	this.callFlash(&quot;SetRequeueOnError&quot;, [requeueOnError]);
 };
 
+// Public: setHTTPSuccess changes the http_success setting
+SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
+	if (typeof http_status_codes === &quot;string&quot;) {
+		http_status_codes = http_status_codes.replace(&quot; &quot;, &quot;&quot;).split(&quot;,&quot;);
+	}
+	
+	this.settings.http_success = http_status_codes;
+	this.callFlash(&quot;SetHTTPSuccess&quot;, [http_status_codes]);
+};
+
+
 // Public: setDebugEnabled changes the debug_enabled setting
 SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
 	this.settings.debug_enabled = debugEnabled;
 	this.callFlash(&quot;SetDebugEnabled&quot;, [debugEnabled]);
 };
 
+// Public: setButtonImageURL loads a button image sprite
+SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
+	if (buttonImageURL == undefined) {
+		buttonImageURL = &quot;&quot;;
+	}
+	
+	this.settings.button_image_url = buttonImageURL;
+	this.callFlash(&quot;SetButtonImageURL&quot;, [buttonImageURL]);
+};
+
+// Public: setButtonDimensions resizes the Flash Movie and button
+SWFUpload.prototype.setButtonDimensions = function (width, height) {
+	this.settings.button_width = width;
+	this.settings.button_height = height;
+	
+	var movie = this.getMovieElement();
+	if (movie != undefined) {
+		movie.style.width = width + &quot;px&quot;;
+		movie.style.height = height + &quot;px&quot;;
+	}
+	
+	this.callFlash(&quot;SetButtonDimensions&quot;, [width, height]);
+};
+// Public: setButtonText Changes the text overlaid on the button
+SWFUpload.prototype.setButtonText = function (html) {
+	this.settings.button_text = html;
+	this.callFlash(&quot;SetButtonText&quot;, [html]);
+};
+// Public: setButtonTextPadding changes the top and left padding of the text overlay
+SWFUpload.prototype.setButtonTextPadding = function (left, top) {
+	this.settings.button_text_top_padding = top;
+	this.settings.button_text_left_padding = left;
+	this.callFlash(&quot;SetButtonTextPadding&quot;, [left, top]);
+};
+
+// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
+SWFUpload.prototype.setButtonTextStyle = function (css) {
+	this.settings.button_text_style = css;
+	this.callFlash(&quot;SetButtonTextStyle&quot;, [css]);
+};
+// Public: setButtonDisabled disables/enables the button
+SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
+	this.settings.button_disabled = isDisabled;
+	this.callFlash(&quot;SetButtonDisabled&quot;, [isDisabled]);
+};
+// Public: setButtonAction sets the action that occurs when the button is clicked
+SWFUpload.prototype.setButtonAction = function (buttonAction) {
+	this.settings.button_action = buttonAction;
+	this.callFlash(&quot;SetButtonAction&quot;, [buttonAction]);
+};
+
+// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
+SWFUpload.prototype.setButtonCursor = function (cursor) {
+	this.settings.button_cursor = cursor;
+	this.callFlash(&quot;SetButtonCursor&quot;, [cursor]);
+};
 
 /* *******************************
 	Flash Event Interfaces
@@ -543,7 +707,7 @@ SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
 	}
 	
 	var self = this;
-	if (typeof(this.settings[handlerName]) === &quot;function&quot;) {
+	if (typeof this.settings[handlerName] === &quot;function&quot;) {
 		// Queue the event
 		this.eventQueue.push(function () {
 			this.settings[handlerName].apply(this, argumentArray);
@@ -570,7 +734,7 @@ SWFUpload.prototype.executeNextEvent = function () {
 	}
 };
 
-// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterfance cannot have
+// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
 // properties that contain characters that are not valid for JavaScript identifiers. To work around this
 // the Flash Component escapes the parameter names and we must unescape again before passing them along.
 SWFUpload.prototype.unescapeFilePostParams = function (file) {
@@ -584,7 +748,7 @@ SWFUpload.prototype.unescapeFilePostParams = function (file) {
 				uk = k;
 				var match;
 				while ((match = reg.exec(uk)) !== null) {
-					uk = uk.replace(match[0], String.fromCharCode(parseInt(&quot;0x&quot;+match[1], 16)));
+					uk = uk.replace(match[0], String.fromCharCode(parseInt(&quot;0x&quot; + match[1], 16)));
 				}
 				unescapedPost[uk] = file.post[k];
 			}
@@ -599,9 +763,14 @@ SWFUpload.prototype.unescapeFilePostParams = function (file) {
 SWFUpload.prototype.flashReady = function () {
 	// Check that the movie element is loaded correctly with its ExternalInterface methods defined
 	var movieElement = this.getMovieElement();
-	if (typeof(movieElement.StartUpload) !== &quot;function&quot;) {
+	if (typeof movieElement.StartUpload !== &quot;function&quot;) {
 		throw &quot;ExternalInterface methods failed to initialize.&quot;;
 	}
+
+	// Fix IE Flash/Form bug
+	if (window[this.movieName] == undefined) {
+		window[this.movieName] = movieElement;
+	}
 	
 	this.queueEvent(&quot;swfupload_loaded_handler&quot;);
 };
@@ -639,7 +808,7 @@ SWFUpload.prototype.uploadStart = function (file) {
 
 SWFUpload.prototype.returnUploadStart = function (file) {
 	var returnValue;
-	if (typeof(this.settings.upload_start_handler) === &quot;function&quot;) {
+	if (typeof this.settings.upload_start_handler === &quot;function&quot;) {
 		file = this.unescapeFilePostParams(file);
 		returnValue = this.settings.upload_start_handler.call(this, file);
 	} else if (this.settings.upload_start_handler != undefined) {
@@ -707,7 +876,7 @@ SWFUpload.prototype.debugMessage = function (message) {
 		var exceptionMessage, exceptionValues = [];
 
 		// Check for an exception object and print it nicely
-		if (typeof(message) === &quot;object&quot; &amp;&amp; typeof(message.name) === &quot;string&quot; &amp;&amp; typeof(message.message) === &quot;string&quot;) {
+		if (typeof message === &quot;object&quot; &amp;&amp; typeof message.name === &quot;string&quot; &amp;&amp; typeof message.message === &quot;string&quot;) {
 			for (var key in message) {
 				if (message.hasOwnProperty(key)) {
 					exceptionValues.push(key + &quot;: &quot; + message[key]);</diff>
      <filename>public/javascripts/swfupload.js</filename>
    </modified>
    <modified>
      <diff>@@ -84,7 +84,7 @@
 	white-space: nowrap;
 }
 
-a.progressCancel {
+/*a.progressCancel {
 	font-size: 0;
 	display: block;
 	height: 14px;
@@ -97,4 +97,57 @@ a.progressCancel {
 
 a.progressCancel:hover {
 	background-position: 0px 0px;
+}*/
+
+div.fieldset {
+	border:  1px solid #afe14c;
+	margin: 10px 0;
+	padding: 20px 10px;
+}
+div.fieldset span.legend {
+	position: relative;
+	background-color: #FFF;
+	padding: 3px;
+	top: -30px;
+	font: 700 14px Arial, Helvetica, sans-serif;
+	color: #73b304;
+}
+
+div.flash {
+	width: 375px;
+	margin: 10px 5px;
+	border-color: #D9E4FF;
+
+	-moz-border-radius-topleft : 5px;
+	-webkit-border-top-left-radius : 5px;
+    -moz-border-radius-topright : 5px;
+    -webkit-border-top-right-radius : 5px;
+    -moz-border-radius-bottomleft : 5px;
+    -webkit-border-bottom-left-radius : 5px;
+    -moz-border-radius-bottomright : 5px;
+    -webkit-border-bottom-right-radius : 5px;
+
+}
+
+button,
+input,
+select,
+textarea { 
+	border-width: 1px; 
+	margin-bottom: 10px;
+	padding: 2px 3px;
 }
+
+
+
+input[disabled]{ border: 1px solid #ccc } /* FF 2 Fix */
+
+
+label { 
+	width: 150px; 
+	text-align: right; 
+	display:block;
+	margin-right: 5px;
+}
+
+#btnSubmit { margin: 0 0 0 155px ; }
\ No newline at end of file</diff>
      <filename>public/stylesheets/swfupload.css</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>log/development.log</filename>
    </removed>
    <removed>
      <filename>public/.DS_Store</filename>
    </removed>
    <removed>
      <filename>public/flash/swfupload_f9.swf</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>6f60bd52557f850f272c3635ed940672de5173a8</id>
    </parent>
  </parents>
  <author>
    <name>Cameron Yule</name>
    <email>cameron@cameronyule.com</email>
  </author>
  <url>http://github.com/cameronyule/swfupload-rails-authentication/commit/8e309c7e2c7ca045490e448d9cd06301ef80e0af</url>
  <id>8e309c7e2c7ca045490e448d9cd06301ef80e0af</id>
  <committed-date>2008-10-30T04:58:18-07:00</committed-date>
  <authored-date>2008-10-30T04:58:18-07:00</authored-date>
  <message>Updating to SWFUpload v2.2.0 Beta 2 and Rails 2.1.2</message>
  <tree>4337208e37364d3ac0f9bfe36739084618c478d7</tree>
  <committer>
    <name>Cameron Yule</name>
    <email>cameron@cameronyule.com</email>
  </committer>
</commit>
