function startUpload(id){ ;
if (qSize < uploadLimit)
$('#fileInput').fileUploadStart();
} $(document).ready(function() {
var scriptData = {
'cmid':cmid,
'itemid':itemid,
'signature':signature,
'signeddata':signeddata
}
//scriptData[ sessioncookiename ] = sessioncookievalue;
$("#uploadButton").hide();$('#fileInput').fileUpload ({'uploader' : 'lib/multiplefileupload/uploader.swf','script' : 'lib/multiplefileupload/upload.php','scriptData' : scriptData,'multi' : true,'cancelImg' : 'lib/multiplefileupload/cancel.png','buttonText': 'Select Files','auto' : false,'folder' : 'uploads','fileDesc' : 'jpg;png;gif;htm;html;mov','fileExt' : '*.jpg;*.png;*.gif;*.htm;*.html;*.mov',onError: function (a, b, c, d) {
if (d.status == 404)
alert('Could not find upload script.');
else if (d.type === "HTTP")
alert('error '+d.type+": "+d.status);
else if (d.type ==="File Size")
alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
else
alert('error '+d.type+": "+d.text);
}, 'onAllComplete': function() {uploadArray.sort();var fileDisplayArea = $("#filesUploaded");fileDisplayArea.append($ ('
'));var jList = $( "#fileTables" );$.each(uploadArray,function( intIndex, objValue ){var start = objValue.length-4;extension=objValue.substr(start,4);extension=extension.toLowerCase();var fname = objValue.substr(0,objValue.length-4);tableData= '';tableData += '';} else if (extension=='.mov') {tableData+= '';tableData += ''} else if ((extension=='.htm') ||(extension=='html')) {tableData+= '';}tableData+='
';jList.append($ (tableData)); });jList.append($ ('')); $("#uploadButton").hide(); $("#qSize").hide();qSize=0; }, 'onSelect': function (event,queueID,fileObj){
$("#qSize").show();
qSize += fileObj.size;
if (qSize > uploadLimit){
$("#uploadButton").hide();
$("#qSize").css("color","red");
$("#qSize").text("Error: You have selected "+qSize+ " bytes to upload. Bulk upload size is limited to: "+uploadLimit);
} else
{
$("#uploadButton").show();
$("#qSize").css("color","blue");
$("#qSize").html(qSize+" bytes selected. "+(uploadLimit-qSize) + " bytes available to queue");
}
},
'onCancel': function (event,queueID,fileObj){
qSize -= fileObj.size;
if (qSize > uploadLimit){
$("#uploadButton").hide();
$("#qSize").css("color","red");
$("#qSize").text("Error: You have selected "+qSize+ " bytes to upload. Bulk upload size is limited to: "+uploadLimit);
} else
{
$("#uploadButton").show();
$("#qSize").css("color","blue");
$("#qSize").html(qSize+" bytes selected. "+(uploadLimit-qSize) + " bytes available to queue");
}
},
'onComplete': function(event, queueID, fileObj, response, data) {uploadArray[uploadArrayLen]=fileObj.name;uploadArrayLen++;$('#fileTables').remove();} }); });