var downloadFileWindowChild;
var downloadFinished;

var msg;

//Remove is instance of the child window "Multiple Downloader"
function removeWindowInstance() {
    downloadFileWindowChild = null;
}

function setDispMessage(messageText)
{
    msg = messageText;
}

function showHelpInPopup(url) {
    newwindow = window.open(url, 'help', 'height=200,width=150');
    if (window.focus) {
        newwindow.focus()
    }
}

function alreadyDownloaded_Old(obj) {
    obj.src = "../images/button_Download_success.gif";
}

function alreadyDownloaded(obj) {
    document.getElementById(obj).src = "../images/button_Download_success.gif";
}

function startDownloadAll(pathURL) 
{
    if(!IsValidBrowser())
    {
        return;
    }
    createWindow(pathURL,'DownloadAll');
}
function startDownload(mediapackage, pathURL) 
{
    if(!IsValidBrowser() && mediapackage!='5')
    {
        return;
    }
    createWindow(pathURL,'DownloadTrack');
}

function createWindow(pathURL, windname) {
    return window.open(pathURL, windname, "width=475,height=455,scrollbars=yes,resizable=no,status=no");
}

function showErrorMessage(elementId, message) {
    document.getElementById(elementId).firstChild.data = message;
    scroll(0, 0);
}

function IsValidBrowser()
{
    if (!isSupportedBrowser())
    {
        showWarning(msg);
        return false;
    }
    else
    {
        return true;
    }
}

