Formidable.Classes.tut_massupload_cb1 = Formidable.Classes.CodeBehindClass.extend({
	onUploadProgress: function() {
		aParams = this.oForm.getParams();
		this.oForm.rdt("pbar").setPercent(aParams.sys_event.percentage);
		
		sLabel = aParams["sys_event"]["percentage"];
		sLabel += "%";
		sLabel += " <strong>" + aParams["sys_event"]["file"]["name"] + "</strong>";

		this.oForm.rdt("pbar").setHtml(sLabel);
	},
	onUploadSuccess: function() {
		aParams = this.oForm.getParams();
		this.updateHidden(
			aParams["sys_event"]["file"]["name"],
			aParams["sys_event"]
		);

		this.updateLog(
			aParams["sys_event"]["file"]["name"],
			aParams["sys_event"]
		);
	},
	onUploadStart: function() {
		this.oForm.rdt("pbar").displayBlock();
	},
	onUploadComplete: function() {
		this.oForm.rdt("pbar").displayNone();
	},
	updateHidden: function(sFileName, aEvent) {
		oHidden = this.oForm.rdt("files");
		
		if(oHidden.getValue() != '') {
			oHidden.setValue(
				oHidden.getValue() + ","
			);
		}
		
		oHidden.setValue(
			oHidden.getValue() + sFileName
		);
	},
	updateLog: function(sFileName, aEvent) {
		oLi = new Element("li").update(sFileName + " [" + aEvent.file.humanSize + "]");
		this.oForm.rdt("transferlog").domNode().insert(oLi);
	}
});
