

// Default upload start function.
uploadStart = function(fileObj) {
	
	$("filesDisplay").style.display = "block";
		
	var li = document.createElement("li");
	var txt = document.createTextNode(fileObj.name);

	li.className = "uploading";
	li.id = fileObj.name;
	
	var prg = document.createElement("span");
	prg.id = "progress";
	prg.className = "progressBar"
	
	li.appendChild(txt);
	li.appendChild(prg);

	$("mmUploadFileListing").appendChild(li);
		
}

uploadProgress = function(fileObj, bytesLoaded) {
	var progress = $("progress");
	var percent = Math.ceil((bytesLoaded / fileObj.size) * 100);
	
	if(fileObj.type==".xlsx"){
		var k=100-percent;
		
		progress.style.backgroundImage = "URL(/global/js/SWFUpload/images/progressbar.png) no-repeat -" + k + "px 0";
	}
	//progress.style.background = "#999";
}

invoiceStore=function(fileObj,serverData){
	//console.log(serverData);
	if(fileObj.type==".xlsx"){
		document.getElementById('path').value=fileObj.name;
		
		$(fileObj.name).className = "uploadDone";
		$(fileObj.name).innerHTML += " " + (Math.ceil(fileObj.size / 1000)) + " kb";
	}else{
		$(fileObj.name).innerHTML="请上传符合文件";
	}
}

uploadComplete = function(fileObj) {
	if(fileObj.type==".xlsx"){
		document.getElementById('path').value=fileObj.name;
		
		$(fileObj.name).className = "uploadDone";
		$(fileObj.name).innerHTML += " " + (Math.ceil(fileObj.size / 1000)) + " kb";
	}else{
		$(fileObj.name).innerHTML="请上传符合文件";
	}
}

uploadCancel = function() {
	//alert("You pressed cancel!");
}