Your script is actually working correctly. The problem is that as written, the alert will only be fired if you click in the actual div. Try it, you will see it work. Click in the white space next to the tabs and you will see the alert.
What you actually need to do is set the click function to fire on the .TabbedPanelsTab
class, since that will fire when a user clicks on the actual tabs.
$(document).on("click",".TabbedPanelsTab",function (event){
alert("in");
});
Also, I would suggest using the tabs
widget that already exists in jquery UI instead of rolling your own.