platform/browser independent code for searching a book