Searching in javascript/mac