javascript fixes for #tab loading