Where is my javascript error?

I am nesting tabs using the script. When I nest my tabs, I am getting the error as seen in the screen shot below. The error does not occur if I am not nesting my tabs. Can anyone help me diagnose my problem?

After my last post, I updated the script above to the following code and was able to elliminate two instances of the error message. I now only get the error when I click on the 'Database' tab. If I click on the 'Users' and 'Reports' tab, no error message appears.

I simply made the if statements into 'else if' statments. Any thoughts now? Maybe my naming conventions of the third tab?

Ok, I've read that. The only thing I can see that might be wrong is that all 3 "if" statements should have "!=-1" instead of "!=-2" or "!=-3". "-1" is the error return for the 'indexOf' not being found according to this page http://www.w3schools.com/jsref/jsref_indexOf.asp.