A: 

My javascript is rusty, so forgive the syntax errors:

// A global variable to hold the currently active tab
var activeTab;

window.uicontrols.createTabBarItem("tab2", "Tab 2", "icon2.png", {
  onSelect: function() {
    myName = "#tab2"
    if (activeTab != myName)
    {
        jQT.goTo(myName, "slide");
        activeTab = myName;
    }
  }
});

Or if you can modify the function "jQT.goTo", you could put this logic there to prevent going to a place multiple times

To prevent the tab from being clicked, you could set the "disabled" attribute on it, or come up with some other visual cue that clicking on it won't do anything

RyanHennig
Thank you! The only part i had trouble with was the jQT.goTo(activeTab, "slide"); line. Which only worked when i specified it directly. eg. jQT.goTo("#tab2", "slide");
Nelga
whoops, that should have been "myName" instead of "activeTab". I fixed the answer. BTW, its good programming practice to use variables or constants instead of "magic" literals like "#tab2". Especially if you use it more than once; this protects you from typos etc. See also the "DRY principle"
RyanHennig