function post_call (caller_obj, controller_name) { this.caller_obj = caller_obj; this.controller_name = controller_name; this.call; this.form_name; if (typeof post_call._initialized == "undefined") { /* Send an Ajax / Iframe post call to a controller */ post_call.prototype.post = function(){ var this_obj = this; //////////////////////////////////////////////////////////////////////// var handleSuccess = function(o) { this_obj.caller_obj.return_call(o.responseText, this_obj.call); }; //////////////////////////////////////////////////////////////////////// if (this.form_name) { YAHOO.util.Connect.setForm(document.getElementById(this.form_name+"_frm"), true, false); }else { YAHOO.util.Connect.setForm(document.getElementById(this.call+"_frm"), true, true); } // ajax post YAHOO.util.Connect.asyncRequest('POST', '/ajax.hj?controller='+this.controller_name+'&'+this.controller_name+'='+this.call+"&a86e3c5a536981718ac291d965e96d57=8553beba81999230c50d88dcc0939351", { success: function(o) { handleSuccess(o); }, failure: function(o) { this_obj.handleFailure(o); }, upload: function(o) { handleSuccess(o); } }); } /* Set the post call */ post_call.prototype.set_call = function (call) { this.call = call; } /* Set the form if its not the call */ post_call.prototype.set_form = function (form_name) { this.form_name = form_name; } /* Ajax Failure Function */ post_call.prototype.handleFailure = function (o) { //alert("Submission failed: " + o.status); } post_call._initialized = true; } }