(function(e){var t=e.getElementsByTagName("script"),n=t[t.length-1],a=n.getAttribute("src").replace(/[^\/]+$/,"save.php");window.canvas2png=function(t){var n=t.tagName.toLowerCase();if("canvas"===n)if("undefined"!=typeof FlashCanvas)FlashCanvas.saveImage(t);else{var r=e.createElement("form"),o=e.createElement("input");r.setAttribute("action",a),r.setAttribute("method","post"),o.setAttribute("type","hidden"),o.setAttribute("name","dataurl"),o.setAttribute("value",t.toDataURL()),e.body.appendChild(r),r.appendChild(o),r.submit(),r.removeChild(o),e.body.removeChild(r)}}})(document);