Ibox - trouble adding an onclick event

I’m using the ibox javascript library which is very similar to lightbox in functionality. I’m trying to do something seemingly simple but am having difficulty.

My goal:
Use ibox to show a dynamic graph based on a clicked link.

When the user clicks the link it will grab data from the current table row, format it, and render it using the flot library. This will all be done in a hidden div. This is easy enough. Then the hidden div will be displayed using ibox.

These are both easy enough tasks individually. What i’m having trouble with is combining them into a single click.

Currently I have it setup like this.
[HIGHLIGHT=““Html”]<a href=”#graphContainer" onclick=“loadGraph()” rel=“ibox” title=“Loading Internal HTML Content” >Graph</a>

When a user clicks this link the loadGraph() function never executes.  I'm assuming this is because priority is being given to ibox (indicated by the rel attribute).  How can I force my onclick event to be executed before the ibox is loaded?

I would even be ok if it was executed after the ibox was loaded, my main goal is to get both actions to occur in a single click.

Thanks for your help, let me know if you need more code.

In attempt to get this to work I’ve made two changes.

First I modified the iBox library to account for previouslly set onclick events.

I changed:

els[i].onclick =  _pub.handleTag;			


var a = els[i].onclick;
els[i].onclick = a + _pub.handleTag;			

I then updated my html with an onclick=“loadGraph();”.

This concatenates the two onclick events togeather. However, I’m not sure it is syntactically correct. This is not currently working. Below is the printout of the onclick event for the element.

function onclick(event) {
}function (e) {
    var t = this.getAttribute("rel");
    var params = _pub.parseQuery(t.substr(5, 999));
    if (params.target) {
        var url = params.target;
    } else if (this.target && !params.ignore_target) {
        var url = this.target;
    } else {
        var url = this.href;
    var title = this.title;
    if (_pub.inherit_frames && window.parent) {
        window.parent.iBox.showURL(url, title, params);
    } else {
        _pub.showURL(url, title, params);
    return false;

The two functions don’t look syntactically correct to me, but I’m not sure how to fix it. What can I do to get this working?