DonationHandler.prototype.clearErrors = DonationHandler_clearErrors;
DonationHandler.prototype.getSku = DonationHandler_getSku;
DonationHandler.prototype.setAmount = DonationHandler_setAmount;
DonationHandler.prototype.setSelection = DonationHandler_setSelection;
DonationHandler.prototype.validate = DonationHandler_validate;

function DonationHandler() {
    this.skuId = null;
    this.amount = null;
}

function DonationHandler_clearErrors() {
}

function DonationHandler_getSku() {
    return this.skuId;
}

function DonationHandler_setAmount(amt) {
    var el = document.getElementById("amount");
    var initPrice = document.getElementById("initPriceValue");
    var price = document.getElementById("priceValue");
    el.value = amt;
    initPrice.style.display = "none";
    price.innerHTML = "$" + amt;
}

function DonationHandler_setSelection(dropDown) {
    var selectedValue = dropDown.options[dropDown.selectedIndex].value;
    
    if (selectedValue) {
        var selectedValueArray = selectedValue.split("|");
        
        if (selectedValueArray.length == 2) {
            this.skuId = selectedValueArray[0];
            this.setAmount(selectedValueArray[1]);
        }
    }
}

function DonationHandler_validate() {
    return true;
}