<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[18484] trunk: Add SWFUpload back for plugins that queue it directly, fix some escaping in media.php, see #18206</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/18484">18484</a></dd>
<dt>Author</dt> <dd>azaozz</dd>
<dt>Date</dt> <dd>2011-07-29 19:21:21 +0000 (Fri, 29 Jul 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add SWFUpload back for plugins that queue it directly, fix some escaping in media.php, see <a href="http://core.trac.wordpress.org/ticket/18206">#18206</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincssmediadevcss">trunk/wp-admin/css/media.dev.css</a></li>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpincludesjspluploadhandlersdevjs">trunk/wp-includes/js/plupload/handlers.dev.js</a></li>
<li><a href="#trunkwpincludesjspluploadhandlersjs">trunk/wp-includes/js/plupload/handlers.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/wp-includes/js/swfupload/</li>
<li><a href="#trunkwpincludesjsswfuploadhandlersdevjs">trunk/wp-includes/js/swfupload/handlers.dev.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadhandlersjs">trunk/wp-includes/js/swfupload/handlers.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadlicensetxt">trunk/wp-includes/js/swfupload/license.txt</a></li>
<li>trunk/wp-includes/js/swfupload/plugins/</li>
<li><a href="#trunkwpincludesjsswfuploadpluginsswfuploadcookiesjs">trunk/wp-includes/js/swfupload/plugins/swfupload.cookies.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadpluginsswfuploadqueuejs">trunk/wp-includes/js/swfupload/plugins/swfupload.queue.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadpluginsswfuploadspeedjs">trunk/wp-includes/js/swfupload/plugins/swfupload.speed.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadpluginsswfuploadswfobjectjs">trunk/wp-includes/js/swfupload/plugins/swfupload.swfobject.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadswfuploadalljs">trunk/wp-includes/js/swfupload/swfupload-all.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadswfuploadjs">trunk/wp-includes/js/swfupload/swfupload.js</a></li>
<li><a href="#trunkwpincludesjsswfuploadswfuploadswf">trunk/wp-includes/js/swfupload/swfupload.swf</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincssmediadevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/media.dev.css (18483 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/media.dev.css        2011-07-29 09:03:24 UTC (rev 18483)
+++ trunk/wp-admin/css/media.dev.css        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -168,6 +168,10 @@
</span><span class="cx">         width: 623px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#media-upload #media-items:empty {
+        border: 0 none;
+}
+
</ins><span class="cx"> #media-upload .media-item {
</span><span class="cx">         border-bottom-width: 1px;
</span><span class="cx">         border-bottom-style: solid;
</span></span></pre></div>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (18483 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2011-07-29 09:03:24 UTC (rev 18483)
+++ trunk/wp-admin/includes/media.php        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -1438,13 +1438,15 @@
</span><span class="cx">         global $type, $tab, $pagenow;
</span><span class="cx"> 
</span><span class="cx">         $upload_action_url = admin_url('async-upload.php');
</span><del>-
</del><span class="cx">         $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
</span><span class="cx"> 
</span><del>-        $upload_size_unit = $max_upload_size =  wp_max_upload_size();
</del><ins>+        $upload_size_unit = $max_upload_size = wp_max_upload_size();
</ins><span class="cx">         $sizes = array( 'KB', 'MB', 'GB' );
</span><del>-        for ( $u = -1; $upload_size_unit &gt; 1024 &amp;&amp; $u &lt; count( $sizes ) - 1; $u++ )
</del><ins>+
+        for ( $u = -1; $upload_size_unit &gt; 1024 &amp;&amp; $u &lt; count( $sizes ) - 1; $u++ ) {
</ins><span class="cx">                 $upload_size_unit /= 1024;
</span><ins>+        }
+
</ins><span class="cx">         if ( $u &lt; 0 ) {
</span><span class="cx">                 $upload_size_unit = 0;
</span><span class="cx">                 $u = 0;
</span><span class="lines">@@ -1453,11 +1455,13 @@
</span><span class="cx">         }
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;/script&gt;
</span><ins>+
</ins><span class="cx"> &lt;div id=&quot;media-upload-notice&quot;&gt;
</span><span class="cx"> &lt;?php if (isset($errors['upload_notice']) ) { ?&gt;
</span><span class="cx">         &lt;?php echo $errors['upload_notice']; ?&gt;
</span><span class="cx"> &lt;?php } ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><ins>+
</ins><span class="cx"> &lt;div id=&quot;media-upload-error&quot;&gt;
</span><span class="cx"> &lt;?php if (isset($errors['upload_error']) &amp;&amp; is_wp_error($errors['upload_error'])) { ?&gt;
</span><span class="cx">         &lt;?php echo $errors['upload_error']-&gt;get_error_message(); ?&gt;
</span><span class="lines">@@ -1483,17 +1487,22 @@
</span><span class="cx">                 &quot;tab&quot; =&gt; $tab,
</span><span class="cx">                 &quot;short&quot; =&gt; &quot;1&quot;,
</span><span class="cx"> );
</span><ins>+
</ins><span class="cx"> $post_params = apply_filters( 'upload_post_params', $post_params ); // hook change! old name: 'swfupload_post_params'
</span><span class="cx"> $p = array();
</span><del>-foreach ( $post_params as $param =&gt; $val )
</del><ins>+
+foreach ( $post_params as $param =&gt; $val ) {
+        $val = esc_js( $val );
</ins><span class="cx">         $p[] = &quot;\t\t'$param' : '$val'&quot;;
</span><ins>+}
+
</ins><span class="cx"> $post_params_str = implode( &quot;, \n&quot;, $p );
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx"> //&lt;![CDATA[
</span><del>-var resize_height = &lt;?php echo get_option('large_size_h'); ?&gt;, 
-        resize_width = &lt;?php echo get_option('large_size_w'); ?&gt;;
</del><ins>+var resize_height = &lt;?php echo get_option('large_size_h', 1024); ?&gt;, 
+        resize_width = &lt;?php echo get_option('large_size_w', 1024); ?&gt;;
</ins><span class="cx"> 
</span><span class="cx"> jQuery(document).ready(function($) {
</span><span class="cx">         window.uploader = new plupload.Uploader({
</span><span class="lines">@@ -1502,12 +1511,12 @@
</span><span class="cx">                 container: 'plupload-upload-ui',
</span><span class="cx">                 drop_element: 'media-upload',
</span><span class="cx">                 file_data_name: 'async-upload',
</span><del>-                max_file_size: '&lt;?php echo $max_upload_size / 1024; ?&gt;kb',
-                url: '&lt;?php echo esc_attr( $upload_action_url ); ?&gt;',
-                flash_swf_url: '&lt;?php echo includes_url('js/plupload/plupload.flash.swf'); ?&gt;',
-                silverlight_xap_url: '&lt;?php echo includes_url('js/plupload/plupload.silverlight.xap'); ?&gt;',
</del><ins>+                max_file_size: '&lt;?php echo round( (int) $max_upload_size / 1024 ); ?&gt;kb',
+                url: '&lt;?php echo esc_js( $upload_action_url ); ?&gt;',
+                flash_swf_url: '&lt;?php echo esc_js( includes_url('js/plupload/plupload.flash.swf') ); ?&gt;',
+                silverlight_xap_url: '&lt;?php echo esc_js( includes_url('js/plupload/plupload.silverlight.xap') ); ?&gt;',
</ins><span class="cx">                 filters: [
</span><del>-                        {title: '&lt;?php _e( 'Allowed Files' ); ?&gt;', extensions: '&lt;?php echo apply_filters('upload_file_glob', '*'); ?&gt;'}
</del><ins>+                        {title: '&lt;?php echo esc_js( __( 'Allowed Files' ) ); ?&gt;', extensions: '&lt;?php echo esc_js( apply_filters('uploader_allowed_extensions', '*') ); ?&gt;'}
</ins><span class="cx">                 ],
</span><span class="cx">                 multipart: true,
</span><span class="cx">                 urlstream_upload: true,
</span><span class="lines">@@ -1588,7 +1597,7 @@
</span><span class="cx"> &lt;?php do_action('post-html-upload-ui', $plupload); ?&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;p class=&quot;media-upload-size&quot;&gt;&lt;?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?&gt;&lt;/p&gt;
</del><ins>+&lt;p class=&quot;media-upload-size&quot;&gt;&lt;?php printf( __( 'Maximum upload file size: %d%s' ), esc_html($upload_size_unit), esc_html($sizes[$u]) ); ?&gt;&lt;/p&gt;
</ins><span class="cx"> &lt;p class=&quot;howto&quot;&gt;&lt;?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?&gt;&lt;/p&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php do_action('post-upload-ui'); ?&gt;
</span><span class="lines">@@ -1633,19 +1642,19 @@
</span><span class="cx"> });
</span><span class="cx"> //]]&gt;
</span><span class="cx"> &lt;/script&gt;
</span><del>-&lt;div id=&quot;media-items&quot;&gt;
-&lt;?php
</del><ins>+&lt;div id=&quot;media-items&quot;&gt;&lt;?php
+
</ins><span class="cx"> if ( $id ) {
</span><span class="cx">         if ( !is_wp_error($id) ) {
</span><span class="cx">                 add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2);
</span><span class="cx">                 echo get_media_items( $id, $errors );
</span><span class="cx">         } else {
</span><del>-                echo '&lt;div id=&quot;media-upload-error&quot;&gt;'.esc_html($id-&gt;get_error_message()).'&lt;/div&gt;';
</del><ins>+                echo '&lt;div id=&quot;media-upload-error&quot;&gt;'.esc_html($id-&gt;get_error_message()).'&lt;/div&gt;&lt;/div&gt;';
</ins><span class="cx">                 exit;
</span><span class="cx">         }
</span><span class="cx"> }
</span><del>-?&gt;
-&lt;/div&gt;
</del><ins>+?&gt;&lt;/div&gt;
+
</ins><span class="cx"> &lt;p class=&quot;savebutton ml-submit&quot;&gt;
</span><span class="cx"> &lt;?php submit_button( __( 'Save all changes' ), 'button', 'save', false ); ?&gt;
</span><span class="cx"> &lt;/p&gt;
</span></span></pre></div>
<a id="trunkwpincludesjspluploadhandlersdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/handlers.dev.js (18483 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/handlers.dev.js        2011-07-29 09:03:24 UTC (rev 18483)
+++ trunk/wp-includes/js/plupload/handlers.dev.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -33,9 +33,9 @@
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function uploadProgress(fileObj, bytesDone, bytesTotal) {
-        // Lengthen the progress bar
</del><ins>+function uploadProgress(fileObj, bytesDone, bytesTotal) { // Lengthen the progress bar
</ins><span class="cx">         var w = jQuery('#media-items').width() - 2, item = jQuery('#media-item-' + fileObj.id);
</span><ins>+
</ins><span class="cx">         jQuery('.bar', item).width( w * bytesDone / bytesTotal );
</span><span class="cx">         jQuery('.percent', item).html( Math.ceil(bytesDone / bytesTotal * 100) + '%' );
</span><span class="cx"> 
</span><span class="lines">@@ -209,8 +209,7 @@
</span><span class="cx"> 
</span><span class="cx"> // file-specific message
</span><span class="cx"> function wpFileError(fileObj, message) {
</span><del>-        var item = jQuery('#media-item-' + fileObj.id);
-        var filename = jQuery('.filename', item).text();
</del><ins>+        var item = jQuery('#media-item-' + fileObj.id), filename = jQuery('.filename', item).text();
</ins><span class="cx"> 
</span><span class="cx">         item.html('&lt;div class=&quot;error-div&quot;&gt;'
</span><span class="cx">                                 + '&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;' + pluploadL10n.dismiss + '&lt;/a&gt;'
</span><span class="lines">@@ -221,8 +220,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function itemAjaxError(id, html) {
</span><del>-        var item = jQuery('#media-item-' + id);
-        var filename = jQuery('.filename', item).text();
</del><ins>+        var item = jQuery('#media-item-' + id), filename = jQuery('.filename', item).text();
</ins><span class="cx"> 
</span><span class="cx">         item.html('&lt;div class=&quot;error-div&quot;&gt;'
</span><span class="cx">                                 + '&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;' + pluploadL10n.dismiss + '&lt;/a&gt;'
</span><span class="lines">@@ -269,38 +267,18 @@
</span><span class="cx">         // TODO
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><ins>+// SWFUpload?
</ins><span class="cx"> function uploadComplete(fileObj) {
</span><span class="cx">         // If no more uploads queued, enable the submit button
</span><span class="cx">         if ( swfu.getStats().files_queued == 0 ) {
</span><del>-                jQuery('#cancel-upload').attr('disabled', 'disabled');
-                jQuery('#insert-gallery').attr('disabled', '');
</del><ins>+                jQuery('#cancel-upload').prop('disabled', true);
+                jQuery('#insert-gallery').prop('disabled', false);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
-// wp-specific error handlers
-
-// generic message
-function wpQueueError(message) {
-        jQuery('#media-upload-error').show().text(message);
-}
-
-// file-specific message
-function wpFileError(fileObj, message) {
-        var item = jQuery('#media-item-' + fileObj.id);
-        var filename = jQuery('.filename', item).text();
-
-        item.html('&lt;div class=&quot;error-div&quot;&gt;'
-                                + '&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;' + pluploadL10n.dismiss + '&lt;/a&gt;'
-                                + '&lt;strong&gt;' + pluploadL10n.error_uploading.replace('%s', filename) + '&lt;/strong&gt;&lt;br /&gt;'
-                                + message
-                                + '&lt;/div&gt;');
-        item.find('a.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})});
-}
-
</del><span class="cx"> function switchUploader(s) {
</span><span class="cx">         var p = document.getElementById('flash-upload-ui'), h = document.getElementById('html-upload-ui');
</span><ins>+
</ins><span class="cx">         if ( s ) {
</span><span class="cx">                 p.style.display = 'block';
</span><span class="cx">                 h.style.display = 'none';
</span><span class="lines">@@ -312,6 +290,7 @@
</span><span class="cx"> 
</span><span class="cx"> function dndHelper(s) {
</span><span class="cx">         var d = document.getElementById('dnd-helper');
</span><ins>+
</ins><span class="cx">         if ( s ) {
</span><span class="cx">                 d.style.display = 'block';
</span><span class="cx">         } else {
</span><span class="lines">@@ -319,6 +298,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// SWFUpload?
</ins><span class="cx"> function swfuploadPreLoad() {
</span><span class="cx">         if ( !uploaderMode ) {
</span><span class="cx">                 switchUploader(1);
</span><span class="lines">@@ -327,6 +307,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// SWFUpload?
</ins><span class="cx"> function swfuploadLoadFailed() {
</span><span class="cx">         switchUploader(0);
</span><span class="cx">         jQuery('.upload-html-bypass').hide();
</span></span></pre></div>
<a id="trunkwpincludesjspluploadhandlersjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/handlers.js (18483 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/handlers.js        2011-07-29 09:03:24 UTC (rev 18483)
+++ trunk/wp-includes/js/plupload/handlers.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -1,22 +1 @@
</span><del>-var topWin=window.dialogArguments||opener||parent||top;function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}
-function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0&amp;&amp;(jQuery(&quot;.describe-toggle-on&quot;).show(),jQuery(&quot;.describe-toggle-off&quot;).hide(),jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;));jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+
-a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,&quot;#media-item-&quot;+a.id).show();jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;);jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;&quot;)}function uploadStart(){try{typeof topWin.tb_remove!=&quot;undefined&quot;&amp;&amp;topWin.jQuery(&quot;#TB_overlay&quot;).unbind(&quot;click&quot;,topWin.tb_remove)}catch(a){}return!0}
-function uploadProgress(a,b,c){var d=jQuery(&quot;#media-items&quot;).width()-2,a=jQuery(&quot;#media-item-&quot;+a.id);jQuery(&quot;.bar&quot;,a).width(d*b/c);jQuery(&quot;.percent&quot;,a).html(Math.ceil(b/c*100)+&quot;%&quot;);b==c&amp;&amp;jQuery(&quot;.bar&quot;,a).html('&lt;strong class=&quot;crunching&quot;&gt;'+pluploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}
-function updateMediaForm(){var a=jQuery(&quot;form.type-form #media-items&quot;).children(),b=jQuery(&quot;#media-items&quot;).children();a.length==1&amp;&amp;jQuery(&quot;.slidetoggle&quot;,a).slideDown(500).siblings().addClass(&quot;hidden&quot;).filter(&quot;.toggle&quot;).toggle();b.not(&quot;.media-blank&quot;).length&gt;0?jQuery(&quot;.savebutton&quot;).show():jQuery(&quot;.savebutton&quot;).hide();b.length&gt;1?jQuery(&quot;.insert-gallery&quot;).show():jQuery(&quot;.insert-gallery&quot;).hide()}
-function uploadSuccess(a,b){b.match(&quot;media-upload-error&quot;)?jQuery(&quot;#media-item-&quot;+a.id).html(b):(prepareMediaItem(a,b),updateMediaForm(),jQuery(&quot;#media-item-&quot;+a.id).hasClass(&quot;child-of-&quot;+post_id)&amp;&amp;jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1))}
-function setResize(a){jQuery(&quot;#image_resize&quot;).prop(&quot;checked&quot;,a);a?(uploader.settings.resize={width:resize_width,height:resize_height,quality:100},uploader.settings.multipart_params.image_resize=!0):(uploader.settings.resize={},uploader.settings.multipart_params.image_resize=null)}
-function prepareMediaItem(a,b){var c=typeof shortform==&quot;undefined&quot;?1:2,d=jQuery(&quot;#media-item-&quot;+a.id);jQuery(&quot;.bar&quot;,d).remove();jQuery(&quot;.progress&quot;,d).hide();try{typeof topWin.tb_remove!=&quot;undefined&quot;&amp;&amp;topWin.jQuery(&quot;#TB_overlay&quot;).click(topWin.tb_remove)}catch(e){}isNaN(b)||!b?(d.append(b),prepareMediaItemInit(a)):d.load(&quot;async-upload.php&quot;,{attachment_id:b,fetch:c},function(){prepareMediaItemInit(a);updateMediaForm()})}
-function prepareMediaItemInit(a){var b=jQuery(&quot;#media-item-&quot;+a.id);jQuery(&quot;.thumbnail&quot;,b).clone().attr(&quot;class&quot;,&quot;pinkynail toggle&quot;).prependTo(b);jQuery(&quot;.filename.original&quot;,b).replaceWith(jQuery(&quot;.filename.new&quot;,b));jQuery(&quot;a.toggle&quot;,b).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(350,function(){var a=jQuery(window).height(),b=jQuery(this).offset().top,e=jQuery(this).height(),f;a&amp;&amp;b&amp;&amp;e&amp;&amp;(f=b+e,f&gt;a&amp;&amp;e+48&lt;a?window.scrollBy(0,f-a+13):f&gt;a&amp;&amp;window.scrollTo(0,b-36))});jQuery(this).siblings(&quot;.toggle&quot;).andSelf().toggle();
-jQuery(this).siblings(&quot;a.toggle&quot;).focus();return!1});jQuery(&quot;a.delete&quot;,b).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:a.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;trash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)}});return!1});jQuery(&quot;a.undo&quot;,b).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,id:a.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;untrash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,
-&quot;&quot;)},success:function(){var b=jQuery(&quot;#media-item-&quot;+a.id);(type=jQuery(&quot;#type-of-&quot;+a.id).val())&amp;&amp;jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-0+1);b.hasClass(&quot;child-of-&quot;+post_id)&amp;&amp;jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-0+1);jQuery(&quot;.filename .trashnotice&quot;,b).remove();jQuery(&quot;.filename .title&quot;,b).css(&quot;font-weight&quot;,&quot;normal&quot;);jQuery(&quot;a.undo&quot;,b).addClass(&quot;hidden&quot;);jQuery(&quot;a.describe-toggle-on, .menu_order_input&quot;,b).show();b.css({backgroundColor:&quot;#ceb&quot;}).animate({backgroundColor:&quot;#fff&quot;},
-{queue:!1,duration:500,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}}).removeClass(&quot;undo&quot;)}});return!1});jQuery(&quot;#media-item-&quot;+a.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).siblings(&quot;.toggle&quot;).toggle()}function cancelUpload(){uploader.stop();jQuery.each(uploader.files,function(a,b){b.status==plupload.STOPPED&amp;&amp;jQuery(&quot;#media-item-&quot;+b.id).remove()})}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}
-function wpFileError(a,b){var c=jQuery(&quot;#media-item-&quot;+a.id),d=jQuery(&quot;.filename&quot;,c).text();c.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,d)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);c.find(&quot;a.dismiss&quot;).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}
-function itemAjaxError(a,b){var c=jQuery(&quot;#media-item-&quot;+a),d=jQuery(&quot;.filename&quot;,c).text();c.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,d)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);c.find(&quot;a.dismiss&quot;).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}
-function deleteSuccess(a){if(a==&quot;-1&quot;)return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;);if(a==&quot;0&quot;)return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;);var a=this.id,b=jQuery(&quot;#media-item-&quot;+a);(type=jQuery(&quot;#type-of-&quot;+a).val())&amp;&amp;jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1);b.hasClass(&quot;child-of-&quot;+post_id)&amp;&amp;jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1);jQuery(&quot;form.type-form #media-items&quot;).children().length==
-1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0&amp;&amp;(jQuery(&quot;.toggle&quot;).toggle(),jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;));jQuery(&quot;.toggle&quot;,b).toggle();jQuery(&quot;.slidetoggle&quot;,b).slideUp(200).siblings().removeClass(&quot;hidden&quot;);b.css({backgroundColor:&quot;#faa&quot;}).animate({backgroundColor:&quot;#f4f4f4&quot;},{queue:!1,duration:500}).addClass(&quot;undo&quot;);jQuery(&quot;.filename:empty&quot;,b).remove();jQuery(&quot;.filename .title&quot;,b).css(&quot;font-weight&quot;,&quot;bold&quot;);jQuery(&quot;.filename&quot;,b).append('&lt;span class=&quot;trashnotice&quot;&gt; '+
-pluploadL10n.deleted+&quot; &lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).hide();jQuery(&quot;.filename&quot;,b).append(jQuery(&quot;a.undo&quot;,b).removeClass(&quot;hidden&quot;));jQuery(&quot;.menu_order_input&quot;,b).hide()}function deleteError(){}function uploadComplete(){swfu.getStats().files_queued==0&amp;&amp;(jQuery(&quot;#cancel-upload&quot;).attr(&quot;disabled&quot;,&quot;disabled&quot;),jQuery(&quot;#insert-gallery&quot;).attr(&quot;disabled&quot;,&quot;&quot;))}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}
-function wpFileError(a,b){var c=jQuery(&quot;#media-item-&quot;+a.id),d=jQuery(&quot;.filename&quot;,c).text();c.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,d)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);c.find(&quot;a.dismiss&quot;).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}
-function switchUploader(a){var b=document.getElementById(&quot;flash-upload-ui&quot;),c=document.getElementById(&quot;html-upload-ui&quot;);a?(b.style.display=&quot;block&quot;,c.style.display=&quot;none&quot;):(b.style.display=&quot;none&quot;,c.style.display=&quot;block&quot;)}function dndHelper(a){document.getElementById(&quot;dnd-helper&quot;).style.display=a?&quot;block&quot;:&quot;none&quot;}function swfuploadPreLoad(){uploaderMode?switchUploader(0):switchUploader(1)}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}
-function uploadError(a,b){switch(b){case plupload.FAILED:wpFileError(a,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileError(a,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:wpFileError(a,pluploadL10n.upload_limit_exceeded);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(a,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(a,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(a,pluploadL10n.image_dimensions_exceeded);
-break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:wpQueueError(pluploadL10n.io_error);break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide();break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(a,pluploadL10n.default_error)}}
-jQuery(document).ready(function(a){a('input[type=&quot;radio&quot;]',&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=a(this).closest(&quot;tr&quot;);a(b).hasClass(&quot;align&quot;)?setUserSetting(&quot;align&quot;,a(this).val()):a(b).hasClass(&quot;image-size&quot;)&amp;&amp;setUserSetting(&quot;imgsize&quot;,a(this).val())});a(&quot;button.button&quot;,&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=this.className||&quot;&quot;;if((b=b.match(/url([^ '&quot;]+)/))&amp;&amp;b[1])setUserSetting(&quot;urlbutton&quot;,b[1]),a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))})});
</del><ins>+var topWin=window.dialogArguments||opener||parent||top;function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();if(jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0){jQuery(&quot;.describe-toggle-on&quot;).show();jQuery(&quot;.describe-toggle-off&quot;).hide();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,&quot;#media-item-&quot;+a.id).show();jQuery(
 &quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,true);jQuery(&quot;#cancel-upload&quot;).prop(&quot;disabled&quot;,false)}function uploadStart(a){try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&quot;#TB_overlay&quot;).unbind(&quot;click&quot;,topWin.tb_remove)}}catch(b){}return true}function uploadProgress(e,b,d){var a=jQuery(&quot;#media-items&quot;).width()-2,c=jQuery(&quot;#media-item-&quot;+e.id);jQuery(&quot;.bar&quot;,c).width(a*b/d);jQuery(&quot;.percent&quot;,c).html(Math.ceil(b/d*100)+&quot;%&quot;);if(b==d){jQuery(&quot;.bar&quot;,c).html('&lt;strong class=&quot;crunching&quot;&gt;'+pluploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}}function updateMediaForm(){var b=jQuery(&quot;form.type-form #media-items&quot;).children(),a=jQuery(&quot;#media-items&quot;).children();if(b.length==1){jQuery(&quot;.slidetoggle&quot;,b).slideDown(500).siblings().addClass(&quot;hidden&quot;).filter(&quot;.toggle&quot;).toggle()}if(a.not(&quot;.media-blan
 k&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}if(a.length&gt;1){jQuery(&quot;.insert-gallery&quot;).show()}else{jQuery(&quot;.insert-gallery&quot;).hide()}}function uploadSuccess(b,a){if(a.match(&quot;media-upload-error&quot;)){jQuery(&quot;#media-item-&quot;+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery(&quot;#media-item-&quot;+b.id).hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1)}}function setResize(a){jQuery(&quot;#image_resize&quot;).prop(&quot;checked&quot;,a);if(a){uploader.settings.resize={width:resize_width,height:resize_height,quality:100};uploader.settings.multipart_params.image_resize=true}else{uploader.settings.resize={};uploader.settings.multipart_params.image_resize=null}}function prepareMediaItem(c,a){var d=(typeof shortform==&quot;undefined&quot;)?1:2,b=jQuery(&quot;#media-item-&quot;+c.id)
 ;jQuery(&quot;.bar&quot;,b).remove();jQuery(&quot;.progress&quot;,b).hide();try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&quot;#TB_overlay&quot;).click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load(&quot;async-upload.php&quot;,{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery(&quot;#media-item-&quot;+b.id);jQuery(&quot;.thumbnail&quot;,a).clone().attr(&quot;class&quot;,&quot;pinkynail toggle&quot;).prependTo(a);jQuery(&quot;.filename.original&quot;,a).replaceWith(jQuery(&quot;.filename.new&quot;,a));jQuery(&quot;a.toggle&quot;,a).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(350,function(){var d=jQuery(window).height(),e=jQuery(this).offset().top,f=jQuery(this).height(),c;if(d&amp;&amp;e&amp;&amp;f){c=e+f;if(c&gt;d&amp;&amp;(f+48)&lt;d){window.scrollBy(0,c-d+13)}else{if(c&gt;d){window.scrollTo(0,e
 -36)}}}});jQuery(this).siblings(&quot;.toggle&quot;).andSelf().toggle();jQuery(this).siblings(&quot;a.toggle&quot;).focus();return false});jQuery(&quot;a.delete&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;trash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)}});return false});jQuery(&quot;a.undo&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;untrash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)},success:function(d,e){var c=jQuery(&quot;#media-item-&quot;+b.id);if(type=jQuery(&quot;#type-of-&quot;+b.id).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-0+1)}if(c.hasClass(&quot;child-of-&quot;+post_id)
 ){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-0+1)}jQuery(&quot;.filename .trashnotice&quot;,c).remove();jQuery(&quot;.filename .title&quot;,c).css(&quot;font-weight&quot;,&quot;normal&quot;);jQuery(&quot;a.undo&quot;,c).addClass(&quot;hidden&quot;);jQuery(&quot;a.describe-toggle-on, .menu_order_input&quot;,c).show();c.css({backgroundColor:&quot;#ceb&quot;}).animate({backgroundColor:&quot;#fff&quot;},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}}).removeClass(&quot;undo&quot;)}});return false});jQuery(&quot;#media-item-&quot;+b.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).siblings(&quot;.toggle&quot;).toggle()}function cancelUpload(){uploader.stop();jQuery.each(uploader.files,function(b,a){if(a.status==plupload.STOPPED){jQuery(&quot;#media-item-&quot;+a.id).remove()}})}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)
 }function wpFileError(d,c){var b=jQuery(&quot;#media-item-&quot;+d.id),a=jQuery(&quot;.filename&quot;,b).text();b.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,a)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+c+&quot;&lt;/div&gt;&quot;);b.find(&quot;a.dismiss&quot;).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function itemAjaxError(d,b){var c=jQuery(&quot;#media-item-&quot;+d),a=jQuery(&quot;.filename&quot;,c).text();c.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+pluploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+pluploadL10n.error_uploading.replace(&quot;%s&quot;,a)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);c.find(&quot;a.dismiss&quot;).click(function(){jQuery(thi
 s).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function deleteSuccess(b,d){if(b==&quot;-1&quot;){return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;)}if(b==&quot;0&quot;){return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;)}var c=this.id,a=jQuery(&quot;#media-item-&quot;+c);if(type=jQuery(&quot;#type-of-&quot;+c).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1)}if(a.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1)}if(jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0){jQuery(&quot;.toggle&quot;).toggle();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;.toggle&qu
 ot;,a).toggle();jQuery(&quot;.slidetoggle&quot;,a).slideUp(200).siblings().removeClass(&quot;hidden&quot;);a.css({backgroundColor:&quot;#faa&quot;}).animate({backgroundColor:&quot;#f4f4f4&quot;},{queue:false,duration:500}).addClass(&quot;undo&quot;);jQuery(&quot;.filename:empty&quot;,a).remove();jQuery(&quot;.filename .title&quot;,a).css(&quot;font-weight&quot;,&quot;bold&quot;);jQuery(&quot;.filename&quot;,a).append('&lt;span class=&quot;trashnotice&quot;&gt; '+pluploadL10n.deleted+&quot; &lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).hide();jQuery(&quot;.filename&quot;,a).append(jQuery(&quot;a.undo&quot;,a).removeClass(&quot;hidden&quot;));jQuery(&quot;.menu_order_input&quot;,a).hide();return}function deleteError(c,b,a){}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery(&quot;#cancel-upload&quot;).prop(&quot;disabled&quot;,true);jQuery(&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,false)}}function switchUploader(b){var c=document.getElemen
 tById(&quot;flash-upload-ui&quot;),a=document.getElementById(&quot;html-upload-ui&quot;);if(b){c.style.display=&quot;block&quot;;a.style.display=&quot;none&quot;}else{c.style.display=&quot;none&quot;;a.style.display=&quot;block&quot;}}function dndHelper(a){var b=document.getElementById(&quot;dnd-helper&quot;);if(a){b.style.display=&quot;block&quot;}else{b.style.display=&quot;none&quot;}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}function uploadError(b,c,a){switch(c){case plupload.FAILED:wpFileError(b,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileError(b,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:wpFileError(b,pluploadL10n.upload_limit_exceeded);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(b,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(b,pluploadL
 10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(b,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:wpQueueError(pluploadL10n.io_error);break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide();break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(b,pluploadL10n.default_error)}}jQuery(document).ready(function(a){a('input[type=&quot;radio&quot;]',&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=a(this).closest(&quot;tr&quot;);if(a(b).hasClass(&quot;align&quot;)){setUserSetting(&quot;align&quot;,a(this).val())}else{if(a(b).hasClass(&quot;image-size&quot;)){setUserSetting(&quot;imgsize&quot;,a(this).val())}}});a(&quot;button.button&quot;,&quot;#media-items&quot;).live(&quot;click&qu
 ot;,function(){var b=this.className||&quot;&quot;;b=b.match(/url([^ '&quot;]+)/);if(b&amp;&amp;b[1]){setUserSetting(&quot;urlbutton&quot;,b[1]);a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))}})});
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsswfupload"></a>
<div class="propset"><h4>Property changes: trunk/wp-includes/js/swfupload</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="bugtraqnumber"></a>
<div class="addfile"><h4>Added: bugtraq:number</h4></div>
<a id="trunkwpincludesjsswfuploadhandlersdevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/handlers.dev.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/handlers.dev.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/handlers.dev.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,370 @@
</span><ins>+var topWin = window.dialogArguments || opener || parent || top;
+
+function fileDialogStart() {
+        jQuery(&quot;#media-upload-error&quot;).empty();
+}
+
+// progress and success handlers for media multi uploads
+function fileQueued(fileObj) {
+        // Get rid of unused form
+        jQuery('.media-blank').remove();
+        // Collapse a single item
+        if ( jQuery('form.type-form #media-items').children().length == 1 &amp;&amp; jQuery('.hidden', '#media-items').length &gt; 0 ) {
+                jQuery('.describe-toggle-on').show();
+                jQuery('.describe-toggle-off').hide();
+                jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
+        }
+        // Create a progress bar containing the filename
+        jQuery('#media-items').append('&lt;div id=&quot;media-item-' + fileObj.id + '&quot; class=&quot;media-item child-of-' + post_id + '&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; ' + fileObj.name + '&lt;/div&gt;&lt;/div&gt;');
+        // Display the progress div
+        jQuery('.progress', '#media-item-' + fileObj.id).show();
+
+        // Disable submit and enable cancel
+        jQuery('#insert-gallery').prop('disabled', true);
+        jQuery('#cancel-upload').prop('disabled', false);
+}
+
+function uploadStart(fileObj) {
+        try {
+                if ( typeof topWin.tb_remove != 'undefined' )
+                        topWin.jQuery('#TB_overlay').unbind('click', topWin.tb_remove); 
+        } catch(e){}
+
+        return true;
+}
+
+function uploadProgress(fileObj, bytesDone, bytesTotal) {
+        // Lengthen the progress bar
+        var w = jQuery('#media-items').width() - 2, item = jQuery('#media-item-' + fileObj.id);
+        jQuery('.bar', item).width( w * bytesDone / bytesTotal );
+        jQuery('.percent', item).html( Math.ceil(bytesDone / bytesTotal * 100) + '%' );
+
+        if ( bytesDone == bytesTotal )
+                jQuery('.bar', item).html('&lt;strong class=&quot;crunching&quot;&gt;' + swfuploadL10n.crunching + '&lt;/strong&gt;');
+}
+
+function prepareMediaItem(fileObj, serverData) {
+        var f = ( typeof shortform == 'undefined' ) ? 1 : 2, item = jQuery('#media-item-' + fileObj.id);
+        // Move the progress bar to 100%
+        jQuery('.bar', item).remove();
+        jQuery('.progress', item).hide();
+
+        try {
+                if ( typeof topWin.tb_remove != 'undefined' )
+                        topWin.jQuery('#TB_overlay').click(topWin.tb_remove);
+        } catch(e){}
+
+        // Old style: Append the HTML returned by the server -- thumbnail and form inputs
+        if ( isNaN(serverData) || !serverData ) {
+                item.append(serverData);
+                prepareMediaItemInit(fileObj);
+        }
+        // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server
+        else {
+                item.load('async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit(fileObj);updateMediaForm()});
+        }
+}
+
+function prepareMediaItemInit(fileObj) {
+        var item = jQuery('#media-item-' + fileObj.id);
+        // Clone the thumbnail as a &quot;pinkynail&quot; -- a tiny image to the left of the filename
+        jQuery('.thumbnail', item).clone().attr('class', 'pinkynail toggle').prependTo(item);
+
+        // Replace the original filename with the new (unique) one assigned during upload
+        jQuery('.filename.original', item).replaceWith( jQuery('.filename.new', item) );
+
+        // Also bind toggle to the links
+        jQuery('a.toggle', item).click(function(){
+                jQuery(this).siblings('.slidetoggle').slideToggle(350, function(){
+                        var w = jQuery(window).height(), t = jQuery(this).offset().top, h = jQuery(this).height(), b;
+
+                        if ( w &amp;&amp; t &amp;&amp; h ) {
+                b = t + h;
+
+                if ( b &gt; w &amp;&amp; (h + 48) &lt; w )
+                    window.scrollBy(0, b - w + 13);
+                else if ( b &gt; w )
+                    window.scrollTo(0, t - 36);
+            }
+                });
+                jQuery(this).siblings('.toggle').andSelf().toggle();
+                jQuery(this).siblings('a.toggle').focus();
+                return false;
+        });
+
+        // Bind AJAX to the new Delete button
+        jQuery('a.delete', item).click(function(){
+                // Tell the server to delete it. TODO: handle exceptions
+                jQuery.ajax({
+                        url: 'admin-ajax.php',
+                        type: 'post',
+                        success: deleteSuccess,
+                        error: deleteError,
+                        id: fileObj.id,
+                        data: {
+                                id : this.id.replace(/[^0-9]/g, ''),
+                                action : 'trash-post',
+                                _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')
+                        }
+                });
+                return false;
+        });
+
+        // Bind AJAX to the new Undo button
+        jQuery('a.undo', item).click(function(){
+                // Tell the server to untrash it. TODO: handle exceptions
+                jQuery.ajax({
+                        url: 'admin-ajax.php',
+                        type: 'post',
+                        id: fileObj.id,
+                        data: {
+                                id : this.id.replace(/[^0-9]/g,''),
+                                action: 'untrash-post',
+                                _ajax_nonce: this.href.replace(/^.*wpnonce=/,'')
+                        },
+                        success: function(data, textStatus){
+                                var item = jQuery('#media-item-' + fileObj.id);
+
+                                if ( type = jQuery('#type-of-' + fileObj.id).val() )
+                                        jQuery('#' + type + '-counter').text(jQuery('#' + type + '-counter').text()-0+1);
+                                if ( item.hasClass('child-of-'+post_id) )
+                                        jQuery('#attachments-count').text(jQuery('#attachments-count').text()-0+1);
+
+                                jQuery('.filename .trashnotice', item).remove();
+                                jQuery('.filename .title', item).css('font-weight','normal');
+                                jQuery('a.undo', item).addClass('hidden');
+                                jQuery('a.describe-toggle-on, .menu_order_input', item).show();
+                                item.css( {backgroundColor:'#ceb'} ).animate( {backgroundColor: '#fff'}, { queue: false, duration: 500, complete: function(){ jQuery(this).css({backgroundColor:''}); } }).removeClass('undo');
+                        }
+                });
+                return false;
+        });
+
+        // Open this item if it says to start open (e.g. to display an error)
+        jQuery('#media-item-' + fileObj.id + '.startopen').removeClass('startopen').slideToggle(500).siblings('.toggle').toggle();
+}
+
+function itemAjaxError(id, html) {
+        var item = jQuery('#media-item-' + id);
+        var filename = jQuery('.filename', item).text();
+
+        item.html('&lt;div class=&quot;error-div&quot;&gt;'
+                                + '&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;' + swfuploadL10n.dismiss + '&lt;/a&gt;'
+                                + '&lt;strong&gt;' + swfuploadL10n.error_uploading.replace('%s', filename) + '&lt;/strong&gt;&lt;br /&gt;'
+                                + html
+                                + '&lt;/div&gt;');
+        item.find('a.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})});
+}
+
+function deleteSuccess(data, textStatus) {
+        if ( data == '-1' )
+                return itemAjaxError(this.id, 'You do not have permission. Has your session expired?');
+        if ( data == '0' )
+                return itemAjaxError(this.id, 'Could not be deleted. Has it been deleted already?');
+
+        var id = this.id, item = jQuery('#media-item-' + id);
+
+        // Decrement the counters.
+        if ( type = jQuery('#type-of-' + id).val() )
+                jQuery('#' + type + '-counter').text( jQuery('#' + type + '-counter').text() - 1 );
+        if ( item.hasClass('child-of-'+post_id) )
+                jQuery('#attachments-count').text( jQuery('#attachments-count').text() - 1 );
+
+        if ( jQuery('form.type-form #media-items').children().length == 1 &amp;&amp; jQuery('.hidden', '#media-items').length &gt; 0 ) {
+                jQuery('.toggle').toggle();
+                jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');
+        }
+
+        // Vanish it.
+        jQuery('.toggle', item).toggle();
+        jQuery('.slidetoggle', item).slideUp(200).siblings().removeClass('hidden');
+        item.css( {backgroundColor:'#faa'} ).animate( {backgroundColor:'#f4f4f4'}, {queue:false, duration:500} ).addClass('undo');
+
+        jQuery('.filename:empty', item).remove();
+        jQuery('.filename .title', item).css('font-weight','bold');
+        jQuery('.filename', item).append('&lt;span class=&quot;trashnotice&quot;&gt; ' + swfuploadL10n.deleted + ' &lt;/span&gt;').siblings('a.toggle').hide();
+        jQuery('.filename', item).append( jQuery('a.undo', item).removeClass('hidden') );
+        jQuery('.menu_order_input', item).hide();
+
+        return;
+}
+
+function deleteError(X, textStatus, errorThrown) {
+        // TODO
+}
+
+function updateMediaForm() {
+        var one = jQuery('form.type-form #media-items').children(), items = jQuery('#media-items').children();
+
+        // Just one file, no need for collapsible part
+        if ( one.length == 1 ) {
+                jQuery('.slidetoggle', one).slideDown(500).siblings().addClass('hidden').filter('.toggle').toggle();
+        }
+
+        // Only show Save buttons when there is at least one file.
+        if ( items.not('.media-blank').length &gt; 0 )
+                jQuery('.savebutton').show();
+        else
+                jQuery('.savebutton').hide();
+
+        // Only show Gallery button when there are at least two files.
+        if ( items.length &gt; 1 )
+                jQuery('.insert-gallery').show();
+        else
+                jQuery('.insert-gallery').hide();
+}
+
+function uploadSuccess(fileObj, serverData) {
+        // if async-upload returned an error message, place it in the media item div and return
+        if ( serverData.match('media-upload-error') ) {
+                jQuery('#media-item-' + fileObj.id).html(serverData);
+                return;
+        }
+
+        prepareMediaItem(fileObj, serverData);
+        updateMediaForm();
+
+        // Increment the counter.
+        if ( jQuery('#media-item-' + fileObj.id).hasClass('child-of-' + post_id) )
+                jQuery('#attachments-count').text(1 * jQuery('#attachments-count').text() + 1);
+}
+
+function uploadComplete(fileObj) {
+        // If no more uploads queued, enable the submit button
+        if ( swfu.getStats().files_queued == 0 ) {
+                jQuery('#cancel-upload').prop('disabled', true);
+                jQuery('#insert-gallery').prop('disabled', false);
+        }
+}
+
+
+// wp-specific error handlers
+
+// generic message
+function wpQueueError(message) {
+        jQuery('#media-upload-error').show().text(message);
+}
+
+// file-specific message
+function wpFileError(fileObj, message) {
+        var item = jQuery('#media-item-' + fileObj.id);
+        var filename = jQuery('.filename', item).text();
+
+        item.html('&lt;div class=&quot;error-div&quot;&gt;'
+                                + '&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;' + swfuploadL10n.dismiss + '&lt;/a&gt;'
+                                + '&lt;strong&gt;' + swfuploadL10n.error_uploading.replace('%s', filename) + '&lt;/strong&gt;&lt;br /&gt;'
+                                + message
+                                + '&lt;/div&gt;');
+        item.find('a.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})});
+}
+
+function fileQueueError(fileObj, error_code, message)  {
+        // Handle this error separately because we don't want to create a FileProgress element for it.
+        if ( error_code == SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED ) {
+                wpQueueError(swfuploadL10n.queue_limit_exceeded);
+        }
+        else if ( error_code == SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT ) {
+                fileQueued(fileObj);
+                wpFileError(fileObj, swfuploadL10n.file_exceeds_size_limit);
+        }
+        else if ( error_code == SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE ) {
+                fileQueued(fileObj);
+                wpFileError(fileObj, swfuploadL10n.zero_byte_file);
+        }
+        else if ( error_code == SWFUpload.QUEUE_ERROR.INVALID_FILETYPE ) {
+                fileQueued(fileObj);
+                wpFileError(fileObj, swfuploadL10n.invalid_filetype);
+        }
+        else {
+                wpQueueError(swfuploadL10n.default_error);
+        }
+}
+
+function fileDialogComplete(num_files_queued) {
+        try {
+                if (num_files_queued &gt; 0) {
+                        this.startUpload();
+                }
+        } catch (ex) {
+                this.debug(ex);
+        }
+}
+
+function switchUploader(s) {
+        var f = document.getElementById(swfu.customSettings.swfupload_element_id), h = document.getElementById(swfu.customSettings.degraded_element_id);
+        if ( s ) {
+                f.style.display = 'block';
+                h.style.display = 'none';
+        } else {
+                f.style.display = 'none';
+                h.style.display = 'block';
+        }
+}
+
+function swfuploadPreLoad() {
+        if ( !uploaderMode ) {
+                switchUploader(1);
+        } else {
+                switchUploader(0);
+        }
+}
+
+function swfuploadLoadFailed() {
+        switchUploader(0);
+        jQuery('.upload-html-bypass').hide();
+}
+
+function uploadError(fileObj, errorCode, message) {
+
+        switch (errorCode) {
+                case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:
+                        wpFileError(fileObj, swfuploadL10n.missing_upload_url);
+                        break;
+                case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
+                        wpFileError(fileObj, swfuploadL10n.upload_limit_exceeded);
+                        break;
+                case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
+                        wpQueueError(swfuploadL10n.http_error);
+                        break;
+                case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
+                        wpQueueError(swfuploadL10n.upload_failed);
+                        break;
+                case SWFUpload.UPLOAD_ERROR.IO_ERROR:
+                        wpQueueError(swfuploadL10n.io_error);
+                        break;
+                case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
+                        wpQueueError(swfuploadL10n.security_error);
+                        break;
+                case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
+                case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
+                        jQuery('#media-item-' + fileObj.id).remove();
+                        break;
+                default:
+                        wpFileError(fileObj, swfuploadL10n.default_error);
+        }
+}
+
+function cancelUpload() {
+        swfu.cancelQueue();
+}
+
+// remember the last used image size, alignment and url
+jQuery(document).ready(function($){
+        $('input[type=&quot;radio&quot;]', '#media-items').live('click', function(){
+                var tr = $(this).closest('tr');
+
+                if ( $(tr).hasClass('align') )
+                        setUserSetting('align', $(this).val());
+                else if ( $(tr).hasClass('image-size') )
+                        setUserSetting('imgsize', $(this).val());
+        });
+
+        $('button.button', '#media-items').live('click', function(){
+                var c = this.className || '';
+                c = c.match(/url([^ '&quot;]+)/);
+                if ( c &amp;&amp; c[1] ) {
+                        setUserSetting('urlbutton', c[1]);
+                        $(this).siblings('.urlfield').val( $(this).attr('title') );
+                }
+        });
+});
</ins><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/handlers.dev.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadhandlersjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/handlers.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/handlers.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/handlers.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+var topWin=window.dialogArguments||opener||parent||top;function fileDialogStart(){jQuery(&quot;#media-upload-error&quot;).empty()}function fileQueued(a){jQuery(&quot;.media-blank&quot;).remove();if(jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0){jQuery(&quot;.describe-toggle-on&quot;).show();jQuery(&quot;.describe-toggle-off&quot;).hide();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidden&quot;)}jQuery(&quot;#media-items&quot;).append('&lt;div id=&quot;media-item-'+a.id+'&quot; class=&quot;media-item child-of-'+post_id+'&quot;&gt;&lt;div class=&quot;progress&quot;&gt;&lt;div class=&quot;bar&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;filename original&quot;&gt;&lt;span class=&quot;percent&quot;&gt;&lt;/span&gt; '+a.name+&quot;&lt;/div&gt;&lt;/div&gt;&quot;);jQuery(&quot;.progress&quot;,&quot;#media-item-&quot;+a.id).show();jQuery
 (&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,true);jQuery(&quot;#cancel-upload&quot;).prop(&quot;disabled&quot;,false)}function uploadStart(a){try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&quot;#TB_overlay&quot;).unbind(&quot;click&quot;,topWin.tb_remove)}}catch(b){}return true}function uploadProgress(e,b,d){var a=jQuery(&quot;#media-items&quot;).width()-2,c=jQuery(&quot;#media-item-&quot;+e.id);jQuery(&quot;.bar&quot;,c).width(a*b/d);jQuery(&quot;.percent&quot;,c).html(Math.ceil(b/d*100)+&quot;%&quot;);if(b==d){jQuery(&quot;.bar&quot;,c).html('&lt;strong class=&quot;crunching&quot;&gt;'+swfuploadL10n.crunching+&quot;&lt;/strong&gt;&quot;)}}function prepareMediaItem(c,a){var d=(typeof shortform==&quot;undefined&quot;)?1:2,b=jQuery(&quot;#media-item-&quot;+c.id);jQuery(&quot;.bar&quot;,b).remove();jQuery(&quot;.progress&quot;,b).hide();try{if(typeof topWin.tb_remove!=&quot;undefined&quot;){topWin.jQuery(&quot;#TB_overlay&quot;).click(topWin.
 tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load(&quot;async-upload.php&quot;,{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery(&quot;#media-item-&quot;+b.id);jQuery(&quot;.thumbnail&quot;,a).clone().attr(&quot;class&quot;,&quot;pinkynail toggle&quot;).prependTo(a);jQuery(&quot;.filename.original&quot;,a).replaceWith(jQuery(&quot;.filename.new&quot;,a));jQuery(&quot;a.toggle&quot;,a).click(function(){jQuery(this).siblings(&quot;.slidetoggle&quot;).slideToggle(350,function(){var d=jQuery(window).height(),e=jQuery(this).offset().top,f=jQuery(this).height(),c;if(d&amp;&amp;e&amp;&amp;f){c=e+f;if(c&gt;d&amp;&amp;(f+48)&lt;d){window.scrollBy(0,c-d+13)}else{if(c&gt;d){window.scrollTo(0,e-36)}}}});jQuery(this).siblings(&quot;.toggle&quot;).andSelf().toggle();jQuery(this).siblings(&quot;a.toggle&quot;).focus();return false});jQuery(&quot;a.delete&quot;,a).click(functio
 n(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;trash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)}});return false});jQuery(&quot;a.undo&quot;,a).click(function(){jQuery.ajax({url:&quot;admin-ajax.php&quot;,type:&quot;post&quot;,id:b.id,data:{id:this.id.replace(/[^0-9]/g,&quot;&quot;),action:&quot;untrash-post&quot;,_ajax_nonce:this.href.replace(/^.*wpnonce=/,&quot;&quot;)},success:function(d,e){var c=jQuery(&quot;#media-item-&quot;+b.id);if(type=jQuery(&quot;#type-of-&quot;+b.id).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-0+1)}if(c.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-0+1)}jQuery(&quot;.filename .trashnotice&quot;,c).remove();jQuery(&quot;.filename .title&qu
 ot;,c).css(&quot;font-weight&quot;,&quot;normal&quot;);jQuery(&quot;a.undo&quot;,c).addClass(&quot;hidden&quot;);jQuery(&quot;a.describe-toggle-on, .menu_order_input&quot;,c).show();c.css({backgroundColor:&quot;#ceb&quot;}).animate({backgroundColor:&quot;#fff&quot;},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:&quot;&quot;})}}).removeClass(&quot;undo&quot;)}});return false});jQuery(&quot;#media-item-&quot;+b.id+&quot;.startopen&quot;).removeClass(&quot;startopen&quot;).slideToggle(500).siblings(&quot;.toggle&quot;).toggle()}function itemAjaxError(d,b){var c=jQuery(&quot;#media-item-&quot;+d);var a=jQuery(&quot;.filename&quot;,c).text();c.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+swfuploadL10n.error_uploading.replace(&quot;%s&quot;,a)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+b+&quot;&lt;/div&gt;&quot;);c.find(&quot;a.dismiss&q
 uot;).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function deleteSuccess(b,d){if(b==&quot;-1&quot;){return itemAjaxError(this.id,&quot;You do not have permission. Has your session expired?&quot;)}if(b==&quot;0&quot;){return itemAjaxError(this.id,&quot;Could not be deleted. Has it been deleted already?&quot;)}var c=this.id,a=jQuery(&quot;#media-item-&quot;+c);if(type=jQuery(&quot;#type-of-&quot;+c).val()){jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text(jQuery(&quot;#&quot;+type+&quot;-counter&quot;).text()-1)}if(a.hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(jQuery(&quot;#attachments-count&quot;).text()-1)}if(jQuery(&quot;form.type-form #media-items&quot;).children().length==1&amp;&amp;jQuery(&quot;.hidden&quot;,&quot;#media-items&quot;).length&gt;0){jQuery(&quot;.toggle&quot;).toggle();jQuery(&quot;.slidetoggle&quot;).slideUp(200).siblings().removeClass(&quot;hidd
 en&quot;)}jQuery(&quot;.toggle&quot;,a).toggle();jQuery(&quot;.slidetoggle&quot;,a).slideUp(200).siblings().removeClass(&quot;hidden&quot;);a.css({backgroundColor:&quot;#faa&quot;}).animate({backgroundColor:&quot;#f4f4f4&quot;},{queue:false,duration:500}).addClass(&quot;undo&quot;);jQuery(&quot;.filename:empty&quot;,a).remove();jQuery(&quot;.filename .title&quot;,a).css(&quot;font-weight&quot;,&quot;bold&quot;);jQuery(&quot;.filename&quot;,a).append('&lt;span class=&quot;trashnotice&quot;&gt; '+swfuploadL10n.deleted+&quot; &lt;/span&gt;&quot;).siblings(&quot;a.toggle&quot;).hide();jQuery(&quot;.filename&quot;,a).append(jQuery(&quot;a.undo&quot;,a).removeClass(&quot;hidden&quot;));jQuery(&quot;.menu_order_input&quot;,a).hide();return}function deleteError(c,b,a){}function updateMediaForm(){var b=jQuery(&quot;form.type-form #media-items&quot;).children(),a=jQuery(&quot;#media-items&quot;).children();if(b.length==1){jQuery(&quot;.slidetoggle&quot;,b).slideDown(500).siblings().ad
 dClass(&quot;hidden&quot;).filter(&quot;.toggle&quot;).toggle()}if(a.not(&quot;.media-blank&quot;).length&gt;0){jQuery(&quot;.savebutton&quot;).show()}else{jQuery(&quot;.savebutton&quot;).hide()}if(a.length&gt;1){jQuery(&quot;.insert-gallery&quot;).show()}else{jQuery(&quot;.insert-gallery&quot;).hide()}}function uploadSuccess(b,a){if(a.match(&quot;media-upload-error&quot;)){jQuery(&quot;#media-item-&quot;+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery(&quot;#media-item-&quot;+b.id).hasClass(&quot;child-of-&quot;+post_id)){jQuery(&quot;#attachments-count&quot;).text(1*jQuery(&quot;#attachments-count&quot;).text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery(&quot;#cancel-upload&quot;).prop(&quot;disabled&quot;,true);jQuery(&quot;#insert-gallery&quot;).prop(&quot;disabled&quot;,false)}}function wpQueueError(a){jQuery(&quot;#media-upload-error&quot;).show().text(a)}function wpFileError(d,c){var b=jQuery(&quot;#media-item-&quo
 t;+d.id);var a=jQuery(&quot;.filename&quot;,b).text();b.html('&lt;div class=&quot;error-div&quot;&gt;&lt;a class=&quot;dismiss&quot; href=&quot;#&quot;&gt;'+swfuploadL10n.dismiss+&quot;&lt;/a&gt;&lt;strong&gt;&quot;+swfuploadL10n.error_uploading.replace(&quot;%s&quot;,a)+&quot;&lt;/strong&gt;&lt;br /&gt;&quot;+c+&quot;&lt;/div&gt;&quot;);b.find(&quot;a.dismiss&quot;).click(function(){jQuery(this).parents(&quot;.media-item&quot;).slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.de
 fault_error)}}}}}function fileDialogComplete(b){try{if(b&gt;0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display=&quot;block&quot;;a.style.display=&quot;none&quot;}else{c.style.display=&quot;none&quot;;a.style.display=&quot;block&quot;}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(&quot;.upload-html-bypass&quot;).hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(s
 wfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery(&quot;#media-item-&quot;+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}jQuery(document).ready(function(a){a('input[type=&quot;radio&quot;]',&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=a(this).closest(&quot;tr&quot;);if(a(b).hasClass(&quot;align&quot;)){setUserSetting(&quot;align&quot;,a(this).val())}else{if(a(b).hasClass(&quot;image-size&quot;)){setUserSetting(&quot;imgsize&quot;,a(this).val())}}});a(&quot;button.button&quot;,&quot;#media-items&quot;).live(&quot;click&quot;,function(){var b=this.className||&quot;&quot;;b=b.match(/url([^ '&quot;]+)/);if(b&amp;&amp;b[1]){setUserSetting(&quot;u
 rlbutton&quot;,b[1]);a(this).siblings(&quot;.urlfield&quot;).val(a(this).attr(&quot;title&quot;))}})});
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/handlers.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadlicensetxt"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/license.txt (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/license.txt                                (rev 0)
+++ trunk/wp-includes/js/swfupload/license.txt        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+/**
+ * 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én and Mammon Media and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+
+The MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the &quot;Software&quot;), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/license.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadplugins"></a>
<div class="propset"><h4>Property changes: trunk/wp-includes/js/swfupload/plugins</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="bugtraqnumber"></a>
<div class="addfile"><h4>Added: bugtraq:number</h4></div>
<a id="trunkwpincludesjsswfuploadpluginsswfuploadcookiesjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/plugins/swfupload.cookies.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/plugins/swfupload.cookies.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/plugins/swfupload.cookies.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+        Cookie Plug-in
+        
+        This plug in automatically gets all the cookies for this site and adds them to the post_params.
+        Cookies are loaded only on initialization.  The refreshCookies function can be called to update the post_params.
+        The cookies will override any other post params with the same name.
+*/
+
+var SWFUpload;
+if (typeof(SWFUpload) === &quot;function&quot;) {
+        SWFUpload.prototype.initSettings = function (oldInitSettings) {
+                return function () {
+                        if (typeof(oldInitSettings) === &quot;function&quot;) {
+                                oldInitSettings.call(this);
+                        }
+                        
+                        this.refreshCookies(false);        // The false parameter must be sent since SWFUpload has not initialzed at this point
+                };
+        }(SWFUpload.prototype.initSettings);
+        
+        // refreshes the post_params and updates SWFUpload.  The sendToFlash parameters is optional and defaults to True
+        SWFUpload.prototype.refreshCookies = function (sendToFlash) {
+                if (sendToFlash === undefined) {
+                        sendToFlash = true;
+                }
+                sendToFlash = !!sendToFlash;
+                
+                // Get the post_params object
+                var postParams = this.settings.post_params;
+                
+                // Get the cookies
+                var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value;
+                for (i = 0; i &lt; caLength; i++) {
+                        c = cookieArray[i];
+                        
+                        // Left Trim spaces
+                        while (c.charAt(0) === &quot; &quot;) {
+                                c = c.substring(1, c.length);
+                        }
+                        eqIndex = c.indexOf(&quot;=&quot;);
+                        if (eqIndex &gt; 0) {
+                                name = c.substring(0, eqIndex);
+                                value = c.substring(eqIndex + 1);
+                                postParams[name] = value;
+                        }
+                }
+                
+                if (sendToFlash) {
+                        this.setPostParams(postParams);
+                }
+        };
+
+}
</ins><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/plugins/swfupload.cookies.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadpluginsswfuploadqueuejs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/plugins/swfupload.queue.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/plugins/swfupload.queue.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/plugins/swfupload.queue.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+        Queue Plug-in
+        
+        Features:
+                *Adds a cancelQueue() method for cancelling the entire queue.
+                *All queued files are uploaded when startUpload() is called.
+                *If false is returned from uploadComplete then the queue upload is stopped.
+                 If false is not returned (strict comparison) then the queue upload is continued.
+                *Adds a QueueComplete event that is fired when all the queued files have finished uploading.
+                 Set the event handler with the queue_complete_handler setting.
+                
+        */
+
+var SWFUpload;
+if (typeof(SWFUpload) === &quot;function&quot;) {
+        SWFUpload.queue = {};
+        
+        SWFUpload.prototype.initSettings = (function (oldInitSettings) {
+                return function () {
+                        if (typeof(oldInitSettings) === &quot;function&quot;) {
+                                oldInitSettings.call(this);
+                        }
+                        
+                        this.queueSettings = {};
+                        
+                        this.queueSettings.queue_cancelled_flag = false;
+                        this.queueSettings.queue_upload_count = 0;
+                        
+                        this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
+                        this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
+                        this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
+                        this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
+                        
+                        this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
+                };
+        })(SWFUpload.prototype.initSettings);
+
+        SWFUpload.prototype.startUpload = function (fileID) {
+                this.queueSettings.queue_cancelled_flag = false;
+                this.callFlash(&quot;StartUpload&quot;, [fileID]);
+        };
+
+        SWFUpload.prototype.cancelQueue = function () {
+                this.queueSettings.queue_cancelled_flag = true;
+                this.stopUpload();
+                
+                var stats = this.getStats();
+                while (stats.files_queued &gt; 0) {
+                        this.cancelUpload();
+                        stats = this.getStats();
+                }
+        };
+        
+        SWFUpload.queue.uploadStartHandler = function (file) {
+                var returnValue;
+                if (typeof(this.queueSettings.user_upload_start_handler) === &quot;function&quot;) {
+                        returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
+                }
+                
+                // To prevent upload a real &quot;FALSE&quot; value must be returned, otherwise default to a real &quot;TRUE&quot; value.
+                returnValue = (returnValue === false) ? false : true;
+                
+                this.queueSettings.queue_cancelled_flag = !returnValue;
+
+                return returnValue;
+        };
+        
+        SWFUpload.queue.uploadCompleteHandler = function (file) {
+                var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
+                var continueUpload;
+                
+                if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
+                        this.queueSettings.queue_upload_count++;
+                }
+
+                if (typeof(user_upload_complete_handler) === &quot;function&quot;) {
+                        continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
+                } else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
+                        // If the file was stopped and re-queued don't restart the upload
+                        continueUpload = false;
+                } else {
+                        continueUpload = true;
+                }
+                
+                if (continueUpload) {
+                        var stats = this.getStats();
+                        if (stats.files_queued &gt; 0 &amp;&amp; this.queueSettings.queue_cancelled_flag === false) {
+                                this.startUpload();
+                        } else if (this.queueSettings.queue_cancelled_flag === false) {
+                                this.queueEvent(&quot;queue_complete_handler&quot;, [this.queueSettings.queue_upload_count]);
+                                this.queueSettings.queue_upload_count = 0;
+                        } else {
+                                this.queueSettings.queue_cancelled_flag = false;
+                                this.queueSettings.queue_upload_count = 0;
+                        }
+                }
+        };
+}
</ins><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/plugins/swfupload.queue.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadpluginsswfuploadspeedjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/plugins/swfupload.speed.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/plugins/swfupload.speed.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/plugins/swfupload.speed.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,342 @@
</span><ins>+/*
+        Speed Plug-in
+        
+        Features:
+                *Adds several properties to the 'file' object indicated upload speed, time left, upload time, etc.
+                        - currentSpeed -- String indicating the upload speed, bytes per second
+                        - averageSpeed -- Overall average upload speed, bytes per second
+                        - movingAverageSpeed -- Speed over averaged over the last several measurements, bytes per second
+                        - timeRemaining -- Estimated remaining upload time in seconds
+                        - timeElapsed -- Number of seconds passed for this upload
+                        - percentUploaded -- Percentage of the file uploaded (0 to 100)
+                        - sizeUploaded -- Formatted size uploaded so far, bytes
+                
+                *Adds setting 'moving_average_history_size' for defining the window size used to calculate the moving average speed.
+                
+                *Adds several Formatting functions for formatting that values provided on the file object.
+                        - SWFUpload.speed.formatBPS(bps) -- outputs string formatted in the best units (Gbps, Mbps, Kbps, bps)
+                        - SWFUpload.speed.formatTime(seconds) -- outputs string formatted in the best units (x Hr y M z S)
+                        - SWFUpload.speed.formatSize(bytes) -- outputs string formatted in the best units (w GB x MB y KB z B )
+                        - SWFUpload.speed.formatPercent(percent) -- outputs string formatted with a percent sign (x.xx %)
+                        - SWFUpload.speed.formatUnits(baseNumber, divisionArray, unitLabelArray, fractionalBoolean)
+                                - Formats a number using the division array to determine how to apply the labels in the Label Array
+                                - factionalBoolean indicates whether the number should be returned as a single fractional number with a unit (speed)
+                                    or as several numbers labeled with units (time)
+        */
+
+var SWFUpload;
+if (typeof(SWFUpload) === &quot;function&quot;) {
+        SWFUpload.speed = {};
+        
+        SWFUpload.prototype.initSettings = (function (oldInitSettings) {
+                return function () {
+                        if (typeof(oldInitSettings) === &quot;function&quot;) {
+                                oldInitSettings.call(this);
+                        }
+                        
+                        this.ensureDefault = function (settingName, defaultValue) {
+                                this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
+                        };
+
+                        // List used to keep the speed stats for the files we are tracking
+                        this.fileSpeedStats = {};
+                        this.speedSettings = {};
+
+                        this.ensureDefault(&quot;moving_average_history_size&quot;, &quot;10&quot;);
+                        
+                        this.speedSettings.user_file_queued_handler = this.settings.file_queued_handler;
+                        this.speedSettings.user_file_queue_error_handler = this.settings.file_queue_error_handler;
+                        this.speedSettings.user_upload_start_handler = this.settings.upload_start_handler;
+                        this.speedSettings.user_upload_error_handler = this.settings.upload_error_handler;
+                        this.speedSettings.user_upload_progress_handler = this.settings.upload_progress_handler;
+                        this.speedSettings.user_upload_success_handler = this.settings.upload_success_handler;
+                        this.speedSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
+                        
+                        this.settings.file_queued_handler = SWFUpload.speed.fileQueuedHandler;
+                        this.settings.file_queue_error_handler = SWFUpload.speed.fileQueueErrorHandler;
+                        this.settings.upload_start_handler = SWFUpload.speed.uploadStartHandler;
+                        this.settings.upload_error_handler = SWFUpload.speed.uploadErrorHandler;
+                        this.settings.upload_progress_handler = SWFUpload.speed.uploadProgressHandler;
+                        this.settings.upload_success_handler = SWFUpload.speed.uploadSuccessHandler;
+                        this.settings.upload_complete_handler = SWFUpload.speed.uploadCompleteHandler;
+                        
+                        delete this.ensureDefault;
+                };
+        })(SWFUpload.prototype.initSettings);
+
+        
+        SWFUpload.speed.fileQueuedHandler = function (file) {
+                if (typeof this.speedSettings.user_file_queued_handler === &quot;function&quot;) {
+                        file = SWFUpload.speed.extendFile(file);
+                        
+                        return this.speedSettings.user_file_queued_handler.call(this, file);
+                }
+        };
+        
+        SWFUpload.speed.fileQueueErrorHandler = function (file, errorCode, message) {
+                if (typeof this.speedSettings.user_file_queue_error_handler === &quot;function&quot;) {
+                        file = SWFUpload.speed.extendFile(file);
+                        
+                        return this.speedSettings.user_file_queue_error_handler.call(this, file, errorCode, message);
+                }
+        };
+
+        SWFUpload.speed.uploadStartHandler = function (file) {
+                if (typeof this.speedSettings.user_upload_start_handler === &quot;function&quot;) {
+                        file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+                        return this.speedSettings.user_upload_start_handler.call(this, file);
+                }
+        };
+        
+        SWFUpload.speed.uploadErrorHandler = function (file, errorCode, message) {
+                file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+                SWFUpload.speed.removeTracking(file, this.fileSpeedStats);
+
+                if (typeof this.speedSettings.user_upload_error_handler === &quot;function&quot;) {
+                        return this.speedSettings.user_upload_error_handler.call(this, file, errorCode, message);
+                }
+        };
+        SWFUpload.speed.uploadProgressHandler = function (file, bytesComplete, bytesTotal) {
+                this.updateTracking(file, bytesComplete);
+                file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+
+                if (typeof this.speedSettings.user_upload_progress_handler === &quot;function&quot;) {
+                        return this.speedSettings.user_upload_progress_handler.call(this, file, bytesComplete, bytesTotal);
+                }
+        };
+        
+        SWFUpload.speed.uploadSuccessHandler = function (file, serverData) {
+                if (typeof this.speedSettings.user_upload_success_handler === &quot;function&quot;) {
+                        file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+                        return this.speedSettings.user_upload_success_handler.call(this, file, serverData);
+                }
+        };
+        SWFUpload.speed.uploadCompleteHandler = function (file) {
+                file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
+                SWFUpload.speed.removeTracking(file, this.fileSpeedStats);
+
+                if (typeof this.speedSettings.user_upload_complete_handler === &quot;function&quot;) {
+                        return this.speedSettings.user_upload_complete_handler.call(this, file);
+                }
+        };
+        
+        // Private: extends the file object with the speed plugin values
+        SWFUpload.speed.extendFile = function (file, trackingList) {
+                var tracking;
+                
+                if (trackingList) {
+                        tracking = trackingList[file.id];
+                }
+                
+                if (tracking) {
+                        file.currentSpeed = tracking.currentSpeed;
+                        file.averageSpeed = tracking.averageSpeed;
+                        file.movingAverageSpeed = tracking.movingAverageSpeed;
+                        file.timeRemaining = tracking.timeRemaining;
+                        file.timeElapsed = tracking.timeElapsed;
+                        file.percentUploaded = tracking.percentUploaded;
+                        file.sizeUploaded = tracking.bytesUploaded;
+
+                } else {
+                        file.currentSpeed = 0;
+                        file.averageSpeed = 0;
+                        file.movingAverageSpeed = 0;
+                        file.timeRemaining = 0;
+                        file.timeElapsed = 0;
+                        file.percentUploaded = 0;
+                        file.sizeUploaded = 0;
+                }
+                
+                return file;
+        };
+        
+        // Private: Updates the speed tracking object, or creates it if necessary
+        SWFUpload.prototype.updateTracking = function (file, bytesUploaded) {
+                var tracking = this.fileSpeedStats[file.id];
+                if (!tracking) {
+                        this.fileSpeedStats[file.id] = tracking = {};
+                }
+                
+                // Sanity check inputs
+                bytesUploaded = bytesUploaded || tracking.bytesUploaded || 0;
+                if (bytesUploaded &lt; 0) {
+                        bytesUploaded = 0;
+                }
+                if (bytesUploaded &gt; file.size) {
+                        bytesUploaded = file.size;
+                }
+                
+                var tickTime = (new Date()).getTime();
+                if (!tracking.startTime) {
+                        tracking.startTime = (new Date()).getTime();
+                        tracking.lastTime = tracking.startTime;
+                        tracking.currentSpeed = 0;
+                        tracking.averageSpeed = 0;
+                        tracking.movingAverageSpeed = 0;
+                        tracking.movingAverageHistory = [];
+                        tracking.timeRemaining = 0;
+                        tracking.timeElapsed = 0;
+                        tracking.percentUploaded = bytesUploaded / file.size;
+                        tracking.bytesUploaded = bytesUploaded;
+                } else if (tracking.startTime &gt; tickTime) {
+                        this.debug(&quot;When backwards in time&quot;);
+                } else {
+                        // Get time and deltas
+                        var now = (new Date()).getTime();
+                        var lastTime = tracking.lastTime;
+                        var deltaTime = now - lastTime;
+                        var deltaBytes = bytesUploaded - tracking.bytesUploaded;
+                        
+                        if (deltaBytes === 0 || deltaTime === 0) {
+                                return tracking;
+                        }
+                        
+                        // Update tracking object
+                        tracking.lastTime = now;
+                        tracking.bytesUploaded = bytesUploaded;
+                        
+                        // Calculate speeds
+                        tracking.currentSpeed = (deltaBytes * 8 ) / (deltaTime / 1000);
+                        tracking.averageSpeed = (tracking.bytesUploaded * 8) / ((now - tracking.startTime) / 1000);
+
+                        // Calculate moving average
+                        tracking.movingAverageHistory.push(tracking.currentSpeed);
+                        if (tracking.movingAverageHistory.length &gt; this.settings.moving_average_history_size) {
+                                tracking.movingAverageHistory.shift();
+                        }
+                        
+                        tracking.movingAverageSpeed = SWFUpload.speed.calculateMovingAverage(tracking.movingAverageHistory);
+                        
+                        // Update times
+                        tracking.timeRemaining = (file.size - tracking.bytesUploaded) * 8 / tracking.movingAverageSpeed;
+                        tracking.timeElapsed = (now - tracking.startTime) / 1000;
+                        
+                        // Update percent
+                        tracking.percentUploaded = (tracking.bytesUploaded / file.size * 100);
+                }
+                
+                return tracking;
+        };
+        SWFUpload.speed.removeTracking = function (file, trackingList) {
+                try {
+                        trackingList[file.id] = null;
+                        delete trackingList[file.id];
+                } catch (ex) {
+                }
+        };
+        
+        SWFUpload.speed.formatUnits = function (baseNumber, unitDivisors, unitLabels, singleFractional) {
+                var i, unit, unitDivisor, unitLabel;
+
+                if (baseNumber === 0) {
+                        return &quot;0 &quot; + unitLabels[unitLabels.length - 1];
+                }
+                
+                if (singleFractional) {
+                        unit = baseNumber;
+                        unitLabel = unitLabels.length &gt;= unitDivisors.length ? unitLabels[unitDivisors.length - 1] : &quot;&quot;;
+                        for (i = 0; i &lt; unitDivisors.length; i++) {
+                                if (baseNumber &gt;= unitDivisors[i]) {
+                                        unit = (baseNumber / unitDivisors[i]).toFixed(2);
+                                        unitLabel = unitLabels.length &gt;= i ? &quot; &quot; + unitLabels[i] : &quot;&quot;;
+                                        break;
+                                }
+                        }
+                        
+                        return unit + unitLabel;
+                } else {
+                        var formattedStrings = [];
+                        var remainder = baseNumber;
+                        
+                        for (i = 0; i &lt; unitDivisors.length; i++) {
+                                unitDivisor = unitDivisors[i];
+                                unitLabel = unitLabels.length &gt; i ? &quot; &quot; + unitLabels[i] : &quot;&quot;;
+                                
+                                unit = remainder / unitDivisor;
+                                if (i &lt; unitDivisors.length -1) {
+                                        unit = Math.floor(unit);
+                                } else {
+                                        unit = unit.toFixed(2);
+                                }
+                                if (unit &gt; 0) {
+                                        remainder = remainder % unitDivisor;
+                                        
+                                        formattedStrings.push(unit + unitLabel);
+                                }
+                        }
+                        
+                        return formattedStrings.join(&quot; &quot;);
+                }
+        };
+        
+        SWFUpload.speed.formatBPS = function (baseNumber) {
+                var bpsUnits = [1073741824, 1048576, 1024, 1], bpsUnitLabels = [&quot;Gbps&quot;, &quot;Mbps&quot;, &quot;Kbps&quot;, &quot;bps&quot;];
+                return SWFUpload.speed.formatUnits(baseNumber, bpsUnits, bpsUnitLabels, true);
+        
+        };
+        SWFUpload.speed.formatTime = function (baseNumber) {
+                var timeUnits = [86400, 3600, 60, 1], timeUnitLabels = [&quot;d&quot;, &quot;h&quot;, &quot;m&quot;, &quot;s&quot;];
+                return SWFUpload.speed.formatUnits(baseNumber, timeUnits, timeUnitLabels, false);
+        
+        };
+        SWFUpload.speed.formatBytes = function (baseNumber) {
+                var sizeUnits = [1073741824, 1048576, 1024, 1], sizeUnitLabels = [&quot;GB&quot;, &quot;MB&quot;, &quot;KB&quot;, &quot;bytes&quot;];
+                return SWFUpload.speed.formatUnits(baseNumber, sizeUnits, sizeUnitLabels, true);
+        
+        };
+        SWFUpload.speed.formatPercent = function (baseNumber) {
+                return baseNumber.toFixed(2) + &quot; %&quot;;
+        };
+        
+        SWFUpload.speed.calculateMovingAverage = function (history) {
+                var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;
+                var i;
+                var mSum = 0, mCount = 0;
+                
+                size = history.length;
+                
+                // Check for sufficient data
+                if (size &gt;= 8) {
+                        // Clone the array and Calculate sum of the values 
+                        for (i = 0; i &lt; size; i++) {
+                                vals[i] = history[i];
+                                sum += vals[i];
+                        }
+
+                        mean = sum / size;
+
+                        // Calculate variance for the set
+                        for (i = 0; i &lt; size; i++) {
+                                varianceTemp += Math.pow((vals[i] - mean), 2);
+                        }
+
+                        variance = varianceTemp / size;
+                        standardDev = Math.sqrt(variance);
+                        
+                        //Standardize the Data
+                        for (i = 0; i &lt; size; i++) {
+                                vals[i] = (vals[i] - mean) / standardDev;
+                        }
+
+                        // Calculate the average excluding outliers
+                        var deviationRange = 2.0;
+                        for (i = 0; i &lt; size; i++) {
+                                
+                                if (vals[i] &lt;= deviationRange &amp;&amp; vals[i] &gt;= -deviationRange) {
+                                        mCount++;
+                                        mSum += history[i];
+                                }
+                        }
+                        
+                } else {
+                        // Calculate the average (not enough data points to remove outliers)
+                        mCount = size;
+                        for (i = 0; i &lt; size; i++) {
+                                mSum += history[i];
+                        }
+                }
+
+                return mSum / mCount;
+        };
+        
+}
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/plugins/swfupload.speed.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadpluginsswfuploadswfobjectjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/plugins/swfupload.swfobject.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/plugins/swfupload.swfobject.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/plugins/swfupload.swfobject.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+/*
+        SWFUpload.SWFObject Plugin
+
+        Summary:
+                This plugin uses SWFObject to embed SWFUpload dynamically in the page.  SWFObject provides accurate Flash Player detection and DOM Ready loading.
+                This plugin replaces the Graceful Degradation plugin.
+
+        Features:
+                * swfupload_load_failed_hander event
+                * swfupload_pre_load_handler event
+                * minimum_flash_version setting (default: &quot;9.0.28&quot;)
+                * SWFUpload.onload event for early loading
+
+        Usage:
+                Provide handlers and settings as needed.  When using the SWFUpload.SWFObject plugin you should initialize SWFUploading
+                in SWFUpload.onload rather than in window.onload.  When initialized this way SWFUpload can load earlier preventing the UI flicker
+                that was seen using the Graceful Degradation plugin.
+
+                &lt;script type=&quot;text/javascript&quot;&gt;
+                        var swfu;
+                        SWFUpload.onload = function () {
+                                swfu = new SWFUpload({
+                                        minimum_flash_version: &quot;9.0.28&quot;,
+                                        swfupload_pre_load_handler: swfuploadPreLoad,
+                                        swfupload_load_failed_handler: swfuploadLoadFailed
+                                });
+                        };
+                &lt;/script&gt;
+                
+        Notes:
+                You must provide set minimum_flash_version setting to &quot;8&quot; if you are using SWFUpload for Flash Player 8.
+                The swfuploadLoadFailed event is only fired if the minimum version of Flash Player is not met.  Other issues such as missing SWF files, browser bugs
+                 or corrupt Flash Player installations will not trigger this event.
+                The swfuploadPreLoad event is fired as soon as the minimum version of Flash Player is found.  It does not wait for SWFUpload to load and can
+                 be used to prepare the SWFUploadUI and hide alternate content.
+                swfobject's onDomReady event is cross-browser safe but will default to the window.onload event when DOMReady is not supported by the browser.
+                 Early DOM Loading is supported in major modern browsers but cannot be guaranteed for every browser ever made.
+*/
+
+
+// SWFObject v2.1 must be loaded
+        
+var SWFUpload;
+if (typeof(SWFUpload) === &quot;function&quot;) {
+        SWFUpload.onload = function () {};
+
+        swfobject.addDomLoadEvent(function () {
+                if (typeof(SWFUpload.onload) === &quot;function&quot;) {
+                        setTimeout(function(){SWFUpload.onload.call(window);}, 200);
+                }
+        });
+
+        SWFUpload.prototype.initSettings = (function (oldInitSettings) {
+                return function () {
+                        if (typeof(oldInitSettings) === &quot;function&quot;) {
+                                oldInitSettings.call(this);
+                        }
+
+                        this.ensureDefault = function (settingName, defaultValue) {
+                                this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
+                        };
+
+                        this.ensureDefault(&quot;minimum_flash_version&quot;, &quot;9.0.28&quot;);
+                        this.ensureDefault(&quot;swfupload_pre_load_handler&quot;, null);
+                        this.ensureDefault(&quot;swfupload_load_failed_handler&quot;, null);
+
+                        delete this.ensureDefault;
+
+                };
+        })(SWFUpload.prototype.initSettings);
+
+
+        SWFUpload.prototype.loadFlash = function (oldLoadFlash) {
+                return function () {
+                        var hasFlash = swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);
+                        
+                        if (hasFlash) {
+                                this.queueEvent(&quot;swfupload_pre_load_handler&quot;);
+                                if (typeof(oldLoadFlash) === &quot;function&quot;) {
+                                        oldLoadFlash.call(this);
+                                }
+                        } else {
+                                this.queueEvent(&quot;swfupload_load_failed_handler&quot;);
+                        }
+                };
+                
+        }(SWFUpload.prototype.loadFlash);
+                        
+        SWFUpload.prototype.displayDebugInfo = function (oldDisplayDebugInfo) {
+                return function () {
+                        if (typeof(oldDisplayDebugInfo) === &quot;function&quot;) {
+                                oldDisplayDebugInfo.call(this);
+                        }
+                        
+                        this.debug(
+                                [
+                                        &quot;SWFUpload.SWFObject Plugin settings:&quot;, &quot;\n&quot;,
+                                        &quot;\t&quot;, &quot;minimum_flash_version:                      &quot;, this.settings.minimum_flash_version, &quot;\n&quot;,
+                                        &quot;\t&quot;, &quot;swfupload_pre_load_handler assigned:     &quot;, (typeof(this.settings.swfupload_pre_load_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
+                                        &quot;\t&quot;, &quot;swfupload_load_failed_handler assigned:     &quot;, (typeof(this.settings.swfupload_load_failed_handler) === &quot;function&quot;).toString(), &quot;\n&quot;,
+                                ].join(&quot;&quot;)
+                        );
+                };        
+        }(SWFUpload.prototype.displayDebugInfo);
+}
</ins><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/plugins/swfupload.swfobject.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadswfuploadalljs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/swfupload-all.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/swfupload-all.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/swfupload-all.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+// swfupload
+var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(a){this.initSWFUpload(a)}}SWFUpload.prototype.initSWFUpload=function(b){try{this.customSettings={};this.settings=b;this.eventQueue=[];this.movieName=&quot;SWFUpload_&quot;+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash()}catch(a){delete SWFUpload.instances[this.movieName];throw a}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version=&quot;2.2.0 2009-03-25&quot;;SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELEC
 T_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;};SWFUpload.completeURL=function(a){if(typeof(a)!==&quot;string&quot;||a.match(/^https?:\/\//i)||a.match(/^\//)){return a}var c,b;c=window.location.protocol+&quot;//&quot;+window.location.hostname+(window.location.port?&quot;:&quot;+window.location.port:&quot;&quot;);b=window.location.pathname.lastIndexOf(&quot;/&quot;);if(b&lt;=0){path=&quot;/&quot;}else{path=window.location.pathname.substr(0,b)+&quot;/&quot;}return path+a};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(b,a){this.settings[b]=(this.settings[b]==undefined)?a:this.settings[b]};this.ensureDefault(&quot;upload_url&quot;,&quot;&quot;);this.ensureDefault(&quot;preserve_relative_urls&quot;,false);this.ensureDefault(&quot;file_post_name&quot;,&quot;Filedata&quot;);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;,[]);this.ensureDefault(&quot;assume_success_timeout&quot;,0);this.ensureDefault(&quot;file_types&quot;,&quot;*.*&quot;);this.ensureDefault(&quot;file_types_description&quot;,&quot;All Files&quot;);this.ensureDefault(&quot;file_size_limit&quot;,0);this.ensureDefault(&quot;file_upload_limit&quot;,0);this.ensureDefault(&quot;file_queue_limit&quot;,0);this.ensureDefault(&quot;flash_url&quot;,&quot;swfupload.swf&quot;);this.ensureDefault(&quot;prevent_swf_caching&quot;,true);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;,&quot;&quot;);this.ensureDefault(&quot;button_placeholder&quot;,null);this.ensureDefault(&quot;button_cursor&quot;,SWFUpload.CURSOR.ARROW);this.ensureDefault(&quot;button_window_mode&quot;,SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault(&quot;debug&quot;,false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault(&quot;swfupload_loaded_handler&quot;,null);this.ensureDefault(&quot;file_dialog_start_handler&quot;,null);this.ensureDefault(&quot;file_queued_handler&quot;,null);this.ensureDefault(&quot;file_queue_error_handler&quot;,null);this.ensureDefault(&quot;file_dialog_complete_handler&quot;,null);this.ensureDefault(&quot;upload_star
 t_handler&quot;,null);this.ensureDefault(&quot;upload_progress_handler&quot;,null);this.ensureDefault(&quot;upload_error_handler&quot;,null);this.ensureDefault(&quot;upload_success_handler&quot;,null);this.ensureDefault(&quot;upload_complete_handler&quot;,null);this.ensureDefault(&quot;debug_handler&quot;,this.debugMessage);this.ensureDefault(&quot;custom_settings&quot;,{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf(&quot;?&quot;)&lt;0?&quot;?&quot;:&quot;&amp;&quot;)+&quot;preventswfcaching=&quot;+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var a,b;if(document.getElementById(this.movieName)!==null){throw&quo
 t;ID &quot;+this.movieName+&quot; is already in use. The Flash Object could not be added&quot;}a=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(a==undefined){throw&quot;Could not find the placeholder element: &quot;+this.settings.button_placeholder_id}b=document.createElement(&quot;div&quot;);b.innerHTML=this.getFlashHTML();a.parentNode.replaceChild(b.firstChild,a);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){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.flas
 h_url,'&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;','&lt;param name=&quot;flashvars&quot; value=&quot;'+this.getFlashVars()+'&quot; /&gt;',&quot;&lt;/object&gt;&quot;].join(&quot;&quot;)};SWFUpload.prototype.getFlashVars=function(){var b=this.buildParamString(),a=this.settings.http_success.join(&quot;,&quot;);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(a),&quot;&amp;amp;assumeSuccessTimeout=&quot;,encodeURIComponent(this.settings.assume_success_timeout),&quot;&amp;amp;params=&quot
 ;,encodeURIComponent(b),&quot;&amp;amp;filePostName=&quot;,encodeURIComponent(this.settings.file_post_name),&quot;&amp;amp;fileTypes=&quot;,encodeURIComponent(this.settings.file_types),&quot;&amp;amp;fileTypesDescription=&quot;,encodeURIComponent(this.settings.file_types_description),&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),&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;buttonTextT
 opPadding=&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;)};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw&quot;Could not find Flash element&quot;}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var c=this.settings.post_params,b=[],a;if(typeof(c)===&quot;object&quot;){for(a in c){if(c.hasOwnProperty(a)){b.push(encodeURIComponent(a.toString())+&quot;=&qu
 ot;+encodeURIComponent(c[a].toString()))}}}return b.join(&quot;&amp;amp;&quot;)};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var a=null,c;a=this.getMovieElement();if(a&amp;&amp;typeof(a.CallFunction)===&quot;unknown&quot;){for(c in a){try{if(typeof(a[c])===&quot;function&quot;){a[c]=null}}catch(e){}}try{a.parentNode.removeChild(a)}catch(b){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(d){return false}};SWFUpload.prototype.addSetting=function(b,c,a){if(c==undefined){return(this.settings[b]=a)}else{return(this.settings[b]=c)}};SWFUpload.prototype.getSetting=function(a){if(this.settings[a]!=undefined){return this.settings[a]}return&quot;&quot;};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=
 this.getMovieElement(),returnValue,returnString;try{returnString=movieElement.CallFunction('&lt;invoke name=&quot;'+functionName+'&quot; returntype=&quot;javascript&quot;&gt;'+__flash__argumentsToXML(argumentArray,0)+&quot;&lt;/invoke&gt;&quot;);returnValue=eval(returnString)}catch(ex){throw&quot;Call to &quot;+functionName+&quot; failed&quot;}if(returnValue!=undefined&amp;&amp;typeof returnValue.post===&quot;object&quot;){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash(&quot;SelectFile&quot;)};SWFUpload.prototype.selectFiles=function(){this.callFlash(&quot;SelectFiles&quot;)};SWFUpload.prototype.startUpload=function(a){this.callFlash(&quot;StartUpload&quot;,[a])};SWFUpload.prototype.cancelUpload=function(a,b){if(b!==false){b=true}this.callFlash(&quot;CancelUpload&quot;,[a,b])};SWFUpload.prototype.stopUpload=function(){this.callFlash(&quot;StopUpload&quot;)};SWFUpload.prototype.getStats=functio
 n(){return this.callFlash(&quot;GetStats&quot;)};SWFUpload.prototype.setStats=function(a){this.callFlash(&quot;SetStats&quot;,[a])};SWFUpload.prototype.getFile=function(a){if(typeof(a)===&quot;number&quot;){return this.callFlash(&quot;GetFileByIndex&quot;,[a])}else{return this.callFlash(&quot;GetFile&quot;,[a])}};SWFUpload.prototype.addFileParam=function(a,b,c){return this.callFlash(&quot;AddFileParam&quot;,[a,b,c])};SWFUpload.prototype.removeFileParam=function(a,b){this.callFlash(&quot;RemoveFileParam&quot;,[a,b])};SWFUpload.prototype.setUploadURL=function(a){this.settings.upload_url=a.toString();this.callFlash(&quot;SetUploadURL&quot;,[a])};SWFUpload.prototype.setPostParams=function(a){this.settings.post_params=a;this.callFlash(&quot;SetPostParams&quot;,[a])};SWFUpload.prototype.addPostParam=function(a,b){this.settings.post_params[a]=b;this.callFlash(&quot;SetPostParams&quot;,[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(a){delete this.settings
 .post_params[a];this.callFlash(&quot;SetPostParams&quot;,[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(a,b){this.settings.file_types=a;this.settings.file_types_description=b;this.callFlash(&quot;SetFileTypes&quot;,[a,b])};SWFUpload.prototype.setFileSizeLimit=function(a){this.settings.file_size_limit=a;this.callFlash(&quot;SetFileSizeLimit&quot;,[a])};SWFUpload.prototype.setFileUploadLimit=function(a){this.settings.file_upload_limit=a;this.callFlash(&quot;SetFileUploadLimit&quot;,[a])};SWFUpload.prototype.setFileQueueLimit=function(a){this.settings.file_queue_limit=a;this.callFlash(&quot;SetFileQueueLimit&quot;,[a])};SWFUpload.prototype.setFilePostName=function(a){this.settings.file_post_name=a;this.callFlash(&quot;SetFilePostName&quot;,[a])};SWFUpload.prototype.setUseQueryString=function(a){this.settings.use_query_string=a;this.callFlash(&quot;SetUseQueryString&quot;,[a])};SWFUpload.prototype.setRequeueOnError=function(a){this.settings.requeue_on_er
 ror=a;this.callFlash(&quot;SetRequeueOnError&quot;,[a])};SWFUpload.prototype.setHTTPSuccess=function(a){if(typeof a===&quot;string&quot;){a=a.replace(&quot; &quot;,&quot;&quot;).split(&quot;,&quot;)}this.settings.http_success=a;this.callFlash(&quot;SetHTTPSuccess&quot;,[a])};SWFUpload.prototype.setAssumeSuccessTimeout=function(a){this.settings.assume_success_timeout=a;this.callFlash(&quot;SetAssumeSuccessTimeout&quot;,[a])};SWFUpload.prototype.setDebugEnabled=function(a){this.settings.debug_enabled=a;this.callFlash(&quot;SetDebugEnabled&quot;,[a])};SWFUpload.prototype.setButtonImageURL=function(a){if(a==undefined){a=&quot;&quot;}this.settings.button_image_url=a;this.callFlash(&quot;SetButtonImageURL&quot;,[a])};SWFUpload.prototype.setButtonDimensions=function(c,a){this.settings.button_width=c;this.settings.button_height=a;var b=this.getMovieElement();if(b!=undefined){b.style.width=c+&quot;px&quot;;b.style.height=a+&quot;px&quot;}this.callFlash(&quot;SetButtonDimensions&quot;
 ,[c,a])};SWFUpload.prototype.setButtonText=function(a){this.settings.button_text=a;this.callFlash(&quot;SetButtonText&quot;,[a])};SWFUpload.prototype.setButtonTextPadding=function(b,a){this.settings.button_text_top_padding=a;this.settings.button_text_left_padding=b;this.callFlash(&quot;SetButtonTextPadding&quot;,[b,a])};SWFUpload.prototype.setButtonTextStyle=function(a){this.settings.button_text_style=a;this.callFlash(&quot;SetButtonTextStyle&quot;,[a])};SWFUpload.prototype.setButtonDisabled=function(a){this.settings.button_disabled=a;this.callFlash(&quot;SetButtonDisabled&quot;,[a])};SWFUpload.prototype.setButtonAction=function(a){this.settings.button_action=a;this.callFlash(&quot;SetButtonAction&quot;,[a])};SWFUpload.prototype.setButtonCursor=function(a){this.settings.button_cursor=a;this.callFlash(&quot;SetButtonCursor&quot;,[a])};SWFUpload.prototype.queueEvent=function(b,c){if(c==undefined){c=[]}else{if(!(c instanceof Array)){c=[c]}}var a=this;if(typeof this.settings[b]=
 ==&quot;function&quot;){this.eventQueue.push(function(){this.settings[b].apply(this,c)});setTimeout(function(){a.executeNextEvent()},0)}else{if(this.settings[b]!==null){throw&quot;Event handler &quot;+b+&quot; is unknown or is not a function&quot;}}};SWFUpload.prototype.executeNextEvent=function(){var a=this.eventQueue?this.eventQueue.shift():null;if(typeof(a)===&quot;function&quot;){a.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(c){var e=/[$]([0-9a-f]{4})/i,f={},d,a,b;if(c!=undefined){for(a in c.post){if(c.post.hasOwnProperty(a)){d=a;while((b=e.exec(d))!==null){d=d.replace(b[0],String.fromCharCode(parseInt(&quot;0x&quot;+b[1],16)))}f[d]=c.post[a]}}c.post=f}return c};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash(&quot;TestExternalInterface&quot;)}catch(a){return false}};SWFUpload.prototype.flashReady=function(){var a=this.getMovieElement();if(!a){this.debug(&quot;Flash called back ready but the flash movie can't be found.
 &quot;);return}this.cleanUp(a);this.queueEvent(&quot;swfupload_loaded_handler&quot;)};SWFUpload.prototype.cleanUp=function(a){var c;try{if(this.movieElement&amp;&amp;typeof(a.CallFunction)===&quot;unknown&quot;){this.debug(&quot;Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)&quot;);for(c in a){try{if(typeof(a[c])===&quot;function&quot;){a[c]=null}}catch(b){}}}}catch(d){}window.__flash__removeCallback=function(e,f){try{if(e){e[f]=null}}catch(g){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent(&quot;file_dialog_start_handler&quot;)};SWFUpload.prototype.fileQueued=function(a){a=this.unescapeFilePostParams(a);this.queueEvent(&quot;file_queued_handler&quot;,a)};SWFUpload.prototype.fileQueueError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent(&quot;file_queue_error_handler&quot;,[a,c,b])};SWFUpload.prototype.fileDialogComplete=function(b,c,a){this.queueEvent(&quot;file_dialog_complete_handler&quot;,[b
 ,c,a])};SWFUpload.prototype.uploadStart=function(a){a=this.unescapeFilePostParams(a);this.queueEvent(&quot;return_upload_start_handler&quot;,a)};SWFUpload.prototype.returnUploadStart=function(a){var b;if(typeof this.settings.upload_start_handler===&quot;function&quot;){a=this.unescapeFilePostParams(a);b=this.settings.upload_start_handler.call(this,a)}else{if(this.settings.upload_start_handler!=undefined){throw&quot;upload_start_handler must be a function&quot;}}if(b===undefined){b=true}b=!!b;this.callFlash(&quot;ReturnUploadStart&quot;,[b])};SWFUpload.prototype.uploadProgress=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent(&quot;upload_progress_handler&quot;,[a,c,b])};SWFUpload.prototype.uploadError=function(a,c,b){a=this.unescapeFilePostParams(a);this.queueEvent(&quot;upload_error_handler&quot;,[a,c,b])};SWFUpload.prototype.uploadSuccess=function(b,a,c){b=this.unescapeFilePostParams(b);this.queueEvent(&quot;upload_success_handler&quot;,[b,a,c])};SWFUpload.p
 rototype.uploadComplete=function(a){a=this.unescapeFilePostParams(a);this.queueEvent(&quot;upload_complete_handler&quot;,a)};SWFUpload.prototype.debug=function(a){this.queueEvent(&quot;debug_handler&quot;,a)};
+// swfupload.queue
+var SWFUpload;if(typeof(SWFUpload)===&quot;function&quot;){SWFUpload.queue={};SWFUpload.prototype.initSettings=(function(a){return function(){if(typeof(a)===&quot;function&quot;){a.call(this)}this.queueSettings={};this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0;this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler;this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler;this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler;this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler;this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}})(SWFUpload.prototype.initSettings);SWFUpload.prototype.startUpload=function(a){this.queueSettings.queue_cancelled_flag=false;this.callFlash(&quot;StartUpload&quot;,[a])};SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=true;this.stopUpload();var a=this.getStats
 ();while(a.files_queued&gt;0){this.cancelUpload();a=this.getStats()}};SWFUpload.queue.uploadStartHandler=function(a){var b;if(typeof(this.queueSettings.user_upload_start_handler)===&quot;function&quot;){b=this.queueSettings.user_upload_start_handler.call(this,a)}b=(b===false)?false:true;this.queueSettings.queue_cancelled_flag=!b;return b};SWFUpload.queue.uploadCompleteHandler=function(b){var c=this.queueSettings.user_upload_complete_handler,d,a;if(b.filestatus===SWFUpload.FILE_STATUS.COMPLETE){this.queueSettings.queue_upload_count++}if(typeof(c)===&quot;function&quot;){d=(c.call(this,b)===false)?false:true}else{if(b.filestatus===SWFUpload.FILE_STATUS.QUEUED){d=false}else{d=true}}if(d){a=this.getStats();if(a.files_queued&gt;0&amp;&amp;this.queueSettings.queue_cancelled_flag===false){this.startUpload()}else{if(this.queueSettings.queue_cancelled_flag===false){this.queueEvent(&quot;queue_complete_handler&quot;,[this.queueSettings.queue_upload_count]);this.queueSettings.queue_upl
 oad_count=0}else{this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0}}}}};
+// swfobject
+var swfobject=function(){var b=&quot;undefined&quot;,Q=&quot;object&quot;,n=&quot;Shockwave Flash&quot;,p=&quot;ShockwaveFlash.ShockwaveFlash&quot;,P=&quot;application/x-shockwave-flash&quot;,m=&quot;SWFObjectExprInst&quot;,j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&amp;&amp;typeof K.getElementsByTagName!=b&amp;&amp;typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&amp;&amp;typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&amp;&amp;!(typeof T.mimeTypes!=b&amp;&amp;T.mimeTypes[P]&amp;&amp;!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,&quot;$1&quot;);AC[0]=parseInt(x.replace(/^(.*)\..*$/,&quot;$1&quot;),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,&quot;$1&quot;),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,&quot;$1&quot;),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+&quot;.7&quot;)}catch
 (t){try{y=new ActiveXObject(p+&quot;.6&quot;);AC=[6,0,21];y.AllowScriptAccess=&quot;always&quot;}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&amp;&amp;y){try{x=y.GetVariable(&quot;$version&quot;);if(x){x=x.split(&quot; &quot;)[1].split(&quot;,&quot;);AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,&quot;$1&quot;)):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&amp;&amp;h.win){try{K.write(&quot;&lt;script id=__ie_ondomload defer=true src=//:&gt;&lt;\/script&gt;&quot;);J=C(&quot;__ie_ondomload&quot;);if(J){I(J,&quot;onreadystatechange&quot;,S)}}catch(q){}}if(h.webkit&amp;&amp;typeof K.re
 adyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener(&quot;DOMContentLoaded&quot;,E,null)}R(E)}();function S(){if(J.readyState==&quot;complete&quot;){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&amp;&amp;h.win){var v=a(&quot;span&quot;);try{var u=K.getElementsByTagName(&quot;body&quot;)[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r&lt;q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener(&quot;load&quot;,r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener(&quot;load&quot;,r,false)}else{if(typeof j.attachEvent!=b){I(j,&quot;onload&quot;,r)}else{if(typeof j.onload==&quot;function&quot;){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q&lt;t;q++){v
 ar u=N[q].id;if(h.pv[0]&gt;0){var r=C(u);if(r){N[q].width=r.getAttribute(&quot;width&quot;)?r.getAttribute(&quot;width&quot;):&quot;0&quot;;N[q].height=r.getAttribute(&quot;height&quot;)?r.getAttribute(&quot;height&quot;):&quot;0&quot;;if(c(N[q].swfVersion)){if(h.webkit&amp;&amp;h.webkit&lt;312){Y(r)}W(u,true)}else{if(N[q].expressInstall&amp;&amp;!A&amp;&amp;c(&quot;6.0.65&quot;)&amp;&amp;(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a(&quot;embed&quot;),y=q.attributes;if(y){var v=y.length;for(var u=0;u&lt;v;u++){if(y[u].nodeName==&quot;DATA&quot;){w.setAttribute(&quot;src&quot;,y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r&lt;z;r++){if(x[r].nodeType==1&amp;&amp;x[r].nodeName==&quot;PARAM&quot;){w.setAttribute(x[r].getAttribute(&quot;name&quot;),x[r].getAttribute(&quot;value&quot;))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=
 true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&amp;&amp;parseInt(w.width,10)&lt;310){w.width=&quot;310&quot;}if(!(/%$/.test(w.height))&amp;&amp;parseInt(w.height,10)&lt;137){w.height=&quot;137&quot;}K.title=K.title.slice(0,47)+&quot; - Flash Player Installation&quot;;var z=h.ie&amp;&amp;h.win?&quot;ActiveX&quot;:&quot;PlugIn&quot;,q=K.title,r=&quot;MMredirectURL=&quot;+j.location+&quot;&amp;MMplayerType=&quot;+z+&quot;&amp;MMdoctitle=&quot;+q,x=w.id;if(h.ie&amp;&amp;h.win&amp;&amp;u.readyState!=4){var t=a(&quot;div&quot;);x+=&quot;SWFObjectNew&quot;;t.setAttribute(&quot;id&quot;,x);u.parentNode.insertBefore(t,u);u.style.display=&quot;none&quot;;var v=function(){u.parentNode.removeChild(u)};I(j,&quot;onload&quot;,v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&amp;&amp;h.win&amp;&amp;t.readyState!=4){var r=a(&quot;div&quot;);t.parentNod
 e.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display=&quot;none&quot;;var q=function(){t.parentNode.removeChild(t)};I(j,&quot;onload&quot;,q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a(&quot;div&quot;);if(h.win&amp;&amp;h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t&lt;q;t++){if(!(w[t].nodeType==1&amp;&amp;w[t].nodeName==&quot;PARAM&quot;)&amp;&amp;!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&amp;&amp;h.win){var AF=&quot;&quot;;for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()==&quot;data&quot;){AE.movie=AG[AB]}else{if(AB.toLowerCase()==&quot;styleclass&quot;){AF+=' class=&quot;'+AG[AB]+'&quot;'}else{if(AB.toLowerCase()!=&quot;classid&quot;){AF+=&quot; &quot;+AB+'=&quot;'+AG[AB]+'&quot;'}}}}}var AD=&quot;&quot;;for(var AA in AE){if(AE[AA]!
 =Object.prototype[AA]){AD+='&lt;param name=&quot;'+AA+'&quot; value=&quot;'+AE[AA]+'&quot; /&gt;'}}v.outerHTML='&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;'+AF+&quot;&gt;&quot;+AD+&quot;&lt;/object&gt;&quot;;i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&amp;&amp;h.webkit&lt;312){var AC=a(&quot;embed&quot;);AC.setAttribute(&quot;type&quot;,P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()==&quot;data&quot;){AC.setAttribute(&quot;src&quot;,AG[z])}else{if(z.toLowerCase()==&quot;styleclass&quot;){AC.setAttribute(&quot;class&quot;,AG[z])}else{if(z.toLowerCase()!=&quot;classid&quot;){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!=&quot;movie&quot;){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute(&quot;type&quot;,P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()==&quot;styleclass&quot;){u.setAttribute(&quot;class&quot
 ;,AG[x])}else{if(x.toLowerCase()!=&quot;classid&quot;){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&amp;&amp;w.toLowerCase()!=&quot;movie&quot;){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a(&quot;param&quot;);u.setAttribute(&quot;name&quot;,q);u.setAttribute(&quot;value&quot;,r);t.appendChild(u)}function X(r){var q=C(r);if(q&amp;&amp;(q.nodeName==&quot;OBJECT&quot;||q.nodeName==&quot;EMBED&quot;)){if(h.ie&amp;&amp;h.win){if(q.readyState==4){B(r)}else{j.attachEvent(&quot;onload&quot;,function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]==&quot;function&quot;){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(&quot;.&quot;);q[0]=parseInt(q[0],10);q[1]=parseIn
 t(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]&gt;q[0]||(r[0]==q[0]&amp;&amp;r[1]&gt;q[1])||(r[0]==q[0]&amp;&amp;r[1]==q[1]&amp;&amp;r[2]&gt;=q[2]))?true:false}function V(v,r){if(h.ie&amp;&amp;h.mac){return }var u=K.getElementsByTagName(&quot;head&quot;)[0],t=a(&quot;style&quot;);t.setAttribute(&quot;type&quot;,&quot;text/css&quot;);t.setAttribute(&quot;media&quot;,&quot;screen&quot;);if(!(h.ie&amp;&amp;h.win)&amp;&amp;typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+&quot; {&quot;+r+&quot;}&quot;))}u.appendChild(t);if(h.ie&amp;&amp;h.win&amp;&amp;typeof K.styleSheets!=b&amp;&amp;K.styleSheets.length&gt;0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?&quot;visible&quot;:&quot;hidden&quot;;if(e&amp;&amp;C(t)){C(t).style.visibility=r}else{V(&quot;#&quot;+t,&quot;visibility:&quot;+r)}}function g(s){var r=/[\\\&quot;&lt;&gt;\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(
 ){if(h.ie&amp;&amp;h.win){window.attachEvent(&quot;onunload&quot;,function(){var w=d.length;for(var v=0;v&lt;w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u&lt;t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&amp;&amp;typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+=&quot;&quot;;AD+=&quot;&quot;;if(c(q)){W(AE,false);var AA={};if(AC&amp;&amp;typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&amp;&amp;typeof z===Q){for(var u in z){if(z[u]!=
 Object.prototype[u]){y[u]=z[u]}}}if(r&amp;&amp;typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+=&quot;&amp;&quot;+t+&quot;=&quot;+r[t]}else{y.flashvars=t+&quot;=&quot;+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&amp;&amp;!A&amp;&amp;c(&quot;6.0.65&quot;)&amp;&amp;(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split(&quot;&amp;&quot;);for(var r=0;r&lt;t.length;r++){if(t[r].substring(0,t
 [r].indexOf(&quot;=&quot;))==v){return g(t[r].substring((t[r].indexOf(&quot;=&quot;)+1)))}}}return&quot;&quot;},expressInstallCallback:function(){if(A&amp;&amp;M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&amp;&amp;h.win){M.style.display=&quot;block&quot;}}M=null;l=null;A=false}}}}}();
+// swfupload.swfobject
+var SWFUpload;if(typeof(SWFUpload)===&quot;function&quot;){SWFUpload.onload=function(){};swfobject.addDomLoadEvent(function(){if(typeof(SWFUpload.onload)===&quot;function&quot;){setTimeout(function(){SWFUpload.onload.call(window)},200)}});SWFUpload.prototype.initSettings=(function(a){return function(){if(typeof(a)===&quot;function&quot;){a.call(this)}this.ensureDefault=function(c,b){this.settings[c]=(this.settings[c]==undefined)?b:this.settings[c]};this.ensureDefault(&quot;minimum_flash_version&quot;,&quot;9.0.28&quot;);this.ensureDefault(&quot;swfupload_pre_load_handler&quot;,null);this.ensureDefault(&quot;swfupload_load_failed_handler&quot;,null);delete this.ensureDefault}})(SWFUpload.prototype.initSettings);SWFUpload.prototype.loadFlash=function(a){return function(){var b=swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);if(b){this.queueEvent(&quot;swfupload_pre_load_handler&quot;);if(typeof(a)===&quot;function&quot;){a.call(this)}}else{this.queueEvent(
 &quot;swfupload_load_failed_handler&quot;)}}}(SWFUpload.prototype.loadFlash);SWFUpload.prototype.displayDebugInfo=function(a){return function(){if(typeof(a)===&quot;function&quot;){a.call(this)}this.debug([&quot;SWFUpload.SWFObject Plugin settings:&quot;,&quot;\n&quot;,&quot;\t&quot;,&quot;minimum_flash_version:                      &quot;,this.settings.minimum_flash_version,&quot;\n&quot;,&quot;\t&quot;,&quot;swfupload_pre_load_handler assigned:     &quot;,(typeof(this.settings.swfupload_pre_load_handler)===&quot;function&quot;).toString(),&quot;\n&quot;,&quot;\t&quot;,&quot;swfupload_load_failed_handler assigned:     &quot;,(typeof(this.settings.swfupload_load_failed_handler)===&quot;function&quot;).toString(),&quot;\n&quot;,].join(&quot;&quot;))}}(SWFUpload.prototype.displayDebugInfo)};
</ins><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/swfupload-all.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadswfuploadjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/swfupload/swfupload.js (0 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/swfupload/swfupload.js                                (rev 0)
+++ trunk/wp-includes/js/swfupload/swfupload.js        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -0,0 +1,980 @@
</span><ins>+/**
+ * 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\xE9n and Mammon Media and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+
+
+/* ******************* */
+/* Constructor &amp; Init  */
+/* ******************* */
+var SWFUpload;
+
+if (SWFUpload == undefined) {
+        SWFUpload = function (settings) {
+                this.initSWFUpload(settings);
+        };
+}
+
+SWFUpload.prototype.initSWFUpload = function (settings) {
+        try {
+                this.customSettings = {};        // A container where developers can place their own settings associated with this instance.
+                this.settings = settings;
+                this.eventQueue = [];
+                this.movieName = &quot;SWFUpload_&quot; + SWFUpload.movieCount++;
+                this.movieElement = null;
+
+
+                // Setup global control tracking
+                SWFUpload.instances[this.movieName] = this;
+
+                // Load the settings.  Load the Flash movie.
+                this.initSettings();
+                this.loadFlash();
+                this.displayDebugInfo();
+        } catch (ex) {
+                delete SWFUpload.instances[this.movieName];
+                throw ex;
+        }
+};
+
+/* *************** */
+/* Static Members  */
+/* *************** */
+SWFUpload.instances = {};
+SWFUpload.movieCount = 0;
+SWFUpload.version = &quot;2.2.0 2009-03-25&quot;;
+SWFUpload.QUEUE_ERROR = {
+        QUEUE_LIMIT_EXCEEDED                          : -100,
+        FILE_EXCEEDS_SIZE_LIMIT                  : -110,
+        ZERO_BYTE_FILE                                          : -120,
+        INVALID_FILETYPE                                  : -130
+};
+SWFUpload.UPLOAD_ERROR = {
+        HTTP_ERROR                                                  : -200,
+        MISSING_UPLOAD_URL                              : -210,
+        IO_ERROR                                                  : -220,
+        SECURITY_ERROR                                          : -230,
+        UPLOAD_LIMIT_EXCEEDED                          : -240,
+        UPLOAD_FAILED                                          : -250,
+        SPECIFIED_FILE_ID_NOT_FOUND                : -260,
+        FILE_VALIDATION_FAILED                          : -270,
+        FILE_CANCELLED                                          : -280,
+        UPLOAD_STOPPED                                        : -290
+};
+SWFUpload.FILE_STATUS = {
+        QUEUED                 : -1,
+        IN_PROGRESS         : -2,
+        ERROR                 : -3,
+        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;
+};
+
+// Private: takes a URL, determines if it is relative and converts to an absolute URL
+// using the current site. Only processes the URL if it can, otherwise returns the URL untouched
+SWFUpload.completeURL = function(url) {
+        if (typeof(url) !== &quot;string&quot; || url.match(/^https?:\/\//i) || url.match(/^\//)) {
+                return url;
+        }
+        
+        var currentURL = window.location.protocol + &quot;//&quot; + window.location.hostname + (window.location.port ? &quot;:&quot; + window.location.port : &quot;&quot;);
+        
+        var indexSlash = window.location.pathname.lastIndexOf(&quot;/&quot;);
+        if (indexSlash &lt;= 0) {
+                path = &quot;/&quot;;
+        } else {
+                path = window.location.pathname.substr(0, indexSlash) + &quot;/&quot;;
+        }
+        
+        return /*currentURL +*/ path + url;
+        
+};
+
+
+/* ******************** */
+/* Instance Members  */
+/* ******************** */
+
+// Private: initSettings ensures that all the
+// settings are set, getting a default value if one was not assigned.
+SWFUpload.prototype.initSettings = function () {
+        this.ensureDefault = function (settingName, defaultValue) {
+                this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
+        };
+        
+        // Upload backend settings
+        this.ensureDefault(&quot;upload_url&quot;, &quot;&quot;);
+        this.ensureDefault(&quot;preserve_relative_urls&quot;, false);
+        this.ensureDefault(&quot;file_post_name&quot;, &quot;Filedata&quot;);
+        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;, []);
+        this.ensureDefault(&quot;assume_success_timeout&quot;, 0);
+        
+        // File Settings
+        this.ensureDefault(&quot;file_types&quot;, &quot;*.*&quot;);
+        this.ensureDefault(&quot;file_types_description&quot;, &quot;All Files&quot;);
+        this.ensureDefault(&quot;file_size_limit&quot;, 0);        // Default zero means &quot;unlimited&quot;
+        this.ensureDefault(&quot;file_upload_limit&quot;, 0);
+        this.ensureDefault(&quot;file_queue_limit&quot;, 0);
+
+        // Flash Settings
+        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;, &quot;&quot;);
+        this.ensureDefault(&quot;button_placeholder&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
+        
+        // Event Handlers
+        this.settings.return_upload_start_handler = this.returnUploadStart;
+        this.ensureDefault(&quot;swfupload_loaded_handler&quot;, null);
+        this.ensureDefault(&quot;file_dialog_start_handler&quot;, null);
+        this.ensureDefault(&quot;file_queued_handler&quot;, null);
+        this.ensureDefault(&quot;file_queue_error_handler&quot;, null);
+        this.ensureDefault(&quot;file_dialog_complete_handler&quot;, null);
+        
+        this.ensureDefault(&quot;upload_start_handler&quot;, null);
+        this.ensureDefault(&quot;upload_progress_handler&quot;, null);
+        this.ensureDefault(&quot;upload_error_handler&quot;, null);
+        this.ensureDefault(&quot;upload_success_handler&quot;, null);
+        this.ensureDefault(&quot;upload_complete_handler&quot;, null);
+        
+        this.ensureDefault(&quot;debug_handler&quot;, this.debugMessage);
+
+        this.ensureDefault(&quot;custom_settings&quot;, {});
+
+        // 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 + (this.settings.flash_url.indexOf(&quot;?&quot;) &lt; 0 ? &quot;?&quot; : &quot;&amp;&quot;) + &quot;preventswfcaching=&quot; + new Date().getTime();
+        }
+        
+        if (!this.settings.preserve_relative_urls) {
+                //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url);        // Don't need to do this one since flash doesn't look at it
+                this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
+                this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
+        }
+        
+        delete this.ensureDefault;
+};
+
+// Private: loadFlash replaces the button_placeholder element with the flash movie.
+SWFUpload.prototype.loadFlash = 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) || this.settings.button_placeholder;
+
+        if (targetElement == undefined) {
+                throw &quot;Could not find the placeholder element: &quot; + this.settings.button_placeholder_id;
+        }
+
+        // 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);
+
+        // Fix IE Flash/Form bug
+        if (window[this.movieName] == undefined) {
+                window[this.movieName] = this.getMovieElement();
+        }
+        
+};
+
+// 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;', 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;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;',
+                                '&lt;param name=&quot;flashvars&quot; value=&quot;' + this.getFlashVars() + '&quot; /&gt;',
+                                '&lt;/object&gt;'].join(&quot;&quot;);
+};
+
+// Private: getFlashVars builds the parameter string that will be passed
+// to flash in the flashvars param.
+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;assumeSuccessTimeout=&quot;, encodeURIComponent(this.settings.assume_success_timeout),
+                        &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),
+                        &quot;&amp;amp;fileTypesDescription=&quot;, encodeURIComponent(this.settings.file_types_description),
+                        &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),
+                        &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
+// The element is cached after the first lookup
+SWFUpload.prototype.getMovieElement = function () {
+        if (this.movieElement == undefined) {
+                this.movieElement = document.getElementById(this.movieName);
+        }
+
+        if (this.movieElement === null) {
+                throw &quot;Could not find Flash element&quot;;
+        }
+        
+        return this.movieElement;
+};
+
+// 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 paramStringPairs = [];
+
+        if (typeof(postParams) === &quot;object&quot;) {
+                for (var name in postParams) {
+                        if (postParams.hasOwnProperty(name)) {
+                                paramStringPairs.push(encodeURIComponent(name.toString()) + &quot;=&quot; + encodeURIComponent(postParams[name].toString()));
+                        }
+                }
+        }
+
+        return paramStringPairs.join(&quot;&amp;amp;&quot;);
+};
+
+// Public: Used to remove a SWFUpload instance from the page. This method strives to remove
+// all references to the SWF, and other objects so memory is properly freed.
+// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
+// Credits: Major improvements provided by steffen
+SWFUpload.prototype.destroy = function () {
+        try {
+                // Make sure Flash is done before we try to remove it
+                this.cancelUpload(null, false);
+                
+
+                // Remove the SWFUpload DOM nodes
+                var movieElement = null;
+                movieElement = this.getMovieElement();
+                
+                if (movieElement &amp;&amp; typeof(movieElement.CallFunction) === &quot;unknown&quot;) { // We only want to do this in IE
+                        // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
+                        for (var i in movieElement) {
+                                try {
+                                        if (typeof(movieElement[i]) === &quot;function&quot;) {
+                                                movieElement[i] = null;
+                                        }
+                                } catch (ex1) {}
+                        }
+
+                        // Remove the Movie Element from the page
+                        try {
+                                movieElement.parentNode.removeChild(movieElement);
+                        } catch (ex) {}
+                }
+                
+                // Remove IE form fix reference
+                window[this.movieName] = null;
+
+                // Destroy other references
+                SWFUpload.instances[this.movieName] = null;
+                delete SWFUpload.instances[this.movieName];
+
+                this.movieElement = null;
+                this.settings = null;
+                this.customSettings = null;
+                this.eventQueue = null;
+                this.movieName = null;
+                
+                
+                return true;
+        } catch (ex2) {
+                return false;
+        }
+};
+
+
+// Public: displayDebugInfo prints out settings and configuration
+// information about this SWFUpload instance.
+// This function (and any references to it) can be deleted when placing
+// SWFUpload in production.
+SWFUpload.prototype.displayDebugInfo = function () {
+        this.debug(
+                [
+                        &quot;---SWFUpload Instance Info---\n&quot;,
+                        &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;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;assume_success_timeout:   &quot;, this.settings.assume_success_timeout, &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_placeholder:       &quot;, (this.settings.button_placeholder ? &quot;Set&quot; : &quot;Not Set&quot;), &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;
+                ].join(&quot;&quot;)
+        );
+};
+
+/* Note: addSetting and getSetting are no longer used by SWFUpload but are included
+        the maintain v2 API compatibility
+*/
+// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
+SWFUpload.prototype.addSetting = function (name, value, default_value) {
+    if (value == undefined) {
+        return (this.settings[name] = default_value);
+    } else {
+        return (this.settings[name] = value);
+        }
+};
+
+// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
+SWFUpload.prototype.getSetting = function (name) {
+    if (this.settings[name] != undefined) {
+        return this.settings[name];
+        }
+
+    return &quot;&quot;;
+};
+
+
+
+// Private: callFlash handles function calls made to the Flash element.
+// Calls are made with a setTimeout for some functions to work around
+// bugs in the ExternalInterface library.
+SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
+        argumentArray = argumentArray || [];
+        
+        var movieElement = this.getMovieElement();
+        var returnValue, returnString;
+
+        // Flash's method if calling ExternalInterface methods (code adapted from MooTools).
+        try {
+                returnString = movieElement.CallFunction('&lt;invoke name=&quot;' + functionName + '&quot; returntype=&quot;javascript&quot;&gt;' + __flash__argumentsToXML(argumentArray, 0) + '&lt;/invoke&gt;');
+                returnValue = eval(returnString);
+        } catch (ex) {
+                throw &quot;Call to &quot; + functionName + &quot; failed&quot;;
+        }
+        
+        // Unescape file post param values
+        if (returnValue != undefined &amp;&amp; typeof returnValue.post === &quot;object&quot;) {
+                returnValue = this.unescapeFilePostParams(returnValue);
+        }
+
+        return returnValue;
+};
+
+/* *****************************
+        -- Flash control methods --
+        Your UI should use these
+        to operate SWFUpload
+   ***************************** */
+
+// WARNING: this function does not work in Flash Player 10
+// Public: selectFile causes a File Selection Dialog window to appear.  This
+// dialog only allows 1 file to be selected.
+SWFUpload.prototype.selectFile = function () {
+        this.callFlash(&quot;SelectFile&quot;);
+};
+
+// WARNING: this function does not work in Flash Player 10
+// Public: selectFiles causes a File Selection Dialog window to appear/ This
+// 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.
+SWFUpload.prototype.selectFiles = function () {
+        this.callFlash(&quot;SelectFiles&quot;);
+};
+
+
+// Public: startUpload starts uploading the first file in the queue unless
+// the optional parameter 'fileID' specifies the ID 
+SWFUpload.prototype.startUpload = function (fileID) {
+        this.callFlash(&quot;StartUpload&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) {
+        if (triggerErrorEvent !== false) {
+                triggerErrorEvent = true;
+        }
+        this.callFlash(&quot;CancelUpload&quot;, [fileID, triggerErrorEvent]);
+};
+
+// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
+// If nothing is currently uploading then nothing happens.
+SWFUpload.prototype.stopUpload = function () {
+        this.callFlash(&quot;StopUpload&quot;);
+};
+
+/* ************************
+ * Settings methods
+ *   These methods change the SWFUpload settings.
+ *   SWFUpload settings should not be changed directly on the settings object
+ *   since many of the settings need to be passed to Flash in order to take
+ *   effect.
+ * *********************** */
+
+// Public: getStats gets the file statistics object.
+SWFUpload.prototype.getStats = function () {
+        return this.callFlash(&quot;GetStats&quot;);
+};
+
+// Public: setStats changes the SWFUpload statistics.  You shouldn't need to 
+// change the statistics but you can.  Changing the statistics does not
+// affect SWFUpload accept for the successful_uploads count which is used
+// by the upload_limit setting to determine how many files the user may upload.
+SWFUpload.prototype.setStats = function (statsObject) {
+        this.callFlash(&quot;SetStats&quot;, [statsObject]);
+};
+
+// Public: getFile retrieves a File object by ID or Index.  If the file is
+// not found then 'null' is returned.
+SWFUpload.prototype.getFile = function (fileID) {
+        if (typeof(fileID) === &quot;number&quot;) {
+                return this.callFlash(&quot;GetFileByIndex&quot;, [fileID]);
+        } else {
+                return this.callFlash(&quot;GetFile&quot;, [fileID]);
+        }
+};
+
+// Public: addFileParam sets a name/value pair that will be posted with the
+// file specified by the Files ID.  If the name already exists then the
+// exiting value will be overwritten.
+SWFUpload.prototype.addFileParam = function (fileID, name, value) {
+        return this.callFlash(&quot;AddFileParam&quot;, [fileID, name, value]);
+};
+
+// Public: removeFileParam removes a previously set (by addFileParam) name/value
+// pair from the specified file.
+SWFUpload.prototype.removeFileParam = function (fileID, name) {
+        this.callFlash(&quot;RemoveFileParam&quot;, [fileID, name]);
+};
+
+// Public: setUploadUrl changes the upload_url setting.
+SWFUpload.prototype.setUploadURL = function (url) {
+        this.settings.upload_url = url.toString();
+        this.callFlash(&quot;SetUploadURL&quot;, [url]);
+};
+
+// Public: setPostParams changes the post_params setting
+SWFUpload.prototype.setPostParams = function (paramsObject) {
+        this.settings.post_params = paramsObject;
+        this.callFlash(&quot;SetPostParams&quot;, [paramsObject]);
+};
+
+// Public: addPostParam adds post name/value pair.  Each name can have only one value.
+SWFUpload.prototype.addPostParam = function (name, value) {
+        this.settings.post_params[name] = value;
+        this.callFlash(&quot;SetPostParams&quot;, [this.settings.post_params]);
+};
+
+// Public: removePostParam deletes post name/value pair.
+SWFUpload.prototype.removePostParam = function (name) {
+        delete this.settings.post_params[name];
+        this.callFlash(&quot;SetPostParams&quot;, [this.settings.post_params]);
+};
+
+// Public: setFileTypes changes the file_types setting and the file_types_description setting
+SWFUpload.prototype.setFileTypes = function (types, description) {
+        this.settings.file_types = types;
+        this.settings.file_types_description = description;
+        this.callFlash(&quot;SetFileTypes&quot;, [types, description]);
+};
+
+// Public: setFileSizeLimit changes the file_size_limit setting
+SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
+        this.settings.file_size_limit = fileSizeLimit;
+        this.callFlash(&quot;SetFileSizeLimit&quot;, [fileSizeLimit]);
+};
+
+// Public: setFileUploadLimit changes the file_upload_limit setting
+SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
+        this.settings.file_upload_limit = fileUploadLimit;
+        this.callFlash(&quot;SetFileUploadLimit&quot;, [fileUploadLimit]);
+};
+
+// Public: setFileQueueLimit changes the file_queue_limit setting
+SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
+        this.settings.file_queue_limit = fileQueueLimit;
+        this.callFlash(&quot;SetFileQueueLimit&quot;, [fileQueueLimit]);
+};
+
+// Public: setFilePostName changes the file_post_name setting
+SWFUpload.prototype.setFilePostName = function (filePostName) {
+        this.settings.file_post_name = filePostName;
+        this.callFlash(&quot;SetFilePostName&quot;, [filePostName]);
+};
+
+// Public: setUseQueryString changes the use_query_string setting
+SWFUpload.prototype.setUseQueryString = function (useQueryString) {
+        this.settings.use_query_string = useQueryString;
+        this.callFlash(&quot;SetUseQueryString&quot;, [useQueryString]);
+};
+
+// Public: setRequeueOnError changes the requeue_on_error setting
+SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
+        this.settings.requeue_on_error = 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: setHTTPSuccess changes the http_success setting
+SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
+        this.settings.assume_success_timeout = timeout_seconds;
+        this.callFlash(&quot;SetAssumeSuccessTimeout&quot;, [timeout_seconds]);
+};
+
+// 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
+        These functions are used by Flash to trigger the various
+        events.
+        
+        All these functions a Private.
+        
+        Because the ExternalInterface library is buggy the event calls
+        are added to a queue and the queue then executed by a setTimeout.
+        This ensures that events are executed in a determinate order and that
+        the ExternalInterface bugs are avoided.
+******************************* */
+
+SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
+        // Warning: Don't call this.debug inside here or you'll create an infinite loop
+        
+        if (argumentArray == undefined) {
+                argumentArray = [];
+        } else if (!(argumentArray instanceof Array)) {
+                argumentArray = [argumentArray];
+        }
+        
+        var self = this;
+        if (typeof this.settings[handlerName] === &quot;function&quot;) {
+                // Queue the event
+                this.eventQueue.push(function () {
+                        this.settings[handlerName].apply(this, argumentArray);
+                });
+                
+                // Execute the next queued event
+                setTimeout(function () {
+                        self.executeNextEvent();
+                }, 0);
+                
+        } else if (this.settings[handlerName] !== null) {
+                throw &quot;Event handler &quot; + handlerName + &quot; is unknown or is not a function&quot;;
+        }
+};
+
+// Private: Causes the next event in the queue to be executed.  Since events are queued using a setTimeout
+// we must queue them in order to garentee that they are executed in order.
+SWFUpload.prototype.executeNextEvent = function () {
+        // Warning: Don't call this.debug inside here or you'll create an infinite loop
+
+        var  f = this.eventQueue ? this.eventQueue.shift() : null;
+        if (typeof(f) === &quot;function&quot;) {
+                f.apply(this);
+        }
+};
+
+// 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) {
+        var reg = /[$]([0-9a-f]{4})/i;
+        var unescapedPost = {};
+        var uk;
+
+        if (file != undefined) {
+                for (var k in file.post) {
+                        if (file.post.hasOwnProperty(k)) {
+                                uk = k;
+                                var match;
+                                while ((match = reg.exec(uk)) !== null) {
+                                        uk = uk.replace(match[0], String.fromCharCode(parseInt(&quot;0x&quot; + match[1], 16)));
+                                }
+                                unescapedPost[uk] = file.post[k];
+                        }
+                }
+
+                file.post = unescapedPost;
+        }
+
+        return file;
+};
+
+// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
+SWFUpload.prototype.testExternalInterface = function () {
+        try {
+                return this.callFlash(&quot;TestExternalInterface&quot;);
+        } catch (ex) {
+                return false;
+        }
+};
+
+// Private: This event is called by Flash when it has finished loading. Don't modify this.
+// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
+SWFUpload.prototype.flashReady = function () {
+        // Check that the movie element is loaded correctly with its ExternalInterface methods defined
+        var movieElement = this.getMovieElement();
+
+        if (!movieElement) {
+                this.debug(&quot;Flash called back ready but the flash movie can't be found.&quot;);
+                return;
+        }
+
+        this.cleanUp(movieElement);
+        
+        this.queueEvent(&quot;swfupload_loaded_handler&quot;);
+};
+
+// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
+// This function is called by Flash each time the ExternalInterface functions are created.
+SWFUpload.prototype.cleanUp = function (movieElement) {
+        // Pro-actively unhook all the Flash functions
+        try {
+                if (this.movieElement &amp;&amp; typeof(movieElement.CallFunction) === &quot;unknown&quot;) { // We only want to do this in IE
+                        this.debug(&quot;Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)&quot;);
+                        for (var key in movieElement) {
+                                try {
+                                        if (typeof(movieElement[key]) === &quot;function&quot;) {
+                                                movieElement[key] = null;
+                                        }
+                                } catch (ex) {
+                                }
+                        }
+                }
+        } catch (ex1) {
+        
+        }
+
+        // Fix Flashes own cleanup code so if the SWFMovie was removed from the page
+        // it doesn't display errors.
+        window[&quot;__flash__removeCallback&quot;] = function (instance, name) {
+                try {
+                        if (instance) {
+                                instance[name] = null;
+                        }
+                } catch (flashEx) {
+                
+                }
+        };
+
+};
+
+
+/* This is a chance to do something before the browse window opens */
+SWFUpload.prototype.fileDialogStart = function () {
+        this.queueEvent(&quot;file_dialog_start_handler&quot;);
+};
+
+
+/* Called when a file is successfully added to the queue. */
+SWFUpload.prototype.fileQueued = function (file) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;file_queued_handler&quot;, file);
+};
+
+
+/* Handle errors that occur when an attempt to queue a file fails. */
+SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;file_queue_error_handler&quot;, [file, errorCode, message]);
+};
+
+/* Called after the file dialog has closed and the selected files have been queued.
+        You could call startUpload here if you want the queued files to begin uploading immediately. */
+SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
+        this.queueEvent(&quot;file_dialog_complete_handler&quot;, [numFilesSelected, numFilesQueued, numFilesInQueue]);
+};
+
+SWFUpload.prototype.uploadStart = function (file) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;return_upload_start_handler&quot;, file);
+};
+
+SWFUpload.prototype.returnUploadStart = function (file) {
+        var returnValue;
+        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) {
+                throw &quot;upload_start_handler must be a function&quot;;
+        }
+
+        // Convert undefined to true so if nothing is returned from the upload_start_handler it is
+        // interpretted as 'true'.
+        if (returnValue === undefined) {
+                returnValue = true;
+        }
+        
+        returnValue = !!returnValue;
+        
+        this.callFlash(&quot;ReturnUploadStart&quot;, [returnValue]);
+};
+
+
+
+SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;upload_progress_handler&quot;, [file, bytesComplete, bytesTotal]);
+};
+
+SWFUpload.prototype.uploadError = function (file, errorCode, message) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;upload_error_handler&quot;, [file, errorCode, message]);
+};
+
+SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;upload_success_handler&quot;, [file, serverData, responseReceived]);
+};
+
+SWFUpload.prototype.uploadComplete = function (file) {
+        file = this.unescapeFilePostParams(file);
+        this.queueEvent(&quot;upload_complete_handler&quot;, file);
+};
+
+/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
+   internal debug console.  You can override this event and have messages written where you want. */
+SWFUpload.prototype.debug = function (message) {
+        this.queueEvent(&quot;debug_handler&quot;, message);
+};
+
+
+/* **********************************
+        Debug Console
+        The debug console is a self contained, in page location
+        for debug message to be sent.  The Debug Console adds
+        itself to the body if necessary.
+
+        The console is automatically scrolled as messages appear.
+        
+        If you are using your own debug handler or when you deploy to production and
+        have debug disabled you can remove these functions to reduce the file size
+        and complexity.
+********************************** */
+   
+// Private: debugMessage is the default debug_handler.  If you want to print debug messages
+// call the debug() function.  When overriding the function your own function should
+// check to see if the debug setting is true before outputting debug information.
+SWFUpload.prototype.debugMessage = function (message) {
+        if (this.settings.debug) {
+                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;) {
+                        for (var key in message) {
+                                if (message.hasOwnProperty(key)) {
+                                        exceptionValues.push(key + &quot;: &quot; + message[key]);
+                                }
+                        }
+                        exceptionMessage = exceptionValues.join(&quot;\n&quot;) || &quot;&quot;;
+                        exceptionValues = exceptionMessage.split(&quot;\n&quot;);
+                        exceptionMessage = &quot;EXCEPTION: &quot; + exceptionValues.join(&quot;\nEXCEPTION: &quot;);
+                        SWFUpload.Console.writeLine(exceptionMessage);
+                } else {
+                        SWFUpload.Console.writeLine(message);
+                }
+        }
+};
+
+SWFUpload.Console = {};
+SWFUpload.Console.writeLine = function (message) {
+        var console, documentForm;
+
+        try {
+                console = document.getElementById(&quot;SWFUpload_Console&quot;);
+
+                if (!console) {
+                        documentForm = document.createElement(&quot;form&quot;);
+                        document.getElementsByTagName(&quot;body&quot;)[0].appendChild(documentForm);
+
+                        console = document.createElement(&quot;textarea&quot;);
+                        console.id = &quot;SWFUpload_Console&quot;;
+                        console.style.fontFamily = &quot;monospace&quot;;
+                        console.setAttribute(&quot;wrap&quot;, &quot;off&quot;);
+                        console.wrap = &quot;off&quot;;
+                        console.style.overflow = &quot;auto&quot;;
+                        console.style.width = &quot;700px&quot;;
+                        console.style.height = &quot;350px&quot;;
+                        console.style.margin = &quot;5px&quot;;
+                        documentForm.appendChild(console);
+                }
+
+                console.value += message + &quot;\n&quot;;
+
+                console.scrollTop = console.scrollHeight - console.clientHeight;
+        } catch (ex) {
+                alert(&quot;Exception: &quot; + ex.name + &quot; Message: &quot; + ex.message);
+        }
+};
</ins><span class="cx">Property changes on: trunk/wp-includes/js/swfupload/swfupload.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsswfuploadswfuploadswf"></a>
<div class="binary"><h4>Added: trunk/wp-includes/js/swfupload/swfupload.swf</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/wp-includes/js/swfupload/swfupload.swf
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (18483 => 18484)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2011-07-29 09:03:24 UTC (rev 18483)
+++ trunk/wp-includes/script-loader.php        2011-07-29 19:21:21 UTC (rev 18484)
</span><span class="lines">@@ -198,7 +198,38 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'jcrop', &quot;/wp-includes/js/jcrop/jquery.Jcrop$suffix.js&quot;, array('jquery'), '0.9.8-20110113');
</span><span class="cx"> 
</span><ins>+        $scripts-&gt;add( 'swfobject', &quot;/wp-includes/js/swfobject.js&quot;, false, '2.2');
</ins><span class="cx"> 
</span><ins>+        // common bits for both uploaders
+        $max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) &lt; (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post;
+        
+        if ( empty($max_upload_size) )
+                $max_upload_size = __('not configured');
+        
+        // error messagoe for both plupload and swfupload
+        $uploader_l10n = array(
+                'queue_limit_exceeded' =&gt; __('You have attempted to queue too many files.'),
+                'file_exceeds_size_limit' =&gt; __('This file exceeds the maximum upload size for this site.'),
+                'zero_byte_file' =&gt; __('This file is empty. Please try another.'),
+                'invalid_filetype' =&gt; __('This file type is not allowed. Please try another.'),
+                'not_an_image' =&gt; __('This file is not an image. Please try another.'),
+                'image_memory_exceeded' =&gt; __('Memory exceeded. Please try another smaller file.'),
+                'image_dimensions_exceeded' =&gt; __('This is larger than the maximum size. Please try another.'),
+                'default_error' =&gt; __('An error occurred in the upload. Please try again later.'),
+                'missing_upload_url' =&gt; __('There was a configuration error. Please contact the server administrator.'),
+                'upload_limit_exceeded' =&gt; __('You may only upload 1 file.'),
+                'http_error' =&gt; __('HTTP error.'),
+                'upload_failed' =&gt; __('Upload failed.'),
+                'io_error' =&gt; __('IO error.'),
+                'security_error' =&gt; __('Security error.'),
+                'file_cancelled' =&gt; __('File canceled.'),
+                'upload_stopped' =&gt; __('Upload stopped.'),
+                'dismiss' =&gt; __('Dismiss'),
+                'crunching' =&gt; __('Crunching&amp;hellip;'),
+                'deleted' =&gt; __('moved to the trash.'),
+                'error_uploading' =&gt; __('&amp;#8220;%s&amp;#8221; has failed to upload due to an error')
+        );
+
</ins><span class="cx">         $scripts-&gt;add( 'plupload', '/wp-includes/js/plupload/plupload.js', false, '1.4.3.2');
</span><span class="cx">         $scripts-&gt;add( 'plupload-html5', '/wp-includes/js/plupload/plupload.html5.js', array('plupload'), '1.4.3.2');
</span><span class="cx">         $scripts-&gt;add( 'plupload-flash', '/wp-includes/js/plupload/plupload.flash.js', array('plupload'), '1.4.3.2');
</span><span class="lines">@@ -206,45 +237,28 @@
</span><span class="cx">         $scripts-&gt;add( 'plupload-gears', '/wp-includes/js/plupload/plupload.gears.js', array('plupload'), '1.4.3.2');
</span><span class="cx">         $scripts-&gt;add( 'plupload-html4', '/wp-includes/js/plupload/plupload.html4.js', array('plupload'), '1.4.3.2');
</span><span class="cx"> 
</span><del>-        // TODO: find out if we can use the plupload.full.js (it does load browserplus)
-        $scripts-&gt;add( 'plupload-full', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-gears', 'plupload-html4'), '1.4.3.2');
</del><ins>+        // TODO: find out if we can use the plupload.full.js, it loads browserplus init JS from Yahoo
+        $scripts-&gt;add( 'plupload-full', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1.4.3.2');
</ins><span class="cx"> 
</span><del>-        $scripts-&gt;add( 'plupload-handlers', '/wp-includes/js/plupload/handlers.js', array('plupload-full', 'jquery'), '1.4.3.2');
-        
-        // TODO: find out if we really need this debug clause with plupload
-        /*if ( defined('SCRIPT_DEBUG') &amp;&amp; SCRIPT_DEBUG ) {
</del><ins>+        $scripts-&gt;add( 'plupload-handlers', &quot;/wp-includes/js/plupload/handlers$suffix.js&quot;, array('plupload-full', 'jquery'), '1.4.3.2');
+        $scripts-&gt;add_script_data( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
+
+        // keep 'swfupload' for back-compat.
+        $scripts-&gt;add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2201-20110113');
+        $scripts-&gt;add( 'swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array('swfupload', 'swfobject'), '2201a');
+        $scripts-&gt;add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201');
+        $scripts-&gt;add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201');
+
+        if ( defined('SCRIPT_DEBUG') &amp;&amp; SCRIPT_DEBUG ) {
</ins><span class="cx">                 // queue all SWFUpload scripts that are used by default
</span><span class="cx">                 $scripts-&gt;add( 'swfupload-all', false, array('swfupload', 'swfupload-swfobject', 'swfupload-queue'), '2201');
</span><span class="cx">         } else {
</span><del>-                $scripts-&gt;add( 'swfupload-all', '/wp-includes/js/swfupload/swfupload-all.js', array(), '2201');
-        }*/
</del><ins>+                $scripts-&gt;add( 'swfupload-all', '/wp-includes/js/swfupload/swfupload-all.js', array(), '2201a');
+        }
</ins><span class="cx"> 
</span><del>-        $max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) &lt; (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post;
-        if ( empty($max_upload_size) )
-                $max_upload_size = __('not configured');
</del><ins>+        $scripts-&gt;add( 'swfupload-handlers', &quot;/wp-includes/js/swfupload/handlers$suffix.js&quot;, array('swfupload-all', 'jquery'), '2201-20110524');
+        $scripts-&gt;add_script_data( 'swfupload-handlers', 'swfuploadL10n', $uploader_l10n );
</ins><span class="cx"> 
</span><del>-        $scripts-&gt;add_script_data( 'plupload-handlers', 'pluploadL10n', array(
-                        'file_exceeds_size_limit' =&gt; __('This file exceeds the maximum upload size for this site.'),
-                        'zero_byte_file' =&gt; __('This file is empty. Please try another.'),
-                        'invalid_filetype' =&gt; __('This file type is not allowed. Please try another.'),
-                        'not_an_image' =&gt; __('This file is not an image. Please try another.'),
-                        'image_memory_exceeded' =&gt; __('Memery exceeded. Please try another smaller file.'),
-                        'image_dimensions_exceeded' =&gt; __('This is larger than the maximum size. Please try another.'),
-                        'default_error' =&gt; __('An error occurred in the upload. Please try again later.'),
-                        'missing_upload_url' =&gt; __('There was a configuration error. Please contact the server administrator.'),
-                        'upload_limit_exceeded' =&gt; __('You may only upload 1 file.'),
-                        'http_error' =&gt; __('HTTP error.'),
-                        'upload_failed' =&gt; __('Upload failed.'),
-                        'io_error' =&gt; __('IO error.'),
-                        'security_error' =&gt; __('Security error.'),
-                        'file_cancelled' =&gt; __('File canceled.'),
-                        'upload_stopped' =&gt; __('Upload stopped.'),
-                        'dismiss' =&gt; __('Dismiss'),
-                        'crunching' =&gt; __('Crunching&amp;hellip;'),
-                        'deleted' =&gt; __('moved to the trash.'),
-                        'error_uploading' =&gt; __('&amp;#8220;%s&amp;#8221; has failed to upload due to an error'),
-        ) );
-
</del><span class="cx">         $scripts-&gt;add( 'comment-reply', &quot;/wp-includes/js/comment-reply$suffix.js&quot;, false, '20090102');
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'json2', &quot;/wp-includes/js/json2$suffix.js&quot;, false, '2011-02-23');
</span></span></pre>
</div>
</div>

</body>
</html>