1addInitEvent(init_npd);
2function init_npd()
3{
4    var button = $('npd_create_button');
5    if (!button) return;
6
7    if (button.nodeName.toLowerCase() == 'a') {
8        npd_clicked_url = button.getAttribute('href');
9    } else {
10        npd_clicked_url = button.parentNode.parentNode.getAttribute('action');
11    }
12
13    addEvent(button, "click", npd_clicked);
14
15    // show the button
16    button.style.display = '';
17}
18
19function npd_clicked(e)
20{
21    // the event is extended by the eventhandler,
22    // so the following works in IE:
23    e.preventDefault();
24    e.stopPropagation();
25    e.stopped = true;
26    // create dialog
27    w = window.open(npd_clicked_url, "", "width=753,height=400,resizable=no");
28    w.focus();
29}
30