navigator.hasxmlProgress=(function(){var a=window.XMLHttpRequest&&new window.XMLHttpRequest()||"";return"onprogress" in a})();function IsHtml5(){if(typeof(Worker)!=="undefined"&&navigator.hasxmlProgress){return true}else{return false}}function uploadProgress(a){if(a.lengthComputable){var b=Math.round(a.loaded*100/a.total);document.getElementById("progressNumber").innerHTML=b.toString()+"%"}else{document.getElementById("progressNumber").innerHTML="unable to compute"}}function uploadComplete(evt){eval(evt.target.responseText);try{}catch(Error){}}function uploadFailed(a){alert("\u9047\u5230\u7db2\u7d61\u932f\u8aa4\uff0c\u4e0a\u50b3\u7d42\u6b62\uff01")}function uploadCanceled(a){alert("The upload has been canceled by the user or the browser dropped the connection.")}function up(d,g,o,m){if(m>1){var n=window.parent.document.getElementById("zoomtueditor").offsetHeight;var p=window.parent.document.getElementById("ifr_editor_upload");var a=window.parent.document.frames?window.parent.document.frames.ifr_editor_upload.document:p.contentDocument;var q=0;if(p!=null&&a!=null){q=a.body.scrollHeight}q=q+32;window.parent.document.getElementById("zoomtueditor").style.height=n+"px";p.style.height=q+"px"}var l=document.createElement("div");var b=g.name+"oneinfo";l.setAttribute("id",b);l.setAttribute("class","oneinfo");var f=document.getElementById("info");f.appendChild(l);var r=document.getElementById(b);r.innerHTML='<div>\u6587\u4ef6\u540d\uff1a<span class="filename"></span> <span class="filesize"></span> (<span class="fileupinfo"></span>)</div><div class="progress"><div class="bar"></div></div>';var k=g.name;var j=0;if(g.size>1024*1024){j=(Math.round(g.size*100/(1024*1024))/100).toString()+"MB"}else{j=(Math.round(g.size*100/1024)/100).toString()+"KB"}var e=document.getElementById(b).getElementsByClassName("filename")[0].innerHTML;if(e!=""){e=e+";"+k;document.getElementById(b).getElementsByClassName("filename")[0].innerHTML=e}else{e=k;document.getElementById(b).getElementsByClassName("filename")[0].innerHTML=e}var c=document.getElementById(b).getElementsByClassName("filesize")[0].innerHTML;if(c!=""){c=c+";"+j;document.getElementById(b).getElementsByClassName("filesize")[0].innerHTML=c}else{c=j;document.getElementById(b).getElementsByClassName("filesize")[0].innerHTML=c}var s=new XMLHttpRequest();s.addEventListener("load",uploadComplete,true);s.addEventListener("error",uploadFailed,true);s.addEventListener("abort",uploadCanceled,true);s.upload.onprogress=function(t){var i=0;if(t.lengthComputable){i=parseInt((100*t.loaded/t.total),10);document.getElementById(b).getElementsByClassName("fileupinfo")[0].innerHTML=i+"%";document.getElementById(b).getElementsByClassName("bar")[0].style.width=i+"%";if(i==100){var h=parseInt(document.getElementById("upnumber").innerHTML);h=h+1;document.getElementById("upnumber").innerHTML=h;if(h==o){try{window.parent.document.getElementById("zoomtueditor").style.display="none";window.parent.document.getElementById("wrapeditor").style.display="none"}catch(u){}}}}else{document.getElementById(b).getElementsByClassName("fileupinfo")[0].innerHTML="\u672a\u80fd\u6210\u529f\u4e0a\u50b3"}};s.open("POST",savefile,true);s.send(d)};