title: event listener on canvas in html5 issue
body: <p>i am new in html5 , i want to create a event listener on my mouse , i have written the following code , but cannot understand y , i cant create the event listener on my canvas element , kindly help </p>
  
  <pre><code>     var canvasDiv = document.getElementById('canvas');
       canvas_simple = document.createElement('canvas');
       canvas_simple.setAttribute('height', canvasHeight);
       canvas_simple.setAttribute('id', 'canvasSimple');
       canvasDiv.appendChild(canvas_simple);
       if(typeof G_vmlCanvasManager != 'undefined')
       {
       canvas_simple = G_vmlCanvasManager.initElement(canvas_simple);
       }
       context_simple = canvas_simple.getContext("2d");
      context_simple.addEventListener('mousemove', ev_mousemove, false);
  </code></pre>
  
  <p>in light of a ans i want give me event listener code also , may be it has a error also </p>
  
  <pre><code>  var started = false;
    function ev_mousemove (ev) {
    var x, y;
  
     if (ev.layerX || ev.layerX == 0) { // Firefox
    x = ev.layerX;
    y = ev.layerY;
    } 
    else if (ev.offsetX || ev.offsetX == 0) { // Opera
    x = ev.offsetX;
    y = ev.offsetY;
    }
    if (!started) {
  
    context.beginPath();
    context.moveTo(x, y);
    started = true;
    }
    else {
      context.strokeStyle = "#df4b26";
      context.lineJoin = "round";
      context.lineWidth = 10;
      context.lineTo(x, y);
      context.stroke();
       }
  </code></pre>
  
  <p>}</p>