bHive does this really nicely and coming from an Actionscript background I found it quite easy to use, I had to look at the demos as the documentation isnt helpful!
To help you..
square = engine.createShape({
shape: 'square',
style: 'filled',
backgroundColor: '#000',
width: 120,
height: 20,
x: 20,
y: 100
});
To do any mouse actions you need to add it to a clip object.
clip = engine.createClip({ x: 20, y: 20 });
Then
clip.add(square);
add an event listener
clip.addEventListener('onmouseover',function(e) { some code ... });
clip.addEventListener('onclick',function(e) { some code ... });
In the loop you need to then draw the square.
clip.draw();
I'm using the source of the demos to help me through so maybe check out http://www.bhivecanvas.com/demos/cargame.php as that has rollovers and onclicks in it.