javascript search function WIP