                      tab.style.display = 'none';
                        }
                    }
                    links[j].onclick = function()
                    {
                        var tab = document.getElementById(this.href.substr(this.href.indexOf('#') + 1));
                        if (tab)
                        {
                            //reset all tabs before change
                            for (var k = 0; k < this.tabs.length; k++)
                            {
                  