Finished javascript for search results page