Two toolbars and event handling

I have two toolbars on my page.

Both of them have atatched onlick event and bind to one method


function HandleOnClik(id){
//some code
}

 toolbar1.attachEvent("onClick", HandleOnClik);
 toolbar2.attachEvent("onClick", HandleOnClik);

The problem is when the HandleOnClik is called I don’t from which toolbar it gets called.

Is there any way to pass the sender reference or any other way ?

You may use this inside event handler to toolbar that gets called.

function HandleOnClik(id){
alert(this.getItemText(id));
}