KISS={rpc:function () {
    var class_name=this.name;
    var method_name=arguments[0];
    var orin_param=$A(arguments[1]);
    var callback=0;
    if (orin_param.length>0&&typeof (orin_param.last())=="function") {
        callback=orin_param.pop();
    }
    new Ajax.Request(this.URL,{parameters:{"method":method_name,"parameters":orin_param.toJSON()},requestHeaders:["KISS-RPC","JSON"],onSuccess:function (transport) {
        try {
            var result=transport.responseText.evalJSON();
            if (typeof (result["Exception"])!="undefined") {
                throw new KISS_Server_Exception(result["Exception"],result["option_msg"]);
            }
            if (typeof (result["message"])!="undefined") {
                alert(result["message"]);
            }
            if (typeof (result["data"])!="undefined") {
                if (typeof (callback)!=="function"&&typeof (window[class_name][method_name+"_callback"])=="function") {
                    callback=window[class_name][method_name+"_callback"];
                }
                if (typeof (callback)==="function") {
                    callback(result["data"],orin_param);
                }
            }
        }
        catch (e) {
            e.show_error();
        }
    }});
}};
KISS_Server_Exception=function (msg,context) {
    this.message=msg;
    this.context=context;
};
KISS_Server_Exception.prototype.show_error=function () {
    alert(this.message+"\n-----------------------\n"+this.context);
};