Hi,
The add to cart button is displayed by the file "quantity" of the view "product" that you can edit via the menu Display>Views.
There you'll have several that line of code which calls the button display function:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
The $this->ajax variable contains the javascript code of the onclick trigger. If in that javascript you have a return false, it won't do the add to cart. And you can add any javascript in it. I recommend to first dump the content of the variable to see what's in it (it changes based on the options, etc) so that you can add your own javascript without breaking the add to cart function call.