let fileObject = null;
window.onAddFile = function(object)
{
    fileObject = object;
    $('input[name="source"]').prop('checked', false);
    $('.file-selector-btn').addClass('hidden');
}

window.onRemoveFile = function()
{
    fileObject = null;
    $('.select-table').addClass('hidden');
    $('.file-selector-btn').removeClass('hidden');
}

window.downloadTemplate = function()
{
    var url = $.createLink('montecarlo', 'downloadTemplate');
    var form = document.createElement('form');
    form.style.display = 'none';
    form.action = url;
    form.method = 'post';
    document.body.appendChild(form);
    form.submit();
    document.body.removeChild(form);
}