javascript scroll + history fixes