function DownloadFile(pFilename) {
    window.open("http://www.peachypeople.com/signin/Popups/DownloadFile.aspx?FileName=" + pFilename, "Download", "width=" + 300 + ", height=" + 200 + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=" + "no" + ", copyhistory=no, resizable=no");
    var popup = window.open("http://www.peachypeople.com/signin/Popups/DownloadFile.aspx?FileName=" + pFilename, "Download", "width=" + 300 + ", height=" + 200 + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=" + "no" + ", copyhistory=no, resizable=no");
    popup.visible = true;
}

function DownloadFile(pUrl, pFilename) {
    window.open(pUrl + "DownloadFile.aspx?FileName=" + pFilename, "Download", "width=" + 300 + ", height=" + 200 + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=" + "no" + ", copyhistory=no, resizable=no");
}

//function DownloadFile(pUrl, pFilename,pActualFilename) {
//    window.open(pUrl + "DownloadFile.aspx?FileName=" + pFilename + "&ActualFileName=" + pActualFilename, "Download", "width=" + 300 + ", height=" + 200 + ", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=" + "no" + ", copyhistory=no, resizable=no");
//}

function CheckLuhnCardValidation(pCardNumber) {
    var number = pCardNumber;
    var i, sum, weight;
    sum = 0;
    for (i = 0; i < number.length - 1; i++) {
        weight = number.substr(number.length - (i + 2), 1) * (2 - (i % 2));
        sum += ((weight < 10) ? weight : (weight - 9));
    }
    if (parseInt(number.substr(number.length - 1)) == ((10 - sum % 10) % 10)) {
        return true;
    }
    else {
        alert("Card Number Fails LUHN Test");
        return false;
    }
}


