      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++)
                            {
                                document.getElementById(this.tabs[k].href.substr(this.tabs[k].href.indexOf('#') + 1)).style.displa