function doPost(url,json,callback,headers){var xhr=new XMLHttpRequest;if(xhr.open("POST",url,!0),xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),void 0!==headers)for(var header in headers)xhr.setRequestHeader(header,headers[header]);xhr.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&200===this.status){var json=null;if(this.responseText)try{json=JSON.parse(this.responseText)}catch(err){json={response:this.responseText}}callback(json)}if(this.readyState===XMLHttpRequest.DONE&&200!=this.status){json=null;if(this.responseText)try{json=JSON.parse(this.responseText)}catch(err){json={response:this.responseText}}callback(json)}};var data=encodeURI(Object.keys(json).map((function(k){return k+"="+json[k]})).join("&"));xhr.send(data)}