JavaScript double click event?
<p><strong>Scripts</strong></p>

<pre><code>var timer;
var firing = false;
var begen = function(id) {
    alert('one click');
};

var popupAc = function(id) {
    alert('double click');
};

function cc(id) {
    if (firing) {
        popupAc(id);
        clearTimeout(timer);
        firing = false;
        return;
    }
    firing = true;
    timer = setTimeout(function() {
        begen(id);
        clearTimeout(timer);
        firing = false;
    }, 250);
}​
</code></pre>

<p><strong>Html</strong></p>

<pre><code>&lt;div id="myID" onclick="cc()"&gt;Click Here&lt;/div&gt;​
</code></pre>

<p><strong>Example</strong>: <a href="http://jsfiddle.net/LXSZj/11/" rel="nofollow">http://jsfiddle.net/LXSZj/11/</a></p>

<p><strong>Question:</strong></p>

<p>It works fine with ie and chrome, But in firefox, when I double click, I get two alert functions.(alert double click event and one click event)</p>

<p>How can I fix It?</p>

<p>Thanks.</p>
