﻿function checkDownloadSize() {
    var sumSize = 0;
    for (i = 0; i < document.forms[0].elements.length; i++) {
        elm = document.forms[0].elements[i]
        if (elm.type == 'checkbox') {
            if (elm.id.indexOf('chkDownload') > 0) {
                if (elm.checked == true) {
                    //add file size to sumSize
                    var hidFileSize = $get(elm.id.substring(0, elm.id.length - 11) + "hidFileSize");
                    sumSize += parseInt(hidFileSize.value);
                }
            }
        }
    }

    if (sumSize > 10240000)
        return confirm('Warning: Uncompressed file size is greater than 10MB. The files will be compressed but downloading could still take a while. Continue?');
    else
        return true;


}