﻿// JScript File

Ajax.Commands.AddDailySpecialDistribution=function(elementId, ajaxCommand, cmdCounter){
    this.priority=net.CommandQueue.PRIORITY_IMMEDIATE;
    this.type=net.CommandQueue.TYPE_SINGLEPROCESS;
    this.id=cmdCounter;
    this.elementId = elementId;
    this.ajaxCommand = ajaxCommand;
    this.vendorId = elementId;
    this.emailAddress = document.getElementById('dailySpecialEmailAddress').value;
}

Ajax.Commands.AddDailySpecialDistribution.prototype.QueryStringVariables=function() {
    var commandVariables = new Hashtable();
    commandVariables.put("vendorId", this.vendorId);
    commandVariables.put("dailySpecialEmailAddress", this.emailAddress);
    return commandVariables;
}

Ajax.Commands.AddDailySpecialDistribution.prototype.ParseResponse=function(docEl){
    var attrs = docEl.attributes;
    var status = attrs.getNamedItem('status').value;
    var message=attrs.getNamedItem("message").value;
    document.getElementById('dailySpecialMsg').innerHTML = "";
    document.getElementById('dailySpecialErrorMsg').innerHTML = "";
    if(status == 'ok') {
    document.getElementById('dailySpecialMsg').innerHTML = message;
    } else {
    document.getElementById('dailySpecialErrorMsg').innerHTML = message;
    }
    document.getElementById('dailySpecialEmailAddress').value = "";
    
}

