10 0:
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101111111001101101111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
11 1:
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101101100001101001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
12 2:
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
13 3:
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001101000001100001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
14 4:
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101101111001101001111010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
15 5:
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101010101000001101110100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
31 for (
i=0;
i<search.length;
i++)
33 var c = search.charAt(
i);
34 var cn = c.charCodeAt(0);
35 if (c.match(/[
a-z0-9]/))
41 result+=
"_0"+cn.toString(16);
45 result+=
"_"+cn.toString(16);
56 while (item && item!=document.body)
59 item = item.offsetParent;
70 while (item && item!=document.body)
73 item = item.offsetParent;
86 function SearchBox(name, resultsPath, inFrame, label)
88 if (!name || !resultsPath) { alert(
"Missing parameters to SearchBox."); }
92 this.resultsPath = resultsPath;
94 this.keyTimeoutLength = 500;
95 this.closeSelectionTimeout = 300;
96 this.lastSearchValue =
"";
97 this.lastResultsPage =
"";
100 this.searchActive =
false;
101 this.insideFrame = inFrame;
102 this.searchLabel = label;
106 this.DOMSearchField =
function()
107 {
return document.getElementById(
"MSearchField"); }
109 this.DOMSearchSelect =
function()
110 {
return document.getElementById(
"MSearchSelect"); }
112 this.DOMSearchSelectWindow =
function()
113 {
return document.getElementById(
"MSearchSelectWindow"); }
115 this.DOMPopupSearchResults =
function()
116 {
return document.getElementById(
"MSearchResults"); }
118 this.DOMPopupSearchResultsWindow =
function()
119 {
return document.getElementById(
"MSearchResultsWindow"); }
121 this.DOMSearchClose =
function()
122 {
return document.getElementById(
"MSearchClose"); }
124 this.DOMSearchBox =
function()
125 {
return document.getElementById(
"MSearchBox"); }
130 this.OnSearchFieldFocus =
function(isActive)
132 this.Activate(isActive);
135 this.OnSearchSelectShow =
function()
137 var searchSelectWindow = this.DOMSearchSelectWindow();
138 var searchField = this.DOMSearchSelect();
140 if (this.insideFrame)
142 var left =
getXPos(searchField);
143 var top =
getYPos(searchField);
144 left += searchField.offsetWidth + 6;
145 top += searchField.offsetHeight;
148 searchSelectWindow.style.display=
'block';
149 left -= searchSelectWindow.offsetWidth;
150 searchSelectWindow.style.left = left +
'px';
151 searchSelectWindow.style.top = top +
'px';
155 var left =
getXPos(searchField);
156 var top =
getYPos(searchField);
157 top += searchField.offsetHeight;
160 searchSelectWindow.style.display=
'block';
161 searchSelectWindow.style.left = left +
'px';
162 searchSelectWindow.style.top = top +
'px';
166 if (this.hideTimeout)
168 clearTimeout(this.hideTimeout);
174 this.OnSearchSelectHide =
function()
176 this.hideTimeout = setTimeout(this.name +
".CloseSelectionWindow()",
177 this.closeSelectionTimeout);
181 this.OnSearchFieldChange =
function(evt)
185 clearTimeout(this.keyTimeout);
189 var e = (evt) ? evt : window.event;
190 if (e.keyCode==40 || e.keyCode==13)
194 this.OnSearchSelectShow();
195 var win=this.DOMSearchSelectWindow();
196 for (
i=0;
i<win.childNodes.length;
i++)
198 var child = win.childNodes[
i];
199 if (child.className==
'SelectItem')
207 else if (window.frames.MSearchResults.searchResults)
209 var elem = window.frames.MSearchResults.searchResults.NavNext(0);
210 if (elem) elem.focus();
213 else if (e.keyCode==27)
215 this.DOMSearchField().blur();
216 this.DOMPopupSearchResultsWindow().style.display =
'none';
217 this.DOMSearchClose().style.display =
'none';
218 this.lastSearchValue =
'';
219 this.Activate(
false);
224 var searchValue = this.DOMSearchField().value.replace(/ +/g,
"");
226 if (searchValue != this.lastSearchValue)
228 if (searchValue !=
"")
231 this.keyTimeout = setTimeout(this.name +
'.Search()',
232 this.keyTimeoutLength);
236 this.DOMPopupSearchResultsWindow().style.display =
'none';
237 this.DOMSearchClose().style.display =
'none';
238 this.lastSearchValue =
'';
243 this.SelectItemCount =
function(id)
246 var win=this.DOMSearchSelectWindow();
247 for (
i=0;
i<win.childNodes.length;
i++)
249 var child = win.childNodes[
i];
250 if (child.className==
'SelectItem')
258 this.SelectItemSet =
function(id)
261 var win=this.DOMSearchSelectWindow();
262 for (i=0;i<win.childNodes.length;i++)
264 var child = win.childNodes[
i];
265 if (child.className==
'SelectItem')
267 var node = child.firstChild;
270 node.innerHTML=
'•';
274 node.innerHTML=
' ';
283 this.OnSelectItem =
function(id)
285 this.searchIndex = id;
286 this.SelectItemSet(
id);
287 var searchValue = this.DOMSearchField().value.replace(/ +/g,
"");
288 if (searchValue!=
"" && this.searchActive)
294 this.OnSearchSelectKey =
function(evt)
296 var e = (evt) ? evt : window.event;
297 if (e.keyCode==40 &&
this.searchIndex<
this.SelectItemCount())
300 this.OnSelectItem(this.searchIndex);
302 else if (e.keyCode==38 &&
this.searchIndex>0)
305 this.OnSelectItem(this.searchIndex);
307 else if (e.keyCode==13 || e.keyCode==27)
309 this.OnSelectItem(this.searchIndex);
310 this.CloseSelectionWindow();
311 this.DOMSearchField().focus();
319 this.CloseResultsWindow =
function()
321 this.DOMPopupSearchResultsWindow().style.display =
'none';
322 this.DOMSearchClose().style.display =
'none';
323 this.Activate(
false);
326 this.CloseSelectionWindow =
function()
328 this.DOMSearchSelectWindow().style.display =
'none';
332 this.Search =
function()
337 var searchValue = this.DOMSearchField().value.replace(/^ +/,
"");
339 var code = searchValue.toLowerCase().charCodeAt(0);
343 hexCode=
"0"+code.toString(16);
347 hexCode=code.toString(16);
351 var resultsPageWithSearch;
356 resultsPage = this.resultsPath +
'/' +
indexSectionNames[this.searchIndex] +
'_' + hexCode +
'.html';
357 resultsPageWithSearch = resultsPage+
'?'+escape(searchValue);
358 hasResultsPage =
true;
362 resultsPage = this.resultsPath +
'/nomatches.html';
363 resultsPageWithSearch = resultsPage;
364 hasResultsPage =
false;
367 window.frames.MSearchResults.location = resultsPageWithSearch;
368 var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
370 if (domPopupSearchResultsWindow.style.display!=
'block')
372 var domSearchBox = this.DOMSearchBox();
373 this.DOMSearchClose().style.display =
'inline';
374 if (this.insideFrame)
376 var domPopupSearchResults = this.DOMPopupSearchResults();
377 domPopupSearchResultsWindow.style.position =
'relative';
378 domPopupSearchResultsWindow.style.display =
'block';
379 var width = document.body.clientWidth - 8;
380 domPopupSearchResultsWindow.style.width = width +
'px';
381 domPopupSearchResults.style.width = width +
'px';
385 var domPopupSearchResults = this.DOMPopupSearchResults();
386 var left =
getXPos(domSearchBox) + 150;
387 var top =
getYPos(domSearchBox) + 20;
388 domPopupSearchResultsWindow.style.display =
'block';
389 left -= domPopupSearchResults.offsetWidth;
390 domPopupSearchResultsWindow.style.top = top +
'px';
391 domPopupSearchResultsWindow.style.left = left +
'px';
395 this.lastSearchValue = searchValue;
396 this.lastResultsPage = resultsPage;
403 this.Activate =
function(isActive)
406 this.DOMPopupSearchResultsWindow().style.display ==
'block'
409 this.DOMSearchBox().className =
'MSearchBoxActive';
411 var searchField = this.DOMSearchField();
413 if (searchField.value ==
this.searchLabel)
415 searchField.value =
'';
416 this.searchActive =
true;
421 this.DOMSearchBox().className =
'MSearchBoxInactive';
422 this.DOMSearchField().value = this.searchLabel;
423 this.searchActive =
false;
424 this.lastSearchValue =
''
425 this.lastResultsPage =
'';
436 this.lastMatchCount = 0;
438 this.repeatOn =
false;
441 this.FindChildElement =
function(id)
443 var parentElement = document.getElementById(
id);
444 var element = parentElement.firstChild;
446 while (element && element!=parentElement)
448 if (element.nodeName ==
'DIV' && element.className ==
'SRChildren')
453 if (element.nodeName ==
'DIV' && element.hasChildNodes())
455 element = element.firstChild;
457 else if (element.nextSibling)
459 element = element.nextSibling;
465 element = element.parentNode;
467 while (element && element!=parentElement && !element.nextSibling);
469 if (element && element!=parentElement)
471 element = element.nextSibling;
477 this.Toggle =
function(id)
479 var element = this.FindChildElement(
id);
482 if (element.style.display ==
'block')
484 element.style.display =
'none';
488 element.style.display =
'block';
498 this.Search =
function(search)
502 search = window.location.search;
503 search = search.substring(1);
504 search = unescape(search);
507 search = search.replace(/^ +/,
"");
508 search = search.replace(/ +$/,
"");
509 search = search.toLowerCase();
512 var resultRows = document.getElementsByTagName(
"div");
516 while (i < resultRows.length)
518 var row = resultRows.item(i);
519 if (row.className ==
"SRResult")
521 var rowMatchName = row.id.toLowerCase();
522 rowMatchName = rowMatchName.replace(/^sr\d*_/,
'');
524 if (search.length<=rowMatchName.length &&
525 rowMatchName.substr(0, search.length)==search)
527 row.style.display =
'block';
532 row.style.display =
'none';
537 document.getElementById(
"Searching").style.display=
'none';
540 document.getElementById(
"NoMatches").style.display=
'block';
544 document.getElementById(
"NoMatches").style.display=
'none';
546 this.lastMatchCount = matches;
551 this.NavNext =
function(index)
556 var focusName =
'Item'+index;
557 focusItem = document.getElementById(focusName);
558 if (focusItem && focusItem.parentNode.parentNode.style.display==
'block')
572 this.NavPrev =
function(index)
577 var focusName =
'Item'+index;
578 focusItem = document.getElementById(focusName);
579 if (focusItem && focusItem.parentNode.parentNode.style.display==
'block')
593 this.ProcessKeys =
function(e)
595 if (e.type ==
"keydown")
597 this.repeatOn =
false;
598 this.lastKey = e.keyCode;
600 else if (e.type ==
"keypress")
604 if (this.lastKey) this.repeatOn =
true;
608 else if (e.type ==
"keyup")
611 this.repeatOn =
false;
613 return this.lastKey!=0;
616 this.Nav =
function(evt,itemIndex)
618 var e = (evt) ? evt : window.event;
619 if (e.keyCode==13)
return true;
620 if (!this.ProcessKeys(e))
return false;
622 if (this.lastKey==38)
624 var newIndex = itemIndex-1;
625 var focusItem = this.NavPrev(newIndex);
628 var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
629 if (child && child.style.display ==
'block')
635 tmpElem = document.getElementById(
'Item'+newIndex+
'_c'+n);
654 parent.document.getElementById(
"MSearchField").focus();
657 else if (this.lastKey==40)
659 var newIndex = itemIndex+1;
661 var item = document.getElementById(
'Item'+itemIndex);
662 var elem = this.FindChildElement(item.parentNode.parentNode.id);
663 if (elem && elem.style.display ==
'block')
665 focusItem = document.getElementById(
'Item'+itemIndex+
'_c0');
667 if (!focusItem) focusItem = this.NavNext(newIndex);
668 if (focusItem) focusItem.focus();
670 else if (this.lastKey==39)
672 var item = document.getElementById(
'Item'+itemIndex);
673 var elem = this.FindChildElement(item.parentNode.parentNode.id);
674 if (elem) elem.style.display =
'block';
676 else if (this.lastKey==37)
678 var item = document.getElementById(
'Item'+itemIndex);
679 var elem = this.FindChildElement(item.parentNode.parentNode.id);
680 if (elem) elem.style.display =
'none';
682 else if (this.lastKey==27)
684 parent.searchBox.CloseResultsWindow();
685 parent.document.getElementById(
"MSearchField").focus();
687 else if (this.lastKey==13)
694 this.NavChild =
function(evt,itemIndex,childIndex)
696 var e = (evt) ? evt : window.event;
697 if (e.keyCode==13)
return true;
698 if (!this.ProcessKeys(e))
return false;
700 if (this.lastKey==38)
704 var newIndex = childIndex-1;
705 document.getElementById(
'Item'+itemIndex+
'_c'+newIndex).focus();
709 document.getElementById(
'Item'+itemIndex).focus();
712 else if (this.lastKey==40)
714 var newIndex = childIndex+1;
715 var elem = document.getElementById(
'Item'+itemIndex+
'_c'+newIndex);
718 elem = this.NavNext(itemIndex+1);
725 else if (this.lastKey==27)
727 parent.searchBox.CloseResultsWindow();
728 parent.document.getElementById(
"MSearchField").focus();
730 else if (this.lastKey==13)
740 elem.setAttribute(
'onkeydown',action);
741 elem.setAttribute(
'onkeypress',action);
742 elem.setAttribute(
'onkeyup',action);
747 elem.setAttribute(
'class',attr);
748 elem.setAttribute(
'className',attr);
753 var results = document.getElementById(
"SRResults");
757 var srResult = document.createElement(
'div');
758 srResult.setAttribute(
'id',
'SR_'+
id);
760 var srEntry = document.createElement(
'div');
762 var srLink = document.createElement(
'a');
763 srLink.setAttribute(
'id',
'Item'+e);
764 setKeyActions(srLink,
'return searchResults.Nav(event,'+e+
')');
767 srEntry.appendChild(srLink);
770 srLink.setAttribute(
'href',
searchData[e][1][1][0]);
773 srLink.setAttribute(
'target',
'_parent');
775 var srScope = document.createElement(
'span');
778 srEntry.appendChild(srScope);
782 srLink.setAttribute(
'href',
'javascript:searchResults.Toggle("SR_'+
id+
'")');
783 var srChildren = document.createElement(
'div');
785 for (var c=0; c<
searchData[e][1].length-1; c++)
787 var srChild = document.createElement(
'a');
788 srChild.setAttribute(
'id',
'Item'+e+
'_c'+c);
789 setKeyActions(srChild,
'return searchResults.NavChild(event,'+e+
','+c+
')');
791 srChild.setAttribute(
'href',
searchData[e][1][c+1][0]);
794 srChild.setAttribute(
'target',
'_parent');
797 srChildren.appendChild(srChild);
799 srEntry.appendChild(srChildren);
801 srResult.appendChild(srEntry);
802 results.appendChild(srResult);