function startUL(){if(validationImpl("repForm")){$("#cancelBtn").removeAttr("disabled");$("#progressBox").show();setTimeout(getProgress,50)}else{return false}return true}function getProgress(){var A="upload.xhr.php?ulID="+$("#progressKey").val();$.ajax({type:"GET",cache:"false",url:A,success:displayResults,error:handleError,dataType:"json",timeout:400})}function displayResults(D){var A=Math.round(D.current/1024);if(D.errMsg!=null){cancel();alert(D.errMsg)}else{if(A>0){var B=Math.round(D.total/1024);var C=Math.round((D.current*100)/D.total);$("#info").text(A+" KB / "+B+" KB ("+C+"%)");$("#bar").css("width",(C||0)+"%");if(D.done==0){setTimeout(getProgress,500)}else{switch(D.cancel_upload){case 1:case 2:alert("File too big !");break;default:$("#ulInfo").text("Parsing replays, please wait...");break}}}}}function handleError(A,C,B){if(C=="timeout"){setTimeout(getProgress,10)}}function cancel(){var A="upload.xhr.php?ulID="+$("#progressKey").val()+"&cancel=1";$.ajax({type:"GET",cache:"false",async:false,url:A});if($.browser.msie){document.execCommand("Stop")}else{window.stop()}$("#progressBox").hide();$("#cancelBtn").attr("disabled","disabled")};