some basic javascript to make search a bit smoother