js for tab navigation to accommodate new tab