You should save the reference of setTimeout to be able to clear it:
var myTim1= setTimeout(api.next, 3000);
and not
setTimeout(api.next, 3000);
then
clearTimeout(myTim1);
On Doc Click Event:
document.onclick=function(){
clearTimeout(myTim1);
};
Or using jQuery:
$(document).click(function(){
clearTimeout(myTim1);
});