var submitForm = function(e) {
    var subButton = dojo.byId("submit");
    var resButton = dojo.byId("reset");
    dojo.byId("se").value = "true";
    e.preventDefault();
    dojo.query(".spinner").style("display","inline");
    subButton.disabled = true;
    if (resButton) resButton.disabled = true;
    dojo.xhrPost({
        url: submitURL,
        form: formName,
        handleAs: "text",
        handle: function(data,args){
            if (typeof data == "error") {
                dojo.byId("message").innerHTML = "<b>An internal error occurred.  Please try again later.</b>";
                try {console.warn("error!",args);}catch (e) {}
            }else{
                dojo.byId("message").innerHTML = data;
                try {console.log(data);}catch (e) {}
            }
            dojox.fx.highlight({node:'message', color:'#FFCC11', opacity:{end:1}, duration:1000}).play();                            
            subButton.disabled = false;
            resButton.disabled = false;
            dojo.query(".spinner").style("display","none");
        }
    });
}

function subForm() {
    var subButton = dojo.byId("submit");
    var resButton = dojo.byId("reset");
    dojo.byId("se").value = "true";
    dojo.query(".spinner").style("display","inline");
    subButton.disabled = true;
    if (resButton) resButton.disabled = true;
    dojo.xhrPost({
        url: submitURL,
        form: formName,
        handleAs: "text",
        handle: function(data,args){
            if (typeof data == "error") {
                dojo.byId("message").innerHTML = "<b>An internal error occurred.  Please try again later.</b>";
                try {console.warn("error!",args);}catch (e) {}
            }else{
                dojo.byId("message").innerHTML = data;
                try {console.log(data);}catch (e) {}
            }
            dojox.fx.highlight({node:'message', color:'#FFCC11', opacity:{end:1}, duration:1000}).play();                            
            if (subButton) subButton.disabled = false;
            if (resButton) resButton.disabled = false;
            dojo.query(".spinner").style("display","none");
        }
    });
}