home *** CD-ROM | disk | FTP | other *** search
/ Kazoku Keikaku / kazoku_g.img / directx.cab / dxdiacht.chm / langref.js < prev    next >
Text File  |  1999-09-09  |  19KB  |  794 lines

  1. //
  2. // Common code
  3. //
  4. var ie4 = false;
  5. var advanced = false;
  6. var curLang = null;
  7. var showAll = true;
  8. var cook = null;
  9. var baseUrl = document.scripts[document.scripts.length - 1].src.replace(/[^\/]+.js/, "");
  10.  
  11. if (navigator.appName == "Microsoft Internet Explorer") {
  12.     var ver = navigator.appVersion;
  13.     var v = new Number(ver.substring(0,ver.indexOf(".", 0)));
  14.     if (v >= 4) {
  15.         advanced = true;
  16.         ie4 = true;
  17.  
  18.         // Look for 5.x buried somewhere in the version string.
  19.         var toks = ver.split(/[^0-9.]/);
  20.         if (toks) {
  21.             for (var i = 0; i < toks.length; i++) {
  22.                 var tok = toks[i];
  23.                 if (tok.indexOf(".", 0) > 0) {
  24.                     if (tok >= 5)
  25.                         ie4 = false;
  26.                 }
  27.             }
  28.         }
  29.     }
  30. }
  31.  
  32. if (advanced)
  33.     window.onload = bodyOnLoad;
  34.  
  35. function bodyOnClick()
  36. {
  37.     if (advanced) {
  38.         hideTip();
  39.         closeMenu();
  40.         hideSeeAlso();
  41.     }
  42. }
  43.  
  44. function bodyOnLoad()
  45. {
  46.     if (advanced) {
  47.         initLangs();
  48.         initReftips();
  49.         initSeeAlso();
  50.         document.body.onclick = bodyOnClick;
  51.     }
  52. }
  53.  
  54. //
  55. // Language filtering
  56. //
  57. function initLangs()
  58. {
  59.     var hdr = document.all.hdr;
  60.     if (!hdr)
  61.         return;
  62.  
  63.     var langs = new Array;
  64.     var spans = document.all.tags("SPAN");
  65.     if (spans) {
  66.         var iElem = spans.length;
  67.         for (iElem = 0; iElem < spans.length; iElem++) {
  68.             var elem = spans[iElem];
  69.             if (elem.className == "lang") {
  70.  
  71.                 // Update the array of unique language names.
  72.                 var a = elem.innerText.split(",");
  73.                 for (var iTok = 0; iTok < a.length; iTok++) {
  74.                     var m = a[iTok].match(/([A-Za-z].*[A-Za-z+])/);
  75.                     if (m) {
  76.                         var iLang = 0;
  77.                         while (iLang < langs.length && langs[iLang] < m[1])
  78.                             iLang++;
  79.                         if (iLang == langs.length || langs[iLang] != m[1]) {
  80.                             var before = langs.slice(0,iLang);
  81.                             var after = langs.slice(iLang);
  82.                             langs = before.concat(m[1]).concat(after);
  83.                         }
  84.                     }
  85.                 }
  86.             }
  87.         }
  88.     }
  89.  
  90.     if (langs.length > 0) {
  91.         var pres = document.all.tags("PRE");
  92.         if (pres) {
  93.             for (var iPre = 0; iPre < pres.length; iPre++)
  94.                 initPreElem(pres[iPre]);
  95.         }
  96.  
  97.         var obj = document.all.obj_cook;
  98.         if (obj && obj.object) {
  99.             cook = obj;
  100.             var lang = obj.getValue("lang");
  101.             var iLang = langs.length - 1;
  102.             while (iLang && langs[iLang] != lang)
  103.                 iLang--;
  104.             curLang = langs[iLang];
  105.             if (obj.getValue("lang.all") != "1")
  106.                 showAll = false;
  107.         }
  108.  
  109.         var iLim = document.body.children.length;
  110.         var head = null;
  111.         for (var i = 0; i < iLim; i++) {
  112.             var elem = document.body.children[i];
  113.             if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
  114.                 break;
  115.             if (elem.tagName.match(/^H[1-6]$/)) {
  116.                 head = elem;
  117.                 head.insertAdjacentHTML('BeforeEnd', '<SPAN CLASS=ilang></SPAN>');
  118.             }
  119.         }
  120.  
  121.         var td = hdr.insertCell(0);
  122.         if (td) {
  123.             // Localizable strings.
  124.             var L_Filter_Tip = "Language Filtering";    // tooltip for language button
  125.             var L_Language = "Language";                // heading for menu of programming languages
  126.             var L_Show_All = "Show All";                // label for 'show all languages' menu item
  127.  
  128.             // Add the language button to the button bar.
  129.             td.className = "button1";
  130.             td.style.width = "19px";
  131.             td.onclick = langMenu;
  132.             td.innerHTML = '<IMG SRC="' + baseUrl + 'Filter.gif' + '" ALT="' +
  133.                 L_Filter_Tip + '" BORDER=0>';
  134.  
  135.             // Add the menu.
  136.             var div = '<DIV ID="lang_menu" CLASS=langMenu><B>' + L_Language + '</B><UL>';
  137.             for (var i = 0; i < langs.length; i++)
  138.                 div += '<LI><A HREF="" ONCLICK="chooseLang(this)">' + langs[i] + '</A><BR>';
  139.             div += '<LI><A HREF="" ONCLICK="chooseAll()">' + L_Show_All + '</A></UL></DIV>';
  140.             document.body.insertAdjacentHTML('BeforeEnd', div);
  141.         }
  142.  
  143.         if (!showAll)
  144.             filterLang();
  145.     }
  146. }
  147.  
  148. function initPreElem(pre)
  149. {
  150.     var htm0 = pre.outerHTML;
  151.  
  152.     var reLang = /<span\b[^>]*class="?lang"?[^>]*>/i;
  153.     var iFirst = -1;
  154.     var iSecond = -1;
  155.  
  156.     iFirst = htm0.search(reLang);
  157.     if (iFirst >= 0) {
  158.         iPos = iFirst + 17;
  159.         iMatch = htm0.substr(iPos).search(reLang);
  160.         if (iMatch >= 0)
  161.             iSecond = iPos + iMatch;
  162.     }
  163.  
  164.     if (iSecond < 0) {
  165.         var htm1 = trimPreElem(htm0);
  166.         if (htm1 != htm0) {
  167.             pre.insertAdjacentHTML('AfterEnd', htm1);
  168.             pre.outerHTML = "";
  169.         }
  170.     }
  171.     else {
  172.         var rePairs = /<(\w+)\b[^>]*><\/\1>/gi;
  173.  
  174.         var substr1 = htm0.substring(0,iSecond);
  175.         var tags1 = substr1.replace(/>[^<>]+(<|$)/g, ">$1");
  176.         var open1 = tags1.replace(rePairs, "");
  177.         open1 = open1.replace(rePairs, "");
  178.  
  179.         var substr2 = htm0.substring(iSecond);
  180.         var tags2 = substr2.replace(/>[^<>]+</g, "><");
  181.         var open2 = tags2.replace(rePairs, "");
  182.         open2 = open2.replace(rePairs, "");
  183.  
  184.         pre.insertAdjacentHTML('AfterEnd', open1 + substr2);
  185.         pre.insertAdjacentHTML('AfterEnd', trimPreElem(substr1 + open2));
  186.         pre.outerHTML = "";
  187.     }    
  188. }
  189.  
  190. function trimPreElem(htm)
  191. {
  192.     return htm.replace(/[ \r\n]*((<\/[BI]>)*)[ \r\n]*<\/PRE>/g, "$1</PRE>").replace(
  193.         /\w*<\/SPAN>\w*((<[BI]>)*)\w*\r\n/g, "\r\n</SPAN>$1"
  194.         );
  195. }
  196.  
  197. function getBlock(elem)
  198. {
  199.     while (elem && elem.tagName.match(/^[BIUA]|(SPAN)|(CODE)|(TD)$/))
  200.         elem = elem.parentElement;
  201.     return elem;
  202. }
  203.  
  204. function langMenu()
  205. {
  206.     bodyOnClick();
  207.  
  208.     window.event.returnValue = false;
  209.     window.event.cancelBubble = true;
  210.  
  211.     var div = document.all.lang_menu;
  212.     var lnk = window.event.srcElement;
  213.     if (div && lnk) {
  214.         var x = lnk.offsetLeft + lnk.offsetWidth - div.offsetWidth;
  215.         div.style.pixelLeft = (x < 0) ? 0 : x;
  216.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  217.         div.style.visibility = "visible";
  218.     }
  219. }
  220.  
  221. function chooseLang(item)
  222. {
  223.     window.event.returnValue = false;
  224.     window.event.cancelBubble = true;
  225.  
  226.     if (item) {
  227.         closeMenu();
  228.         curLang = item.innerText;
  229.         showAll = false;
  230.     }
  231.  
  232.     if (cook) {
  233.         cook.putValue('lang', curLang);
  234.         cook.putValue('lang.all', '');
  235.     }
  236.  
  237.     filterLang();
  238. }
  239.  
  240. function chooseAll()
  241. {
  242.     window.event.returnValue = false;
  243.     window.event.cancelBubble = true;
  244.  
  245.     closeMenu();
  246.  
  247.     showAll = true;
  248.     if (cook)
  249.         cook.putValue('lang.all', '1');
  250.  
  251.     unfilterLang();
  252. }
  253.  
  254. function closeMenu()
  255. {
  256.     var div = document.all.lang_menu;
  257.     if (div && div.style.visibility != "hidden") {
  258.         var lnk = document.activeElement;
  259.         if (lnk && lnk.tagName == "A")
  260.             lnk.blur();
  261.  
  262.         div.style.visibility = "hidden";
  263.     }
  264. }
  265.  
  266. function getNext(elem)
  267. {
  268.     for (var i = elem.sourceIndex + 1; i < document.all.length; i++) {
  269.         var next = document.all[i];
  270.         if (!elem.contains(next))
  271.             return next;
  272.     }
  273.     return null;
  274. }
  275.  
  276. function filterMatch(text, name)
  277. {
  278.     var a = text.split(",");
  279.     for (var iTok = 0; iTok < a.length; iTok++) {
  280.         var m = a[iTok].match(/([A-Za-z].*[A-Za-z+])/);
  281.         if (m && m[1] == name)
  282.             return true;
  283.     }
  284.     return false;
  285. }
  286.  
  287. function topicHeading(head)
  288. {
  289.     var iLim = document.body.children.length;
  290.     var idxLim = head.sourceIndex;
  291.  
  292.     for (var i = 0; i < iLim; i++) {
  293.         var elem = document.body.children[i];
  294.         if (elem.sourceIndex < idxLim) {
  295.             if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
  296.                 return false;
  297.         }
  298.         else
  299.             break;
  300.     }
  301.     return true;
  302. }
  303.  
  304. function filterLang()
  305. {
  306.     var spans = document.all.tags("SPAN");
  307.     for (var i = 0; i < spans.length; i++) {
  308.         var elem = spans[i];
  309.         if (elem.className == "lang") {
  310.             var newVal = filterMatch(elem.innerText, curLang) ? "block" : "none";
  311.             var block = getBlock(elem);
  312.             block.style.display = newVal;
  313.             elem.style.display = "none";
  314.  
  315.             if (block.tagName == "DT") {
  316.                 var next = getNext(block);
  317.                 if (next && next.tagName == "DD")
  318.                     next.style.display = newVal;
  319.             }
  320.             else if (block.tagName == "DIV") {
  321.                 block.className = "filtered2";
  322.             }
  323.             else if (block.tagName.match(/^H[1-6]$/)) {
  324.                 if (topicHeading(block)) {
  325.                     if (newVal != "none") {
  326.                         var tag = null;
  327.                         if (block.children && block.children.length) {
  328.                             tag = block.children[block.children.length - 1];
  329.                             if (tag.className == "ilang") {
  330.                                 tag.innerHTML = (newVal == "block") ?
  331.                                     '  [Language: ' + curLang + ']' : "";
  332.                             }
  333.                         }
  334.                     }
  335.                 }
  336.                 else {
  337.                     var next = getNext(block);
  338.                     while (next && !next.tagName.match(/^(H[1-6])|(DIV)$/)) {
  339.                         next.style.display = newVal;
  340.                         next = getNext(next);
  341.                     }
  342.                 }
  343.             }
  344.         }
  345.         else if (elem.className == "ilang") {
  346.             elem.innerHTML = '  [Language: ' + curLang + ']';
  347.         }
  348.     }
  349.  
  350.     if (ie4) {
  351.         document.body.style.display = "none";
  352.         document.body.style.display = "block";
  353.     }
  354. }
  355.  
  356. function unfilterLang(name)
  357. {
  358.     var spans = document.all.tags("SPAN");
  359.     for (var i = 0; i < spans.length; i++) {
  360.         var elem = spans[i];
  361.         if (elem.className == "lang") {
  362.             var block = getBlock(elem);
  363.             block.style.display = "block";
  364.             elem.style.display = "inline";
  365.  
  366.             if (block.tagName == "DT") {
  367.                 var next = getNext(block);
  368.                 if (next && next.tagName == "DD")
  369.                     next.style.display = "block";
  370.             }
  371.             else if (block.tagName == "DIV") {
  372.                 block.className = "filtered";
  373.             }
  374.             else if (block.tagName.match(/^H[1-6]$/)) {
  375.                 if (topicHeading(block)) {
  376.                     var tag = null;
  377.                     if (block.children && block.children.length) {
  378.                         tag = block.children[block.children.length - 1];
  379.                         if (tag && tag.className == "ilang")
  380.                             tag.innerHTML = "";
  381.                     }
  382.                 }
  383.                 else {
  384.                     var next = getNext(block);
  385.                     while (next && !next.tagName.match(/^(H[1-6])|(DIV)$/)) {
  386.                         next.style.display = "block";
  387.                         next = getNext(next);
  388.                     }
  389.                 }
  390.             }
  391.         }
  392.         else if (elem.className == "ilang") {
  393.             elem.innerHTML = "";
  394.         }
  395.     }
  396. }
  397.  
  398.  
  399. //
  400. // Reftips (parameter popups)
  401. //
  402. function initReftips()
  403. {
  404.     var DLs = document.all.tags("DL");
  405.     var PREs = document.all.tags("PRE");
  406.     if (DLs && PREs) {
  407.         var iDL = 0;
  408.         var iPRE = 0;
  409.         var iSyntax = -1;
  410.         for (var iPRE = 0; iPRE < PREs.length; iPRE++) {
  411.             if (PREs[iPRE].className == "syntax") {
  412.                 while (iDL < DLs.length && DLs[iDL].sourceIndex < PREs[iPRE].sourceIndex)
  413.                     iDL++;            
  414.                 if (iDL < DLs.length) {
  415.                     initSyntax(PREs[iPRE], DLs[iDL]);
  416.                     iSyntax = iPRE;
  417.                 }
  418.                 else
  419.                     break;
  420.             }
  421.         }
  422.  
  423.         if (iSyntax >= 0) {
  424.             var last = PREs[iSyntax];
  425.             last.insertAdjacentHTML(
  426.                 'AfterEnd',
  427.                 '<DIV ID=reftip CLASS=reftip STYLE="position:absolute;visibility:hidden;overflow:visible;"></DIV>'
  428.                 );
  429.         }
  430.     }
  431. }
  432.  
  433. function initSyntax(pre, dl)
  434. {
  435.     var strSyn = pre.outerHTML;
  436.     var ichStart = strSyn.indexOf('>', 0) + 1;
  437.     var terms = dl.children.tags("DT");
  438.     if (terms) {
  439.         for (var iTerm = 0; iTerm < terms.length; iTerm++) {
  440.             var words = terms[iTerm].innerText.replace(/\[.+\]/g, " ").replace(/,/g, " ").split(" ");
  441.             for (var iWord = 0; iWord < words.length; iWord++) {
  442.                 var word = words[iWord];
  443.                 if (word.length > 0) {
  444.                     var ichMatch = findTerm(strSyn, ichStart, word);
  445.                     while (ichMatch > 0) {
  446.                         var strTag = '<A HREF="" ONCLICK="showTip(this)" CLASS="synParam">' + word + '</A>';
  447.  
  448.                         strSyn =
  449.                             strSyn.slice(0, ichMatch) +
  450.                             strTag +
  451.                             strSyn.slice(ichMatch + word.length);
  452.  
  453.                         ichMatch = findTerm(strSyn, ichMatch + strTag.length, word);
  454.                     }
  455.                 }
  456.             }
  457.         }
  458.     }
  459.  
  460.     // Replace the syntax block with our modified version.
  461.     pre.outerHTML = strSyn;
  462. }
  463.  
  464. function findTerm(strSyn, ichPos, strTerm)
  465. {
  466.     var ichMatch = strSyn.indexOf(strTerm, ichPos);
  467.     while (ichMatch >= 0) {
  468.         if ((ichMatch == 0 || !isalnum(strSyn.charAt(ichMatch - 1))) && 
  469.                 !isalnum(strSyn.charAt(ichMatch + strTerm.length))) {
  470.             var ichComment = strSyn.indexOf("/*", ichPos);
  471.             while (ichComment >= 0) {
  472.                 if (ichComment > ichMatch) { 
  473.                     ichComment = -1;
  474.                     break; 
  475.                 }
  476.                 var ichEnd = strSyn.indexOf("*/", ichComment);
  477.                 if (ichEnd < 0 || ichEnd > ichMatch)
  478.                     break;
  479.                 ichComment = strSyn.indexOf("/*", ichEnd);
  480.             }
  481.             if (ichComment < 0) {
  482.                 ichComment = strSyn.indexOf("//", ichPos);
  483.                 while (ichComment >= 0) {
  484.                     if (ichComment > ichMatch) {
  485.                         ichComment = -1;
  486.                         break; 
  487.                     }
  488.                     var ichEnd = strSyn.indexOf("\n", ichComment);
  489.                     if (ichEnd < 0 || ichEnd > ichMatch)
  490.                         break;
  491.                     ichComment = strSyn.indexOf("//", ichEnd);
  492.                 }
  493.             }
  494.             if (ichComment < 0)
  495.                 break;
  496.         }
  497.         ichMatch = strSyn.indexOf(strTerm, ichMatch + strTerm.length);
  498.     }
  499.     return ichMatch;
  500. }
  501.  
  502. function isalnum(ch)
  503. {
  504.     return ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_'));
  505. }
  506.  
  507. function showTip(link)
  508. {
  509.     bodyOnClick();
  510.  
  511.     var tip = document.all.reftip;
  512.     if (!tip || !link)
  513.         return;
  514.  
  515.     window.event.returnValue = false;
  516.     window.event.cancelBubble = true;
  517.  
  518.     // Hide the tip if necessary and initialize its size.
  519.     tip.style.visibility = "hidden";
  520.     tip.style.pixelWidth = 260;
  521.     tip.style.pixelHeight = 24;
  522.  
  523.     // Find the link target.
  524.     var term = null;
  525.     var def = null;
  526.     var DLs = document.all.tags("DL");
  527.     for (var iDL = 0; iDL < DLs.length; iDL++) {
  528.         if (DLs[iDL].sourceIndex > link.sourceIndex) {
  529.             var dl = DLs[iDL];
  530.             var iMax = dl.children.length - 1;
  531.             for (var iElem = 0; iElem < iMax; iElem++) {
  532.                 var dt = dl.children[iElem];
  533.                 if (dt.tagName == "DT" && dt.style.display != "none") {
  534.                     if (findTerm(dt.innerText, 0, link.innerText) >= 0) {
  535.                         var dd = dl.children[iElem + 1];
  536.                         if (dd.tagName == "DD") {
  537.                             term = dt;
  538.                             def = dd;
  539.                         }
  540.                         break;
  541.                     }
  542.                 }
  543.             }
  544.             break;
  545.         }
  546.     }
  547.  
  548.     if (def) {
  549.         window.linkElement = link;
  550.         window.linkTarget = term;
  551.         tip.innerHTML = '<DL><DT>' + term.innerHTML + '</DT><DD>' + def.innerHTML + '</DD></DL>';
  552.         window.setTimeout("moveTip()", 0);
  553.     }
  554. }
  555.  
  556. function jumpParam()
  557. {
  558.     hideTip();
  559.  
  560.     window.linkTarget.scrollIntoView();
  561.     document.body.scrollLeft = 0;
  562.  
  563.     flash(3);
  564. }
  565.  
  566. function flash(c)
  567. {
  568.     window.linkTarget.style.background = (c & 1) ? "#FFFF80" : "";
  569.     if (c)
  570.         window.setTimeout("flash(" + (c-1) + ")", 200);
  571. }
  572.  
  573. function moveTip()
  574. {
  575.     var tip = document.all.reftip;
  576.     var link = window.linkElement;
  577.     if (!tip || !link)
  578.         return; //error
  579.  
  580.     var w = tip.offsetWidth;
  581.     var h = tip.offsetHeight;
  582.  
  583.     if (w > tip.style.pixelWidth) {
  584.         tip.style.pixelWidth = w;
  585.         window.setTimeout("moveTip()", 0);
  586.         return;
  587.     }
  588.  
  589.     var maxw = document.body.clientWidth;
  590.     var maxh = document.body.clientHeight;
  591.  
  592.     if (h > maxh) {
  593.         if (w < maxw) {
  594.             w = w * 3 / 2;
  595.             tip.style.pixelWidth = (w < maxw) ? w : maxw;
  596.             window.setTimeout("moveTip()", 0);
  597.             return;
  598.         }
  599.     }
  600.  
  601.     var x,y;
  602.  
  603.     var linkLeft = link.offsetLeft - document.body.scrollLeft;
  604.     var linkRight = linkLeft + link.offsetWidth;
  605.  
  606.     var linkTop = link.offsetTop - document.body.scrollTop;
  607.     var linkBottom = linkTop + link.offsetHeight;
  608.  
  609.     var cxMin = link.offsetWidth - 24;
  610.     if (cxMin < 16)
  611.         cxMin = 16;
  612.  
  613.     if (linkLeft + cxMin + w <= maxw) {
  614.         x = maxw - w;
  615.         if (x > linkRight + 8)
  616.             x = linkRight + 8;
  617.         y = maxh - h;
  618.         if (y > linkTop)
  619.             y = linkTop;
  620.     }
  621.     else if (linkBottom + h <= maxh) {
  622.         x = maxw - w;
  623.         if (x < 0)
  624.             x = 0;
  625.         y = linkBottom;
  626.     }
  627.     else if (w <= linkRight - cxMin) {
  628.         x = linkLeft - w - 8;
  629.         if (x < 0)
  630.             x = 0;
  631.         y = maxh - h;
  632.         if (y > linkTop)
  633.             y = linkTop;
  634.     }
  635.     else if (h <= linkTop) {
  636.         x = maxw - w;
  637.         if (x < 0)
  638.             x = 0;
  639.         y = linkTop - h;
  640.     }
  641.     else if (w >= maxw) {
  642.         x = 0;
  643.         y = linkBottom;
  644.     }
  645.     else {
  646.         w = w * 3 / 2;
  647.         tip.style.pixelWidth = (w < maxw) ? w : maxw;
  648.         window.setTimeout("moveTip()", 0);
  649.         return;
  650.     }
  651.     
  652.     link.style.background = "#FFFF80";
  653.     tip.style.pixelLeft = x + document.body.scrollLeft;
  654.     tip.style.pixelTop = y + document.body.scrollTop;
  655.     tip.style.visibility = "visible";
  656. }
  657.  
  658. function hideTip()
  659. {
  660.     if (window.linkElement) {
  661.         window.linkElement.style.background = "";
  662.         window.linkElement = null;
  663.     }
  664.  
  665.     var tip = document.all.reftip;
  666.     if (tip) {
  667.         tip.style.visibility = "hidden";
  668.         tip.innerHTML = "";
  669.     }
  670. }
  671.  
  672. function beginsWith(s1, s2)
  673. {
  674.     // Does s1 begin with s2?
  675.     return s1.substring(0, s2.length) == s2;
  676. }
  677.  
  678. //
  679. // See Also popups
  680. //
  681. function initSeeAlso()
  682. {
  683.     // Localizable strings.
  684.     var L_See_Also = "See Also";
  685.     var L_Requirements = "Requirements";
  686.     var L_QuickInfo = "QuickInfo";
  687.  
  688.     var hdr = document.all.hdr;
  689.     if (!hdr)
  690.         return;
  691.  
  692.     var divS = new String;
  693.     var divR = new String;
  694.  
  695.     var heads = document.all.tags("H4");
  696.     if (heads) {
  697.         for (var i = 0; i < heads.length; i++) {
  698.             var head = heads[i];
  699.             var txt = head.innerText;
  700.             if (beginsWith(txt, L_See_Also)) {
  701.                 divS += head.outerHTML;
  702.                 var next = getNext(head);
  703.                 while (next && !next.tagName.match(/^(H[1-4])|(DIV)$/)) {
  704.                     divS += next.outerHTML;
  705.                     next = getNext(next);
  706.                 }
  707.             }
  708.             else if (beginsWith(txt, L_Requirements) || beginsWith(txt, L_QuickInfo)) {
  709.                 divR += head.outerHTML;
  710.                 var next = getNext(head);
  711.                 while (next && !next.tagName.match(/^(H[1-4])|(DIV)$/)) {
  712.                     divR += next.outerHTML;
  713.                     next = getNext(next);
  714.                 }
  715.             }
  716.         }
  717.     }
  718.  
  719.     var pos = getNext(hdr.parentElement);
  720.     if (pos) {
  721.         if (divR != "") {
  722.             divR = '<DIV ID=rpop CLASS=sapop>' + divR + '</DIV>';
  723.             var td = hdr.insertCell(0);
  724.             if (td) {
  725.                 td.className = "button1";
  726.                 td.style.width = "19px";
  727.                 td.onclick = showRequirements;
  728.                 td.innerHTML = '<IMG SRC="' + baseUrl + 'Requirements.gif' + '" ALT="' + L_Requirements + '" BORDER=0>';
  729.                 if (ie4)
  730.                     document.body.insertAdjacentHTML('AfterBegin', divR);
  731.                 else
  732.                     document.body.insertAdjacentHTML('BeforeEnd', divR);
  733.             }
  734.         }
  735.         if (divS != "") {
  736.             divS = '<DIV ID=sapop CLASS=sapop>' + divS + '</DIV>';
  737.             var td = hdr.insertCell(0);
  738.             if (td) {
  739.                 td.className = "button1";
  740.                 td.style.width = "19px";
  741.                 td.onclick = showSeeAlso;
  742.                 td.innerHTML = '<IMG SRC="' + baseUrl + 'SeeAlso.gif' + '" ALT="' + L_See_Also + '" BORDER=0>';
  743.                 if (ie4)
  744.                     document.body.insertAdjacentHTML('AfterBegin', divS);
  745.                 else
  746.                     document.body.insertAdjacentHTML('BeforeEnd', divS);
  747.             }
  748.         }
  749.     }
  750. }
  751.  
  752. function showSeeAlso()
  753. {
  754.     bodyOnClick();
  755.  
  756.     window.event.returnValue = false;
  757.     window.event.cancelBubble = true;
  758.  
  759.     var div = document.all.sapop;
  760.     var lnk = window.event.srcElement;
  761.  
  762.     if (div && lnk) {
  763.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  764.         div.style.visibility = "visible";
  765.     }
  766. }
  767.  
  768. function showRequirements()
  769. {
  770.     bodyOnClick();
  771.  
  772.     window.event.returnValue = false;
  773.     window.event.cancelBubble = true;
  774.  
  775.     var div = document.all.rpop;
  776.     var lnk = window.event.srcElement;
  777.  
  778.     if (div && lnk) {
  779.         div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
  780.         div.style.visibility = "visible";
  781.     }
  782. }
  783.  
  784. function hideSeeAlso()
  785. {
  786.     var div = document.all.sapop;
  787.     if (div)
  788.         div.style.visibility = "hidden";
  789.  
  790.     var div = document.all.rpop;
  791.     if (div)
  792.         div.style.visibility = "hidden";
  793. }
  794.