Is there a way to detect which mouse button is click on a link

i was thinking something like this <a onmousedown="(this.which==2)? call func: do nothing;"> link </a>

could somebody send me some code to do this

thanks