VERB_code_2.3
search.js
1 // Search script generated by doxygen
2 // Copyright (C) 2009 by Dimitri van Heesch.
3 
4 // The code in this file is loosly based on main.js, part of Natural Docs,
5 // which is Copyright (C) 2003-2008 Greg Valure
6 // Natural Docs is licensed under the GPL.
7 
8 var indexSectionsWithContent =
9 {
10  0: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010111111101111111111111111110001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
11  1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111110101001100100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
12  2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
13  3: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110110100001101101100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
14  4: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111101111111111111111110001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
15  5: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111101111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
16  6: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
17  7: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000111001001101100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
18  8: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
19 };
20 
21 var indexSectionNames =
22 {
23  0: "all",
24  1: "classes",
25  2: "namespaces",
26  3: "files",
27  4: "functions",
28  5: "variables",
29  6: "typedefs",
30  7: "defines",
31  8: "pages"
32 };
33 
34 function convertToId(search)
35 {
36  var result = '';
37  for (i=0;i<search.length;i++)
38  {
39  var c = search.charAt(i);
40  var cn = c.charCodeAt(0);
41  if (c.match(/[a-z0-9]/))
42  {
43  result+=c;
44  }
45  else if (cn<16)
46  {
47  result+="_0"+cn.toString(16);
48  }
49  else
50  {
51  result+="_"+cn.toString(16);
52  }
53  }
54  return result;
55 }
56 
57 function getXPos(item)
58 {
59  var x = 0;
60  if (item.offsetWidth)
61  {
62  while (item && item!=document.body)
63  {
64  x += item.offsetLeft;
65  item = item.offsetParent;
66  }
67  }
68  return x;
69 }
70 
71 function getYPos(item)
72 {
73  var y = 0;
74  if (item.offsetWidth)
75  {
76  while (item && item!=document.body)
77  {
78  y += item.offsetTop;
79  item = item.offsetParent;
80  }
81  }
82  return y;
83 }
84 
85 /* A class handling everything associated with the search panel.
86 
87  Parameters:
88  name - The name of the global variable that will be
89  storing this instance. Is needed to be able to set timeouts.
90  resultPath - path to use for external files
91 */
92 function SearchBox(name, resultsPath, inFrame, label)
93 {
94  if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
95 
96  // ---------- Instance variables
97  this.name = name;
98  this.resultsPath = resultsPath;
99  this.keyTimeout = 0;
100  this.keyTimeoutLength = 500;
101  this.closeSelectionTimeout = 300;
102  this.lastSearchValue = "";
103  this.lastResultsPage = "";
104  this.hideTimeout = 0;
105  this.searchIndex = 0;
106  this.searchActive = false;
107  this.insideFrame = inFrame;
108  this.searchLabel = label;
109 
110  // ----------- DOM Elements
111 
112  this.DOMSearchField = function()
113  { return document.getElementById("MSearchField"); }
114 
115  this.DOMSearchSelect = function()
116  { return document.getElementById("MSearchSelect"); }
117 
118  this.DOMSearchSelectWindow = function()
119  { return document.getElementById("MSearchSelectWindow"); }
120 
121  this.DOMPopupSearchResults = function()
122  { return document.getElementById("MSearchResults"); }
123 
124  this.DOMPopupSearchResultsWindow = function()
125  { return document.getElementById("MSearchResultsWindow"); }
126 
127  this.DOMSearchClose = function()
128  { return document.getElementById("MSearchClose"); }
129 
130  this.DOMSearchBox = function()
131  { return document.getElementById("MSearchBox"); }
132 
133  // ------------ Event Handlers
134 
135  // Called when focus is added or removed from the search field.
136  this.OnSearchFieldFocus = function(isActive)
137  {
138  this.Activate(isActive);
139  }
140 
141  this.OnSearchSelectShow = function()
142  {
143  var searchSelectWindow = this.DOMSearchSelectWindow();
144  var searchField = this.DOMSearchSelect();
145 
146  if (this.insideFrame)
147  {
148  var left = getXPos(searchField);
149  var top = getYPos(searchField);
150  left += searchField.offsetWidth + 6;
151  top += searchField.offsetHeight;
152 
153  // show search selection popup
154  searchSelectWindow.style.display='block';
155  left -= searchSelectWindow.offsetWidth;
156  searchSelectWindow.style.left = left + 'px';
157  searchSelectWindow.style.top = top + 'px';
158  }
159  else
160  {
161  var left = getXPos(searchField);
162  var top = getYPos(searchField);
163  top += searchField.offsetHeight;
164 
165  // show search selection popup
166  searchSelectWindow.style.display='block';
167  searchSelectWindow.style.left = left + 'px';
168  searchSelectWindow.style.top = top + 'px';
169  }
170 
171  // stop selection hide timer
172  if (this.hideTimeout)
173  {
174  clearTimeout(this.hideTimeout);
175  this.hideTimeout=0;
176  }
177  return false; // to avoid "image drag" default event
178  }
179 
180  this.OnSearchSelectHide = function()
181  {
182  this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()",
183  this.closeSelectionTimeout);
184  }
185 
186  // Called when the content of the search field is changed.
187  this.OnSearchFieldChange = function(evt)
188  {
189  if (this.keyTimeout) // kill running timer
190  {
191  clearTimeout(this.keyTimeout);
192  this.keyTimeout = 0;
193  }
194 
195  var e = (evt) ? evt : window.event; // for IE
196  if (e.keyCode==40 || e.keyCode==13)
197  {
198  if (e.shiftKey==1)
199  {
200  this.OnSearchSelectShow();
201  var win=this.DOMSearchSelectWindow();
202  for (i=0;i<win.childNodes.length;i++)
203  {
204  var child = win.childNodes[i]; // get span within a
205  if (child.className=='SelectItem')
206  {
207  child.focus();
208  return;
209  }
210  }
211  return;
212  }
213  else if (window.frames.MSearchResults.searchResults)
214  {
215  var elem = window.frames.MSearchResults.searchResults.NavNext(0);
216  if (elem) elem.focus();
217  }
218  }
219  else if (e.keyCode==27) // Escape out of the search field
220  {
221  this.DOMSearchField().blur();
222  this.DOMPopupSearchResultsWindow().style.display = 'none';
223  this.DOMSearchClose().style.display = 'none';
224  this.lastSearchValue = '';
225  this.Activate(false);
226  return;
227  }
228 
229  // strip whitespaces
230  var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
231 
232  if (searchValue != this.lastSearchValue) // search value has changed
233  {
234  if (searchValue != "") // non-empty search
235  {
236  // set timer for search update
237  this.keyTimeout = setTimeout(this.name + '.Search()',
238  this.keyTimeoutLength);
239  }
240  else // empty search field
241  {
242  this.DOMPopupSearchResultsWindow().style.display = 'none';
243  this.DOMSearchClose().style.display = 'none';
244  this.lastSearchValue = '';
245  }
246  }
247  }
248 
249  this.SelectItemCount = function(id)
250  {
251  var count=0;
252  var win=this.DOMSearchSelectWindow();
253  for (i=0;i<win.childNodes.length;i++)
254  {
255  var child = win.childNodes[i]; // get span within a
256  if (child.className=='SelectItem')
257  {
258  count++;
259  }
260  }
261  return count;
262  }
263 
264  this.SelectItemSet = function(id)
265  {
266  var i,j=0;
267  var win=this.DOMSearchSelectWindow();
268  for (i=0;i<win.childNodes.length;i++)
269  {
270  var child = win.childNodes[i]; // get span within a
271  if (child.className=='SelectItem')
272  {
273  var node = child.firstChild;
274  if (j==id)
275  {
276  node.innerHTML='&#8226;';
277  }
278  else
279  {
280  node.innerHTML='&#160;';
281  }
282  j++;
283  }
284  }
285  }
286 
287  // Called when an search filter selection is made.
288  // set item with index id as the active item
289  this.OnSelectItem = function(id)
290  {
291  this.searchIndex = id;
292  this.SelectItemSet(id);
293  var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
294  if (searchValue!="" && this.searchActive) // something was found -> do a search
295  {
296  this.Search();
297  }
298  }
299 
300  this.OnSearchSelectKey = function(evt)
301  {
302  var e = (evt) ? evt : window.event; // for IE
303  if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
304  {
305  this.searchIndex++;
306  this.OnSelectItem(this.searchIndex);
307  }
308  else if (e.keyCode==38 && this.searchIndex>0) // Up
309  {
310  this.searchIndex--;
311  this.OnSelectItem(this.searchIndex);
312  }
313  else if (e.keyCode==13 || e.keyCode==27)
314  {
315  this.OnSelectItem(this.searchIndex);
316  this.CloseSelectionWindow();
317  this.DOMSearchField().focus();
318  }
319  return false;
320  }
321 
322  // --------- Actions
323 
324  // Closes the results window.
325  this.CloseResultsWindow = function()
326  {
327  this.DOMPopupSearchResultsWindow().style.display = 'none';
328  this.DOMSearchClose().style.display = 'none';
329  this.Activate(false);
330  }
331 
332  this.CloseSelectionWindow = function()
333  {
334  this.DOMSearchSelectWindow().style.display = 'none';
335  }
336 
337  // Performs a search.
338  this.Search = function()
339  {
340  this.keyTimeout = 0;
341 
342  // strip leading whitespace
343  var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
344 
345  var code = searchValue.toLowerCase().charCodeAt(0);
346  var hexCode;
347  if (code<16)
348  {
349  hexCode="0"+code.toString(16);
350  }
351  else
352  {
353  hexCode=code.toString(16);
354  }
355 
356  var resultsPage;
357  var resultsPageWithSearch;
358  var hasResultsPage;
359 
360  if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')
361  {
362  resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
363  resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
364  hasResultsPage = true;
365  }
366  else // nothing available for this search term
367  {
368  resultsPage = this.resultsPath + '/nomatches.html';
369  resultsPageWithSearch = resultsPage;
370  hasResultsPage = false;
371  }
372 
373  window.frames.MSearchResults.location = resultsPageWithSearch;
374  var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
375 
376  if (domPopupSearchResultsWindow.style.display!='block')
377  {
378  var domSearchBox = this.DOMSearchBox();
379  this.DOMSearchClose().style.display = 'inline';
380  if (this.insideFrame)
381  {
382  var domPopupSearchResults = this.DOMPopupSearchResults();
383  domPopupSearchResultsWindow.style.position = 'relative';
384  domPopupSearchResultsWindow.style.display = 'block';
385  var width = document.body.clientWidth - 8; // the -8 is for IE :-(
386  domPopupSearchResultsWindow.style.width = width + 'px';
387  domPopupSearchResults.style.width = width + 'px';
388  }
389  else
390  {
391  var domPopupSearchResults = this.DOMPopupSearchResults();
392  var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
393  var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
394  domPopupSearchResultsWindow.style.display = 'block';
395  left -= domPopupSearchResults.offsetWidth;
396  domPopupSearchResultsWindow.style.top = top + 'px';
397  domPopupSearchResultsWindow.style.left = left + 'px';
398  }
399  }
400 
401  this.lastSearchValue = searchValue;
402  this.lastResultsPage = resultsPage;
403  }
404 
405  // -------- Activation Functions
406 
407  // Activates or deactivates the search panel, resetting things to
408  // their default values if necessary.
409  this.Activate = function(isActive)
410  {
411  if (isActive || // open it
412  this.DOMPopupSearchResultsWindow().style.display == 'block'
413  )
414  {
415  this.DOMSearchBox().className = 'MSearchBoxActive';
416 
417  var searchField = this.DOMSearchField();
418 
419  if (searchField.value == this.searchLabel) // clear "Search" term upon entry
420  {
421  searchField.value = '';
422  this.searchActive = true;
423  }
424  }
425  else if (!isActive) // directly remove the panel
426  {
427  this.DOMSearchBox().className = 'MSearchBoxInactive';
428  this.DOMSearchField().value = this.searchLabel;
429  this.searchActive = false;
430  this.lastSearchValue = ''
431  this.lastResultsPage = '';
432  }
433  }
434 }
435 
436 // -----------------------------------------------------------------------
437 
438 // The class that handles everything on the search results page.
439 function SearchResults(name)
440 {
441  // The number of matches from the last run of <Search()>.
442  this.lastMatchCount = 0;
443  this.lastKey = 0;
444  this.repeatOn = false;
445 
446  // Toggles the visibility of the passed element ID.
447  this.FindChildElement = function(id)
448  {
449  var parentElement = document.getElementById(id);
450  var element = parentElement.firstChild;
451 
452  while (element && element!=parentElement)
453  {
454  if (element.nodeName == 'DIV' && element.className == 'SRChildren')
455  {
456  return element;
457  }
458 
459  if (element.nodeName == 'DIV' && element.hasChildNodes())
460  {
461  element = element.firstChild;
462  }
463  else if (element.nextSibling)
464  {
465  element = element.nextSibling;
466  }
467  else
468  {
469  do
470  {
471  element = element.parentNode;
472  }
473  while (element && element!=parentElement && !element.nextSibling);
474 
475  if (element && element!=parentElement)
476  {
477  element = element.nextSibling;
478  }
479  }
480  }
481  }
482 
483  this.Toggle = function(id)
484  {
485  var element = this.FindChildElement(id);
486  if (element)
487  {
488  if (element.style.display == 'block')
489  {
490  element.style.display = 'none';
491  }
492  else
493  {
494  element.style.display = 'block';
495  }
496  }
497  }
498 
499  // Searches for the passed string. If there is no parameter,
500  // it takes it from the URL query.
501  //
502  // Always returns true, since other documents may try to call it
503  // and that may or may not be possible.
504  this.Search = function(search)
505  {
506  if (!search) // get search word from URL
507  {
508  search = window.location.search;
509  search = search.substring(1); // Remove the leading '?'
510  search = unescape(search);
511  }
512 
513  search = search.replace(/^ +/, ""); // strip leading spaces
514  search = search.replace(/ +$/, ""); // strip trailing spaces
515  search = search.toLowerCase();
516  search = convertToId(search);
517 
518  var resultRows = document.getElementsByTagName("div");
519  var matches = 0;
520 
521  var i = 0;
522  while (i < resultRows.length)
523  {
524  var row = resultRows.item(i);
525  if (row.className == "SRResult")
526  {
527  var rowMatchName = row.id.toLowerCase();
528  rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
529 
530  if (search.length<=rowMatchName.length &&
531  rowMatchName.substr(0, search.length)==search)
532  {
533  row.style.display = 'block';
534  matches++;
535  }
536  else
537  {
538  row.style.display = 'none';
539  }
540  }
541  i++;
542  }
543  document.getElementById("Searching").style.display='none';
544  if (matches == 0) // no results
545  {
546  document.getElementById("NoMatches").style.display='block';
547  }
548  else // at least one result
549  {
550  document.getElementById("NoMatches").style.display='none';
551  }
552  this.lastMatchCount = matches;
553  return true;
554  }
555 
556  // return the first item with index index or higher that is visible
557  this.NavNext = function(index)
558  {
559  var focusItem;
560  while (1)
561  {
562  var focusName = 'Item'+index;
563  focusItem = document.getElementById(focusName);
564  if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
565  {
566  break;
567  }
568  else if (!focusItem) // last element
569  {
570  break;
571  }
572  focusItem=null;
573  index++;
574  }
575  return focusItem;
576  }
577 
578  this.NavPrev = function(index)
579  {
580  var focusItem;
581  while (1)
582  {
583  var focusName = 'Item'+index;
584  focusItem = document.getElementById(focusName);
585  if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
586  {
587  break;
588  }
589  else if (!focusItem) // last element
590  {
591  break;
592  }
593  focusItem=null;
594  index--;
595  }
596  return focusItem;
597  }
598 
599  this.ProcessKeys = function(e)
600  {
601  if (e.type == "keydown")
602  {
603  this.repeatOn = false;
604  this.lastKey = e.keyCode;
605  }
606  else if (e.type == "keypress")
607  {
608  if (!this.repeatOn)
609  {
610  if (this.lastKey) this.repeatOn = true;
611  return false; // ignore first keypress after keydown
612  }
613  }
614  else if (e.type == "keyup")
615  {
616  this.lastKey = 0;
617  this.repeatOn = false;
618  }
619  return this.lastKey!=0;
620  }
621 
622  this.Nav = function(evt,itemIndex)
623  {
624  var e = (evt) ? evt : window.event; // for IE
625  if (e.keyCode==13) return true;
626  if (!this.ProcessKeys(e)) return false;
627 
628  if (this.lastKey==38) // Up
629  {
630  var newIndex = itemIndex-1;
631  var focusItem = this.NavPrev(newIndex);
632  if (focusItem)
633  {
634  var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
635  if (child && child.style.display == 'block') // children visible
636  {
637  var n=0;
638  var tmpElem;
639  while (1) // search for last child
640  {
641  tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
642  if (tmpElem)
643  {
644  focusItem = tmpElem;
645  }
646  else // found it!
647  {
648  break;
649  }
650  n++;
651  }
652  }
653  }
654  if (focusItem)
655  {
656  focusItem.focus();
657  }
658  else // return focus to search field
659  {
660  parent.document.getElementById("MSearchField").focus();
661  }
662  }
663  else if (this.lastKey==40) // Down
664  {
665  var newIndex = itemIndex+1;
666  var focusItem;
667  var item = document.getElementById('Item'+itemIndex);
668  var elem = this.FindChildElement(item.parentNode.parentNode.id);
669  if (elem && elem.style.display == 'block') // children visible
670  {
671  focusItem = document.getElementById('Item'+itemIndex+'_c0');
672  }
673  if (!focusItem) focusItem = this.NavNext(newIndex);
674  if (focusItem) focusItem.focus();
675  }
676  else if (this.lastKey==39) // Right
677  {
678  var item = document.getElementById('Item'+itemIndex);
679  var elem = this.FindChildElement(item.parentNode.parentNode.id);
680  if (elem) elem.style.display = 'block';
681  }
682  else if (this.lastKey==37) // Left
683  {
684  var item = document.getElementById('Item'+itemIndex);
685  var elem = this.FindChildElement(item.parentNode.parentNode.id);
686  if (elem) elem.style.display = 'none';
687  }
688  else if (this.lastKey==27) // Escape
689  {
690  parent.searchBox.CloseResultsWindow();
691  parent.document.getElementById("MSearchField").focus();
692  }
693  else if (this.lastKey==13) // Enter
694  {
695  return true;
696  }
697  return false;
698  }
699 
700  this.NavChild = function(evt,itemIndex,childIndex)
701  {
702  var e = (evt) ? evt : window.event; // for IE
703  if (e.keyCode==13) return true;
704  if (!this.ProcessKeys(e)) return false;
705 
706  if (this.lastKey==38) // Up
707  {
708  if (childIndex>0)
709  {
710  var newIndex = childIndex-1;
711  document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
712  }
713  else // already at first child, jump to parent
714  {
715  document.getElementById('Item'+itemIndex).focus();
716  }
717  }
718  else if (this.lastKey==40) // Down
719  {
720  var newIndex = childIndex+1;
721  var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
722  if (!elem) // last child, jump to parent next parent
723  {
724  elem = this.NavNext(itemIndex+1);
725  }
726  if (elem)
727  {
728  elem.focus();
729  }
730  }
731  else if (this.lastKey==27) // Escape
732  {
733  parent.searchBox.CloseResultsWindow();
734  parent.document.getElementById("MSearchField").focus();
735  }
736  else if (this.lastKey==13) // Enter
737  {
738  return true;
739  }
740  return false;
741  }
742 }
743 
744 function setKeyActions(elem,action)
745 {
746  elem.setAttribute('onkeydown',action);
747  elem.setAttribute('onkeypress',action);
748  elem.setAttribute('onkeyup',action);
749 }
750 
751 function setClassAttr(elem,attr)
752 {
753  elem.setAttribute('class',attr);
754  elem.setAttribute('className',attr);
755 }
756 
757 function createResults()
758 {
759  var results = document.getElementById("SRResults");
760  for (var e=0; e<searchData.length; e++)
761  {
762  var id = searchData[e][0];
763  var srResult = document.createElement('div');
764  srResult.setAttribute('id','SR_'+id);
765  setClassAttr(srResult,'SRResult');
766  var srEntry = document.createElement('div');
767  setClassAttr(srEntry,'SREntry');
768  var srLink = document.createElement('a');
769  srLink.setAttribute('id','Item'+e);
770  setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
771  setClassAttr(srLink,'SRSymbol');
772  srLink.innerHTML = searchData[e][1][0];
773  srEntry.appendChild(srLink);
774  if (searchData[e][1].length==2) // single result
775  {
776  srLink.setAttribute('href',searchData[e][1][1][0]);
777  if (searchData[e][1][1][1])
778  {
779  srLink.setAttribute('target','_parent');
780  }
781  var srScope = document.createElement('span');
782  setClassAttr(srScope,'SRScope');
783  srScope.innerHTML = searchData[e][1][1][2];
784  srEntry.appendChild(srScope);
785  }
786  else // multiple results
787  {
788  srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
789  var srChildren = document.createElement('div');
790  setClassAttr(srChildren,'SRChildren');
791  for (var c=0; c<searchData[e][1].length-1; c++)
792  {
793  var srChild = document.createElement('a');
794  srChild.setAttribute('id','Item'+e+'_c'+c);
795  setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
796  setClassAttr(srChild,'SRScope');
797  srChild.setAttribute('href',searchData[e][1][c+1][0]);
798  if (searchData[e][1][c+1][1])
799  {
800  srChild.setAttribute('target','_parent');
801  }
802  srChild.innerHTML = searchData[e][1][c+1][2];
803  srChildren.appendChild(srChild);
804  }
805  srEntry.appendChild(srChildren);
806  }
807  srResult.appendChild(srEntry);
808  results.appendChild(srResult);
809  }
810 }
811