var canvas=document.getElementById("demo"); var cxt=canvas.getContext("2d"); var flag=0; canvas.onmousedown=function(evt){ evt=window.event?window.event:evt; var startX=evt.pageX-this.offsetLeft; var startY=evt.pageY-this.offse