
$(function () {
    UploadDemo.ini();
});

var UploadDemo = {
    ini: function () {
		this.iniUploadDialog();
        this.openUploadClicked();
    },
    iniUploadDialog: function () {
        $('#UploadTemplate').dialog({
            autoOpen: false,
            height: 300,
            width: 350,
            modal: true,
            title: "Open Sartime Template",
            open: function () {
                $('.ui-widget-overlay').css({ opacity: 0.3 });
            },
            beforeClose: function () {
                $('.ui-widget-overlay').css({ opacity: 0.1 });
            },
            buttons: {
                Close: function () {
                    $(this).dialog('close');
                }
            }
        });
    },
    openUploadClicked: function () {
        $('#btnClickUpload').click(function (e) {
            $('#UploadTemplate').dialog('open');
        });
    }

}


function onSuccess(e) {
    alert('success');
}

function onUpload(e) {
    alert('uploaded');
}

function onError(e) {
    alert('error');
    e.preventDefault();
    return false;
}