better way to write document.location to search form