YUI.add("io-upload-iframe",function(d,t){var u=d.config.win,s=d.config.doc,o=s.documentMode&&8<=s.documentMode,m=decodeURIComponent,n=d.IO.prototype.end;function c(t){d.Event.purgeElement("#io_iframe"+t,!1),d.one("body").removeChild(d.one("#io_iframe"+t))}d.mix(d.IO.prototype,{_addData:function(t,e){for(var i,o,n=[],r=0,a=(i=(e=d.Lang.isObject(e)?d.QueryString.stringify(e):e).split("=")).length-1;r<a;r++)o=m(i[r].substring(i[r].lastIndexOf("&")+1)),t.elements[o]||(n[r]=s.createElement("input"),n[r].type="hidden",n[r].name=o,n[r].value=m(r+1===a?i[r+1]:i[r+1].substring(0,i[r+1].lastIndexOf("&"))),t.appendChild(n[r]));return n},_removeData:function(t,e){for(var i=0,o=e.length;i<o;i++)t.removeChild(e[i])},_setAttrs:function(t,e,i){this._originalFormAttrs={action:t.getAttribute("action"),target:t.getAttribute("target")},t.setAttribute("action",i),t.setAttribute("method","POST"),t.setAttribute("target","io_iframe"+e),t.setAttribute(d.UA.ie&&!o?"encoding":"enctype","multipart/form-data")},_resetAttrs:function(i,t){d.Object.each(t,function(t,e){t?i.setAttribute(e,t):i.removeAttribute(e)})},_startUploadTimeout:function(t,e){var i=this;i._timeout[t.id]=u.setTimeout(function(){t.status=0,t.statusText="timeout",i.complete(t,e),i.end(t,e)},e.timeout)},_clearUploadTimeout:function(t){u.clearTimeout(this._timeout[t]),delete this._timeout[t]},_uploadComplete:function(t,e){var i,o=this,n=d.one("#io_iframe"+t.id).get("contentWindow.document"),r=n.one("body");e.timeout&&o._clearUploadTimeout(t.id);try{r?(i=r.one("pre:first-child"),t.c.responseText=(i||r).get("text")):t.c.responseXML=n._node}catch(a){t.e="upload failure"}o.complete(t,e),o.end(t,e),u.setTimeout(function(){c(t.id)},0)},_upload:function(t,e,i){var o,n,r=this,a="string"==typeof i.form.id?s.getElementById(i.form.id):d.Node.getDOMNode(i.form.id);return r._setAttrs(a,t.id,e),i.data&&(o=r._addData(a,i.data)),i.timeout&&r._startUploadTimeout(t,i),a.submit(),r.start(t,i),i.data&&(n=r.on("io:end",function(t){n.detach(),r._removeData(a,o)})),{id:t.id,abort:function(){if(t.status=0,t.statusText="abort",!d.one("#io_iframe"+t.id))return!1;c(t.id),r.complete(t,i),r.end(t,i)},isInProgress:function(){return!!d.one("#io_iframe"+t.id)},io:r}},upload:function(t,e,i){var o,n,r,a;return o=t,n=i,r=this,(a=d.Node.create('<iframe id="io_iframe'+o.id+'" name="io_iframe'+o.id+'" />'))._node.style.position="absolute",a._node.style.top="-1000px",a._node.style.left="-1000px",d.one("body").appendChild(a),d.on("load",function(){r._uploadComplete(o,n)},"#io_iframe"+o.id),this._upload(t,e,i)},end:function(t,e){var i;return e&&(i=e.form)&&i.upload&&(i="string"==typeof i.id?s.getElementById(i.id):i.id)&&this._resetAttrs(i,this._originalFormAttrs),n.call(this,t,e)}},!0)},"patched-v3.18.7",{requires:["io-base","node-base"]});