confirn in link on overlay lists I create in administration list of some content and create link delete. On link delete I add attribute

onclick="return confirm('Are you sure?);"


but when you click "cancel" on confirm block drupal still go to link href:

http://www.supermarket.hr/#overlay=admin/categories/delete/6939/0


How can I anticipate some hidden overlay functions that ignore added confirm?

thx
Some code:

$option_delete = array(
        'attributes' =&gt; array(
            'onclick' =&gt; "return confirm('Delete order?');",
            'class' =&gt; "delete"
        )
    );


link:

l('delete', 'admin/orders/categories/'.$node-&gt;id.'/'.$page, $option_delete),


this link is showing up in list on administration overlay.