"function convertToId(search)\n" "{\n" " var result = '';\n" " for (i=0;i do a search\n" " {\n" " this.Search();\n" " }\n" " }\n" " else\n" " {\n" " this.Activate(false);\n" " }\n" " }\n" "\n" " this.OnCloseHighlight = function(active)\n" " {\n" " var close = this.DOMSearchResultWindowClose();\n" " if (active)\n" " {\n" " close.firstChild.src = this.resultsPath + '/close_active.png';\n" " }\n" " else\n" " {\n" " close.firstChild.src = this.resultsPath + '/close.png';\n" " }\n" " return false;\n" " }\n" "\n" " // --------- Actions\n" "\n" " // Closes the results window.\n" " this.CloseResultsWindow = function()\n" " {\n" " this.DOMPopupSearchResultsWindow().style.display = \"none\";\n" " this.Activate(false);\n" " }\n" "\n" " this.CloseSelectionWindow = function()\n" " {\n" " this.DOMSearchSelectWindow().style.display = \"none\";\n" " }\n" "\n" " // Performs a search.\n" " this.Search = function()\n" " {\n" " this.keyTimeout = 0;\n" "\n" " // strip leading whitespace\n" " var searchValue = this.DOMSearchField().value.replace(/^ +/, \"\");\n" "\n" " var code = searchValue.toLowerCase().charCodeAt(0);\n" " var hexCode;\n" " if (code<16) \n" " {\n" " hexCode=\"0\"+code.toString(16);\n" " }\n" " else \n" " {\n" " hexCode=code.toString(16);\n" " }\n" "\n" " var resultsPage;\n" " var resultsPageWithSearch;\n" " var hasResultsPage;\n" "\n" " // indexSectionsWithContent is defined in searchdata.js\n" " if (indexSectionsWithContent[this.searchTopic].charAt(code-32) == '1')\n" " {\n" " resultsPage = this.resultsPath + '/' + this.searchTopic + '_' + hexCode + '.html';\n" " resultsPageWithSearch = resultsPage+'?'+escape(searchValue);\n" " hasResultsPage = true;\n" " }\n" " else // nothing available for this search term\n" " {\n" " resultsPage = this.resultsPath + '/nomatches.html';\n" " resultsPageWithSearch = resultsPage;\n" " hasResultsPage = false;\n" " }\n" "\n" " window.frames.MSearchResults.location.href = resultsPageWithSearch; \n" " var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();\n" "\n" " if (domPopupSearchResultsWindow.style.display!=\"block\")\n" " {\n" " if (this.insideFrame)\n" " {\n" " var domSearchBox = this.DOMSearchBox();\n" " var domPopupSearchResults = this.DOMPopupSearchResults();\n" " this.DOMSearchResultWindowClose().style.textAlign = 'left';\n" " domPopupSearchResultsWindow.style.position = 'relative';\n" " domPopupSearchResultsWindow.style.display = 'block';\n" " var width = document.body.clientWidth - 8; // the -8 is for IE :-(\n" " domPopupSearchResultsWindow.style.width = width + 'px';\n" " domPopupSearchResults.style.width = width + 'px';\n" " }\n" " else\n" " {\n" " var domSearchField = this.DOMSearchField();\n" " var domPopupSearchResults = this.DOMPopupSearchResults();\n" " var left = getXPos(domSearchField) + domSearchField.offsetWidth;\n" " var top = getYPos(domSearchField) + domSearchField.offsetHeight + 1;\n" " domPopupSearchResultsWindow.style.display = 'block';\n" " left -= domPopupSearchResults.offsetWidth;\n" " domPopupSearchResultsWindow.style.top = top + 'px';\n" " domPopupSearchResultsWindow.style.left = left + 'px';\n" " }\n" " }\n" "\n" " this.lastSearchValue = searchValue;\n" " this.lastResultsPage = resultsPage;\n" " }\n" "\n" " // -------- Activation Functions\n" "\n" " // Activates or deactivates the search panel, resetting things to \n" " // their default values if necessary. \n" " this.Activate = function(isActive)\n" " {\n" " if (isActive || // open it\n" " this.DOMPopupSearchResultsWindow().style.display == 'block' \n" " )\n" " {\n" " this.DOMSearchBox().className = 'MSearchBoxActive';\n" "\n" " var searchField = this.DOMSearchField();\n" "\n" " if (searchField.value == 'Search') // clear \"Search\" term upon entry\n" " { \n" " searchField.value = ''; \n" " this.searchActive = true;\n" " }\n" " }\n" " else if (!isActive) // directly remove the panel\n" " {\n" " this.DOMSearchBox().className = 'MSearchBoxInactive';\n" " this.DOMSearchField().value = 'Search';\n" " this.searchActive = false;\n" " this.lastSearchValue = ''\n" " this.lastResultsPage = '';\n" " }\n" " }\n" "}\n" "\n" "// -----------------------------------------------------------------------\n" "\n" "// The class that handles everything on the search results page.\n" "function SearchResults(name)\n" "{\n" " // The number of matches from the last run of .\n" " this.lastMatchCount = 0;\n" "\n" " // Toggles the visibility of the passed element ID.\n" " this.Toggle = function(id)\n" " {\n" " var parentElement = document.getElementById(id);\n" " var element = parentElement.firstChild;\n" "\n" " while (element && element!=parentElement)\n" " {\n" " if (element.nodeName == 'DIV' && element.className == 'SRChildren')\n" " {\n" " if (element.style.display == 'block')\n" " { \n" " element.style.display = 'none'; \n" " }\n" " else\n" " { \n" " element.style.display = 'block'; \n" " }\n" " }\n" "\n" " if (element.nodeName == 'DIV' && element.hasChildNodes())\n" " { \n" " element = element.firstChild; \n" " }\n" " else if (element.nextSibling)\n" " { \n" " element = element.nextSibling; \n" " }\n" " else\n" " {\n" " do\n" " {\n" " element = element.parentNode;\n" " }\n" " while (element && element!=parentElement && !element.nextSibling);\n" "\n" " if (element && element!=parentElement)\n" " { \n" " element = element.nextSibling; \n" " }\n" " }\n" " }\n" " }\n" "\n" " // Searches for the passed string. If there is no parameter, \n" " // it takes it from the URL query.\n" " //\n" " // Always returns true, since other documents may try to call it \n" " // and that may or may not be possible.\n" " this.Search = function(search)\n" " {\n" " if (!search) // get search word from URL\n" " {\n" " search = window.location.search;\n" " search = search.substring(1); // Remove the leading '?'\n" " search = unescape(search);\n" " }\n" "\n" " search = search.replace(/^ +/, \"\"); // strip leading spaces\n" " search = search.replace(/ +$/, \"\"); // strip trailing spaces\n" " search = search.toLowerCase();\n" " search = convertToId(search);\n" "\n" " var resultRows = document.getElementsByTagName(\"div\");\n" " var matches = 0;\n" "\n" " var i = 0;\n" " while (i < resultRows.length)\n" " {\n" " var row = resultRows.item(i);\n" " if (row.className == \"SRResult\")\n" " {\n" " var rowMatchName = row.id.toLowerCase();\n" " rowMatchName = rowMatchName.replace(/^sr\\d*_/, ''); // strip 'sr123_'\n" "\n" " if (search.length<=rowMatchName.length && \n" " rowMatchName.substr(0, search.length)==search)\n" " {\n" " row.style.display = \"block\";\n" " matches++;\n" " }\n" " else\n" " { \n" " row.style.display = \"none\"; \n" " }\n" " }\n" " i++;\n" " }\n" " document.getElementById(\"Searching\").style.display=\"none\";\n" " if (matches == 0) // no results\n" " { \n" " document.getElementById(\"NoMatches\").style.display=\"block\"; \n" " }\n" " else // at least one result\n" " { \n" " document.getElementById(\"NoMatches\").style.display=\"none\"; \n" " }\n" " this.lastMatchCount = matches;\n" " return true;\n" " }\n" "}\n"