how to rerun setTimeOut()?
<p>How do you rerun (start from 0) a setTimeOut()?</p>

<p>This is what I am trying based on other questions: (it doesn't work)</p>

<pre><code>var timer;
function talk() { 
    clearTimeout(timer);
    $('#dialog').show();
    timer = setTimeout(function(){
        $('#dialog').hide();
        }, 2000);
}

$("#dialog").hover(function () {
    talk();
    });

talk();
</code></pre>

<p>How can I properly cancel anything on the settimeout and run it again?</p>

<p>You can see how it doesn't work here: <a href="http://jsfiddle.net/yrBGm" rel="nofollow">jsfiddle.net/yrBGm</a></p>
