title: Mouse events not working in OpenLaszlo application
body: <p>I have designed a highlighter that works fine with html pages, but when I am trying to integrate with an OpenLaszlo application I am facing problem with the mouse events.....</p>
  <p>The OpenLaszlo application has a button which on clicking activates the highlighter.The application has been deployed as a solo application and the function corresponding to the button has been written in the &quot;index.html&quot; file that is generated.</p>
  <p>The button code defined in the Laszlo application is as follows :--</p>
  <pre><code> &lt;button name=&quot;Highlighter&quot; onclick=&quot;highlightController()&quot;&gt;Highlighter
              
                  &lt;method name=&quot;highlightController&quot;&gt;
                      if(parent.check=&quot;false&quot;){
                              this.setAttribute(&quot;check&quot;, true);
                              
                              if(this.check == true){
                                  lz.Browser.loadJS('Highlight(&quot;true&quot;)');
                              }
                              else if(this.check == false){
                                  lz.Browser.loadJS('Highlight(&quot;false&quot;)');
                              }
                      }
                  &lt;/method&gt;
    &lt;/button&gt;
  </code></pre>
  <p>The corresponding button function is a follows:--</p>
  <pre><code>    function Highlight(check) {
          alert(&quot;button function&quot;);
          var cursor = {},
          divr = {},
          dragging = false,
          dv=document.createElement('div');
          dv.setAttribute('id',&quot;maindiv&quot;);
          document.body.appendChild(dv);
          var maindiv=document.getElementById('maindiv');
      
      function maindivstart(a, b) {
      
          cursor.a = a;
          cursor.b = b;
          maindivposition();
          dragging = true;
          $('#maindiv').clone().insertAfter(&quot;#maindiv&quot;);
      
      }
  
      function maindivsize(a, b) {
  
          divr.left = a &lt; cursor.a ? a : cursor.a;
          divr.top = b &lt; cursor.b ? b : cursor.b;
          divr.width = Math.abs(a - cursor.a),
          divr.height = Math.abs(b - cursor.b);
          maindivposition();
          maindivresize();
  
      }
  
      function maindivend() {
  
          dragging = false;
      
      }
  
      function maindivposition() {
  
          maindiv.style.top = divr.top + 'px';
          maindiv.style.left = divr.left + 'px';
  
      }
  
      function maindivresize() {
  
          maindiv.style.width = divr.width + 'px';
          maindiv.style.height = divr.height + 'px';
  
      }
  
      window.onmousedown = ( function (e) {
     
          var a = e.clientX,
              b = e.clientY;
          e.preventDefault();
          maindivstart(a, b);
  
      });
  
      window.onmousemove = ( function (e) {
      
          var a = e.clientX,
              b = e.clientY;
          e.preventDefault();
          if (dragging) {
              maindivsize(a, b);
          }
  
      });
  
      window.onmouseup = ( function (e) {
  
          e.preventDefault();
          maindivend();
      
      });
  
  }
  </code></pre>
  <p>The mouse events are not working... can anyone help?</p>