﻿
function DeleteTheUpload(AreaID, UploadID, UploadArea)
{
    setVisibility("TRLoading" + UploadID + UploadArea, true);
    DeleteUpload.RemoveUploadAssociation(AreaID, UploadID, UploadArea, DeleteUploadCallBackHandler, DeleteUploadFailureCallBackHandler, null);
}

function DeleteUploadCallBackHandler(result)
{
    if(result.Success)
    {
        // window.location.reload(true); -- this will post the page back and insert upload again if last thing user did was upload file 
        window.location = document.URL;
    }
    else
    {
        alert('Im sorry but there has been a problem deleting that upload\r\n' + result.Message);
    }
}

function DeleteUploadFailureCallBackHandler()
{
    alert('Im sorry but there has been a problem deleting that upload');
}

if (typeof(Sys) !== 'undefined') 
Sys.Application.notifyScriptLoaded();
