fixed tab-switching javascript