function RequestBody(a){this.add=function(b,c){this[b]=encodeURIComponent(c)};if(a){for(p in a){if(a.hasOwnProperty(p)&&!isFunction(a[p])){this.add(p,a[p])}}}this.toString=function(){var b=[];for(p in this){if(this.hasOwnProperty(p)&&!isFunction(this[p])){b.push(([p,this[p]]).join("="))}}return b.join("&")}}function WaitHandler(b,a){this.start=b||function(){};this.end=a||function(){}}function rpc_call(f,g,e,d,b){if(g&&!(g instanceof RequestBody)){g=new RequestBody(g)}if(!g){g=new RequestBody()}if(!b||!(b instanceof WaitHandler)){b=new WaitHandler()}if(!isFunction(e)){e=function(h){console.log(h)}}if(!isFunction(d)){d=function(h){console.log(h)}}b.start();g.ajax=f;var a=(g)?g.toString():"";var c=(typeof(ajaxurl)=="undefined")?window.location:ajaxurl;jsXML.sendAsyncPost(c,a,function(h){var i=new RegExp("^(ERROR>+)(.*)$","im");if(i.test(h)){var j=i.exec(h);var k="";if(j&&j.length==3){k=j[2]}d(k)}else{e(h)}b.end()},function(h){d(h);b.end()})}function format_timestamp(e,g){if(e){var d=new RegExp("(\\d{4})-(\\d{2})-(\\d{2})\\s*(\\d{2}):(\\d{2}):(\\d{2})");var f=d.exec(e);var b=[f[3],f[2],f[1]];var a=[f[4],f[5],f[6]];var c=[];c.push(b.join("/"));if(g===true){c.push(a.join("."))}return c.join(" ")}return""};