setTimeout with function
<p>I'm trying to create a bookmarklet to open links with specific text, but I'm facing a problem with the <code>setTimeout</code> portion ... </p>

<pre><code>javascript:(function(){
    function clickLink(link) {
        if (document.createEvent) {
            var event=document.createEvent("MouseEvents"); 
            event.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
            link.dispatchEvent(event);
        } else if (link.fireEvent) {
            link.fireEvent("onclick");
        }
    } 

    l=document.links;
    for(var i=0;i&lt;l.length;++i) {
        var lL=l[i].innerHTML.toLowerCase(); 
        if(lL.indexOf("click here")!=-1 || lL.indexOf("how")!=-1) 
             setTimeout(function() {clickLink(l[i]) }, 1000);
        }
    }; 
})();
</code></pre>

<p>If I try <code>setTimeout(clickLink(l[i]), 1000);</code>, then it works, but it runs immediately rather than waiting for the timeout!</p>

<p>Also want to know one more thing that clicking links this way will fire mousedown/mouseup event? If not then how can I programmatically click links which will also fire mousedown/mouseup events?</p>
