How to pass function name by argument to use as a onclick eventlistener?
<p>I am writing a chrome extension where I am adding a button to the page and then adding an onclick event to it. Since I want to add more buttons, I wanted to have it dynamic..</p>

<pre><code>addAutoModButton('Auto-Moderate', 'moderate');

function addAutoModButton(name, onclickfunction)    {
    ...
    ...
    //creating a button and adding it
    var modbtn = document.createElement("input");
    modbtn.setAttribute('type','button');
    modbtn.setAttribute('value',name);
    title_header.appendChild(modbtn);

    modbtn.addEventListener("click", window["onclickfunction"], false);
    // thats what is not working

}

function moderate() {
    //do some stuff
}
</code></pre>

<p>Suggestions?</p>
