function fileQueueError(file, errorCode, message) 
{
		var errorName = "";
		if (errorCode === SWFUpload.errorCode_QUEUE_LIMIT_EXCEEDED) {
			errorName = "You have attempted to queue too many files.";
		}

		if (errorName !== "") {
			alert(errorName);
			return;
		}else {
    		alert(message);
			}
		}
	
	


function fileDialogComplete(numFilesSelected, numFilesQueued) {
	try {
		if (numFilesQueued > 0) {
			this.startUpload();
		}
	} catch (ex) {
		this.debug(ex);
	}
}

function uploadProgress(file, bytesLoaded) {

	try {
		var percent = Math.ceil((bytesLoaded / file.size) * 100);
		if (percent === 100) {
		    $("#divFileProgressContainer_logo").html("Uploaded");
		} else {
			$("#divFileProgressContainer_logo").html("Uploading...");
		}
	} catch (ex) {
		this.debug(ex);
	}
}

function uploadSuccess(file, serverData) {
    try {
	
	    $("#divFileProgressContainer_logo").html(file.name);
	    $("#LogoLink").val(serverData);

	} catch (ex) {
		this.debug(ex);
	}
}

function uploadComplete(file) {
	try {
		/*  I want the next upload to continue automatically so I'll call startUpload here */
		if (this.getStats().files_queued > 0) {
			this.startUpload();
		} 
	} catch (ex) {
		this.debug(ex);
	}
}

function uploadError(file, errorCode, message) {
	alert(message);
}

/* photo */
function uploadProgressPhoto(file, bytesLoaded) {

    try {
        var percent = Math.ceil((bytesLoaded / file.size) * 100);
        if (percent === 100) {
            $("#divFileProgressContainer_photo").html("Uploaded");
        } else {
        $("#divFileProgressContainer_photo").html("Uploading...");
        }
    } catch (ex) {
        this.debug(ex);
    }
}

function uploadSuccessPhoto(file, serverData) {
    try {

        $("#divFileProgressContainer_photo").html(file.name);
        $("#PhotoLink").val(serverData);

    } catch (ex) {
        this.debug(ex);
    }
}
