Fist Click Event Not Working

In my CAF portlet I have an Image Control that has Java Script associated with a Click event. It works fine except for the first click. Every time the portlet is refreshed the click event does not execute on the first click but will for all successive clicks.

Is this a quirk with CAF or am I doing something wrong?