///////////////////////////////////////////////////////////////////////////// // RoboHELP® WebHelp 3 Dynamic HTML Effects Script // Copyright © 1998-1999 Blue Sky Software Corporation. All rights reserved. // Version= 1.02 // Warning: Do not modify this file. It is generated by RoboHELP® and changes will be overwritten. //{{WH3_SYMBOL_SECTION var gstrNavFrmst = "navpane1.htm"; var gstrTocDhtml = "tocdhtml.htm"; var gstrIdxDhtml = "idxdhtml.htm"; var gstrFtsDhtml = "ftsdhtml.htm"; var gstrIniDhtml = ""; //}}WH3_SYMBOL_SECTION var gnPageWidth = 0; var gnPageHeight = 0; var gstrColl = ""; var gstrStyle = "" var gbNav4 = false; var gbIE4 = false; var gbIE = false; var gbIE5 = false; var gbTocLoaded = false; var gbIndexLoaded = false; var gbFtsLoaded = false; var gAgent = navigator.userAgent.toLowerCase(); var gbMac = (gAgent.indexOf("mac") != -1); var gbIndexInputEnable = false; var gIndexTopicArray = new Array(); var gIndexKeywordArray = new Array(); var gIndexLetterArray = new Array(); var gbFtsInputEnable = false; var gFtsKeywordArray = new Array(); var gFtsTopicArray = new Array(); var gFtsStopArray = new Array(); gbIE = (navigator.appName.indexOf("Microsoft") != -1); if (parseInt(navigator.appVersion) >= 4) { gbNav4 = (navigator.appName == "Netscape"); gbIE4 = (navigator.appName.indexOf("Microsoft") != -1); } if (gbNav4) { document.gnPageWidth = innerWidth; document.gnPageHeight = innerHeight; // document.captureEvents(Event.RESIZE); // document.onresize = HandleResize; } else if (gbIE4) { gstrStyle = ".style"; gstrColl = "all."; if (gAgent.indexOf("msie 5.0") != -1) { gbIE5 = true; } } function HandleResize() { //alert('handle resize: ' + window.document.location.href); if (innerWidth != window.document.gnPageWidth || innerHeight != window.document.gnPageHeight) { if (window.document.gnPageWidth == 0) { window.document.gnPageWidth = innerWidth; window.document.gnPageHeight = innerHeight; } else { window.document.gnPageWidth = innerWidth; window.document.gnPageHeight = innerHeight; window.document.location.reload(); } return false; } } function FindTopLevelLayer(strID) { if (gbNav4) { return FindTopLevelLayerNS(strID); } else if (gbIE4) { var obj = eval("document.all." + strID); return obj; } return null; } function FindTopLevelLayerNS(strID) { for (var iLayer = 0; iLayer < window.document.layers.length; iLayer++) { if (window.document.layers[iLayer].id == strID) { return window.document.layers[iLayer]; } } // This section is added to the search because when the scrollbar is // added, Netscape messes up the layer list. This is another way // of getting to the layers if (window.document.layers.length > 0) { var iLayer = 0; var objLayer = window.document.layers[0]; while ((iLayer < 20) && (objLayer != null)) { if (objLayer.id == strID) { return objLayer; } iLayer++; objLayer = objLayer.above; } } return null; } function GetAttribObject(obj) { var objAttrib = null; if (typeof obj == "string") { objAttrib = eval("document." + gstrColl + obj + gstrStyle); } else { objAttrib = obj; } return objAttrib; } function TabFrame() { if (gbNav4) { return Tabs; } else { return document.frames['Tabs']; } } function NavFrame() { if (gbNav4) { return Navigation; } else { return document.frames['Navigation']; } } function ShowDiv(strDiv, bShow) { var Div = FindTopLevelLayer(strDiv); if (Div == null) { return; } if (gbNav4) { if (bShow == true) { Div.visibility = 'show'; // Div.left = 0; Div.moveToAbsolute(0, 0); } else { Div.visibility = 'hide'; // Div.left = -2000; Div.moveToAbsolute(-2000, 0); } } else { Div.style.visibility = (bShow == true) ? 'visible' : 'hidden'; } return; } function LoadTocContent(TocDiv) { var strFile = location.href; var nPosFile = strFile.indexOf(gstrNavFrmst); strFile = strFile.substring(0, nPosFile); strFile += gstrTocDhtml; if (gbNav4) { TocDiv.src = strFile; } else if (gbIE4) { // TocDiv.document.frames['TocIFrame'].location.href = strFile; //alert('loading: ' + strFile + ' into: ' + TocDiv.document.all.TocIFrame); TocDiv.document.all.TocIFrame.src = strFile; } gbTocLoaded = true; return; } function LoadIndexContent(IndexDiv) { var strFile = location.href; var nPosFile = strFile.indexOf(gstrNavFrmst); strFile = strFile.substring(0, nPosFile); strFile += gstrIdxDhtml; if (gbNav4) { IndexDiv.src = strFile; } else if (gbIE4) { // IndexDiv.document.frames['IndexIFrame'].location.href = strFile; IndexDiv.document.all.IndexIFrame.src = strFile; } gbIndexLoaded = true; return; } function LoadFtsContent(FtsDiv) { var strFile = location.href; var nPosFile = strFile.indexOf(gstrNavFrmst); strFile = strFile.substring(0, nPosFile); strFile += gstrFtsDhtml; if (gbNav4) { FtsDiv.src = strFile; } else if (gbIE4) { // FtsDiv.document.frames['FtsIFrame'].location.href = strFile; FtsDiv.document.all.FtsIFrame.src = strFile; } gbFtsLoaded = true; return; } function TimeoutChangeToTOC() { if (!gbTocLoaded) { var TocDiv = window.NavFrame().FindTopLevelLayer('TocNav'); if (TocDiv != null) { LoadTocContent(TocDiv); } } if (window.TabFrame().document.images['TocTab'] != null) { window.TabFrame().document.images['TocTab'].src='bssctab1.gif'; } if (window.TabFrame().document.images['IndexTab'] != null) { window.TabFrame().document.images['IndexTab'].src='bssctab4.gif'; } if (window.TabFrame().document.images['FtsTab'] != null) { window.TabFrame().document.images['FtsTab'].src='bssctab6.gif'; } window.NavFrame().ShowDiv('TocNav', true); window.NavFrame().ShowDiv('IndexNav', false); window.NavFrame().ShowDiv('FtsNav', false); if (gbNav4 && window.NavFrame().window.NSscrollbar) { NavFrame().window.NSscrollbar.SetActiveLayer(NavFrame().FindTopLevelLayer('TocNav')); } } function ChangeToTOC() { setTimeout("TimeoutChangeToTOC();", 50); return; } function SelectTOC() { if (!gbTocLoaded) { var TocDiv = NavFrame().FindTopLevelLayer('TocNav'); if (TocDiv != null) { LoadTocContent(TocDiv); } } if (TabFrame().document.images['TocTab'] != null) { TabFrame().document.images['TocTab'].src='bssctab1.gif'; } if (TabFrame().document.images['IndexTab'] != null) { TabFrame().document.images['IndexTab'].src='bssctab4.gif'; } if (TabFrame().document.images['FtsTab'] != null) { TabFrame().document.images['FtsTab'].src='bssctab6.gif'; } NavFrame().ShowDiv('TocNav', true); NavFrame().ShowDiv('IndexNav', false); NavFrame().ShowDiv('FtsNav', false); if (gbNav4 && NavFrame().window.NSscrollbar) { NavFrame().window.NSscrollbar.SetActiveLayer(NavFrame().FindTopLevelLayer('TocNav')); } } function TimeoutChangeToIndex() { if (!gbIndexLoaded) { var IndexDiv = window.NavFrame().FindTopLevelLayer('IndexNav'); if (IndexDiv != null) { LoadIndexContent(IndexDiv); } } if (window.TabFrame().document.images['TocTab'] != null) { window.TabFrame().document.images['TocTab'].src='bssctab2.gif'; } if (window.TabFrame().document.images['IndexTab'] != null) { window.TabFrame().document.images['IndexTab'].src='bssctab3.gif'; } if (window.TabFrame().document.images['FtsTab'] != null) { window.TabFrame().document.images['FtsTab'].src='bssctab6.gif'; } window.NavFrame().ShowDiv('TocNav', false); window.NavFrame().ShowDiv('IndexNav', true); window.NavFrame().ShowDiv('FtsNav', false); if (gbNav4 && window.NavFrame().window.NSscrollbar) { NavFrame().window.NSscrollbar.SetActiveLayer(NavFrame().FindTopLevelLayer('IndexNav')); } } function ChangeToIndex() { setTimeout("TimeoutChangeToIndex();", 50); } function SelectIndex() { if (!gbIndexLoaded) { var IndexDiv = NavFrame().FindTopLevelLayer('IndexNav'); if (IndexDiv != null) { LoadIndexContent(IndexDiv); } } if (TabFrame().document.images['TocTab'] != null) { TabFrame().document.images['TocTab'].src='bssctab2.gif'; } if (TabFrame().document.images['IndexTab'] != null) { TabFrame().document.images['IndexTab'].src='bssctab3.gif'; } if (TabFrame().document.images['FtsTab'] != null) { TabFrame().document.images['FtsTab'].src='bssctab6.gif'; } NavFrame().ShowDiv('TocNav', false); NavFrame().ShowDiv('IndexNav', true); NavFrame().ShowDiv('FtsNav', false); if (gbNav4 && NavFrame().window.NSscrollbar) { NavFrame().window.NSscrollbar.SetActiveLayer(NavFrame().FindTopLevelLayer('IndexNav') ); } setTimeout("IndexFocus()", 200); } function SelectFTS() { var FtsDiv = NavFrame().FindTopLevelLayer('FtsNav'); if (!gbFtsLoaded) { if (FtsDiv != null) { LoadFtsContent(FtsDiv); } } if (TabFrame().document.images['TocTab'] != null) { TabFrame().document.images['TocTab'].src='bssctab2.gif'; } if (TabFrame().document.images['IndexTab'] != null) { TabFrame().document.images['IndexTab'].src='bssctab4.gif'; } if (TabFrame().document.images['FtsTab'] != null) { TabFrame().document.images['FtsTab'].src='bssctab5.gif'; } NavFrame().ShowDiv('TocNav', false); NavFrame().ShowDiv('IndexNav', false); NavFrame().ShowDiv('FtsNav', true); if (gbNav4 && NavFrame().window.NSscrollbar) { NavFrame().window.NSscrollbar.SetActiveLayer(NavFrame().FindTopLevelLayer('FtsNav')); } setTimeout("FTSFocus()", 200); } function FTSFocus() { var FtsDiv = NavFrame().FindTopLevelLayer('FtsNav'); if (gbIE4) { FtsDiv = FtsDiv.document.frames['FtsIFrame']; } if (FtsDiv.FtsInputForm != null) { FtsDiv.FtsInputForm.ftsField.focus(); } } function IndexFocus() { var IndexDiv = NavFrame().FindTopLevelLayer('IndexNav'); if (gbIE4) { IndexDiv = IndexDiv.document.frames['IndexIFrame']; } if (IndexDiv.IndexInputForm != null) { IndexDiv.IndexInputForm.keywordField.focus(); } } function SelectInitialTab() { // Create the necessary IFrames for IE if (gbIE4) { if (FindTopLevelLayer('TocNav') != null) { var nIFrameHeight = FindTopLevelLayer('TocNav').style.pixelHeight - 10; var strIFrame = '
'; } else { strIFrame += '100%;">'; } FindTopLevelLayer('TocNav').innerHTML = strIFrame; } if (FindTopLevelLayer('IndexNav') != null) { var nIFrameHeight = FindTopLevelLayer('IndexNav').style.pixelHeight - 10; var strIFrame = '
'; } else { strIFrame += '100%;">'; } FindTopLevelLayer('IndexNav').innerHTML = strIFrame; } if (FindTopLevelLayer('FtsNav') != null) { var nIFrameHeight = FindTopLevelLayer('FtsNav').style.pixelHeight - 10; var strIFrame = '
'; } else { strIFrame += '100%;">'; } FindTopLevelLayer('FtsNav').innerHTML = strIFrame; } } // Call the real selection function setTimeout("SelectInitTabReal()", 50); } function SelectInitTabReal() { parent.gbTocLoaded = false; parent.gbIndexLoaded = false; parent.gbFtsLoaded = false; if (gstrIniDhtml == gstrTocDhtml) { parent.SelectTOC(); } else if (gstrIniDhtml == gstrIdxDhtml) { parent.SelectIndex(); } else if (gstrIniDhtml == gstrFtsDhtml) { parent.SelectFTS(); } // if (FindTopLevelLayer('TocNav') != null) { // parent.SelectTOC(); // } else if (FindTopLevelLayer('IndexNav') != null) { // parent.SelectIndex(); // } else if (FindTopLevelLayer('FtsNav') != null) { // parent.SelectFTS(); // } } ////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Index code // ////////////////////////////////////////////////////////////////////////////////////////////////////////// var gbIndexLayerInit = false; function IndexInitPage() { parent.gbIndexLayerInit = false; if (gbNav4) { TocBuildLayerArrayNS(); onLoad = TocArrangeAllLayerNS(); } else if (gbIE4) { // Mark all Index blocks as "expanded" var tempColl = document.all.tags("DIV"); for (var i = 0; i < tempColl.length; i++) { if (tempColl(i).className == "child") tempColl(i).style.display = "block"; } // Make an array of parents so we can access them directly var tempColl = document.all.tags("DIV"); var iLetterIndex = 0; var nACharCode = "A".charCodeAt(0); for (var i = 0; i < tempColl.length; i++) { if (tempColl(i).className == "parent") { if (tempColl(i).innerText == "#") { gIndexLetterArray[0] = tempColl(i); } else { iLetterIndex = tempColl(i).innerText.charCodeAt(0); iLetterIndex -= nACharCode; iLetterIndex += 1; gIndexLetterArray[iLetterIndex] = tempColl(i); } } } } setTimeout("parent.gbIndexLayerInit = true;",1000); return; } function IndexWriteClassStyle() { document.write("
"); return; } //Define variable arguments as: strTitle, strUrl function TopicEntry() { var argLen = TopicEntry.arguments.length; this.strTitle = TopicEntry.arguments[0]; this.strURL = TopicEntry.arguments[1]; // alert("Title: " + this.strTitle + " URL: " + this.strURL); } //Define variable arguments as: strKeyword [,strTopicIndex]* function IndexKeywordEntry() { var argLen = IndexKeywordEntry.arguments.length; this.strKeyword = IndexKeywordEntry.arguments[0]; this.arrayTopics = new Array(); // Now add all of the topic entries for (var i=0; i < argLen - 1; i++) { this.arrayTopics[i] = IndexKeywordEntry.arguments[i + 1]; } } function IndexBody() { // Get the appropriate item to add items to var layerFind = null; if (gbIE4) { layerFind = parent.document.frames['idxbody']; } else if (gbNav4) { layerFind = parent.document.idxbody.document; } return layerFind; } function IndexForm() { // Get the appropriate item to add items to var layerFind = null; if (gbIE4) { layerFind = parent.document.frames['idxform']; } else if (gbNav4) { layerFind = parent.document.idxform.document; } return layerFind; } function IndexExpandIt(elId, bForceOpen) { var layerChild = null; if (gbIE4) { layerChild = TocExpandIE(elId, false, bForceOpen); if (!bForceOpen) { var nNewScroll = document.body.scrollTop; if (layerChild.style.display == "block") { var nItemTop = layerChild.offsetTop; var nItemBottom = nItemTop + layerChild.offsetHeight; // Make sure the bottom is visible if possible if (document.body.scrollTop + document.body.clientHeight < nItemBottom) { nNewScroll = nItemBottom - document.body.clientHeight; } // If expanded item is bigger than the client area, scroll the item to the top if (nItemBottom - nItemTop > document.body.clientHeight) { nNewScroll = nItemTop - 20; } } document.body.scrollTop = nNewScroll; } } else if (gbNav4) { layerChild = TocExpandNS(elId, false, bForceOpen); if (window.NSscrollbar != null) { window.NSscrollbar.SetContentHeight(nextY); window.NSscrollbar.SetContentWidth(nextX); } } return layerChild; } function IndexInputEnable(bEnable) { gbIndexInputEnable = bEnable; return; } function IndexInputSubmit() { IndexLookup(true); return; } //Initize the site function IndexSiteInit() { if (!window.Array) return; if (gbNav4) document.captureEvents(Event.KEYUP); document.onkeyup = IndexLookupKeydown; } function IndexLookupKeydown() { IndexLookup(false); } function IndexLookup(bCR) { if (!parent.gbIndexLayerInit) { return; } if (!gbIndexInputEnable && !gbMac) { return; } var strInput = document.IndexInputForm.keywordField.value.toUpperCase(); if (strInput != "") { IndexSiteDisplay(strInput, bCR); } if (gbMac) { document.IndexInputForm.keywordField.focus(); } return; } function IndexSiteDisplay(strInput, bCR) { // Get the topmost Index layer var IndexDiv = IndexBody(); // Get the layer for the first letter var cFirst = strInput.charAt(0); cFirst.toUpperCase(); var layerFirst = null; if (gbNav4) { for (var iLayer = 0; iLayer < document.layers.length; iLayer++) { if ((document.layers[iLayer].id.indexOf("Parent") != -1) && (document.layers[iLayer].id.charAt(0) == cFirst)) { layerFirst = document.layers[iLayer]; break; } } if (layerFirst == null) { layerFirst = document.BookR0000000Parent; } } else if (gbIE4) { var iLetterIndex = cFirst.charCodeAt(0) - "A".charCodeAt(0) + 1; if ((iLetterIndex < 1) || (iLetterIndex > 26)) { layerFirst = IndexDiv.gIndexLetterArray[0]; } else { layerFirst = IndexDiv.gIndexLetterArray[iLetterIndex]; } } // If we didn't find anything then return - something went terribly wrong if (layerFirst == null) { return; } // Expand the first layer var strLayerID = layerFirst.id; var iParent = strLayerID.indexOf("Parent"); strLayerID = strLayerID.substr(0, iParent); var layerChild = IndexDiv.IndexExpandIt(strLayerID, true); // Find the first child that "matches" the item we are searchig for var MatchingItem = null; if (gbNav4) { // for (var iLayer = 0; iLayer < layerChild.layers.length; iLayer++) { // alert(layerChild.layers[iLayer].id); // } } else if (gbIE4) { var tempColl = layerChild.all.tags("P"); if (tempColl.length == 0) { MatchingItem = layerChild; } else { var iStart = 0; var iEnd = tempColl.length - 1; var iMid = 0; var strItemUpper = ""; while (iStart <= iEnd) { iMid = iStart + iEnd; iMid >>= 1; strItemUpper = tempColl(iMid).innerText; strItemUpper = strItemUpper.toUpperCase(); if (strItemUpper.indexOf(strInput) == 0) { break; } else if (strItemUpper > strInput) { iEnd = iMid - 1; } else { iStart = iMid + 1; } } // Search backward to find the first one that partially matches var iMatch = 0; for (var iMatch = iMid; iMatch >= 0; iMatch--) { strItemUpper = tempColl(iMatch).innerText; strItemUpper = strItemUpper.toUpperCase(); if (strItemUpper.indexOf(strInput) != 0) { break; } } if (iMatch != iMid) { if (iMatch >= 0) { if (iMatch < tempColl.length - 1) { iMid = iMatch + 1; } else { iMid = iMatch; } } else { iMid = 0; } } MatchingItem = tempColl(iMid); } } // Scroll to the closest matching item if (MatchingItem) { if (gbNav4) { } else if (gbIE4) { IndexDiv.document.body.scrollTop = MatchingItem.offsetTop; // Set the focus on the selected hyperlink (if there is one) if (gbIE5) { tempColl = MatchingItem.all.tags("A"); if (tempColl.length > 0) { // If a carriage return was used then simulate a click if (bCR) { tempColl(0).click(); } else { // Simply set the focus to the hyperlink tempColl(0).focus(); } IndexForm().document.IndexInputForm.keywordField.focus(); } } } } return; } ////////////////////////////////////////////////////////////////////////////////////////////////////////// // // TOC code // ////////////////////////////////////////////////////////////////////////////////////////////////////////// var imgBookClose ="bssctoc1.gif"; var imgBookOpen ="bssctoc2.gif"; var elTocArray = new Array(); var elTocArrayNum = 0; function TocWriteClassStyle() { document.write("
"); return; } function TocWriteFixedWidth(bBegin, nWidth) { //Avoid the wrap of text after book/page, make a invisble outter table is approch (for IE4 iMac only) if ((gbIE4) && (gbMac)) { if (bBegin) { document.write("

"); } else { document.write("

"); } } } //Assign the layer's visibility at initialize the Page function TocInitPage() { // var TocDiv = NavFrame().FindTopLevelLayer('TocNav'); // if (TocDiv != null) { // return; // } if (gbNav4) { // for (var i=0; i < document.layers.length; i++) { // var whichEl = document.layers[i]; // if (whichEl.id.indexOf("Child") != -1) { // whichEl.visibility = "hide"; // } else { // whichEl.visibility = "show"; // } // } TocBuildLayerArrayNS(); onLoad = TocArrangeAllLayerNS(); } else if (gbIE4) { // Select the first hyperlink var tempColl = document.all.tags("A"); if (tempColl.length > 0) { tempColl(0).focus(); } } return; } function TocShowLayer(whichEl, bShow) { if (bShow) { whichEl.visibility = "show"; } else { whichEl.visibility = "hide"; } for (var i=0; i document.body.clientHeight) { nNewScroll = nItemTop - 20; } } document.body.scrollTop = nNewScroll; } else if (gbNav4) { TocExpandNS(elId, true, false); if (window.NSscrollbar != null) { window.NSscrollbar.SetContentHeight(nextY); window.NSscrollbar.SetContentWidth(nextX); } } return; } //////////////////////////////////////////////////////////////// //Functions for IE function TocExpandIE(elId, bChangeImg, bForceOpen) { var whichEl = eval(elId + "Child"); var whichIm = document.images[elId]; if (whichEl == null) { return null; } if ((whichEl.style.display != "block") || bForceOpen) { whichEl.style.display = "block"; if (bChangeImg) { whichIm.src = imgBookOpen; } } else { whichEl.style.display = "none"; if (bChangeImg) { whichIm.src = imgBookClose; } if (gbMac) { //YJ: ?? can not scroll into view, if div has fixed width, it will scroll horizal to the very end. //whichEl.scrollIntoView(false); } } return whichEl; } //////////////////////////////////////////////////////////////// //Functions for NS function TocExpandNS(elId, bChangeImg, bForceOpen) { var whichParent = null; var whichChild = null; var idParent = elId + "Parent"; var idChild = elId + "Child"; for (var i=0; i 0) && (null != whichParent.parentLayer) && (whichParent.parentLayer.document.images.length > 0)) nextY -= whichParent.document.height; whichParent.pageY = nextY; whichParent.visibility = "show"; whichParent.clip.bottom = whichParent.document.height; whichParent.clip.right = whichParent.document.width + iLevel*20;// plus indent width if( whichParent.clip.right > nextX ) nextX = whichParent.clip.right; nextY += whichParent.document.height; if (whichChild.visibility == "show") { if (bChangeImg) whichParent.document.images[0].src = imgBookOpen; whichChild.pageY = nextY; nextY += whichChild.document.height; whichChild.clip.right = whichChild.document.width + iLevel*20;// plus indent width if( whichChild.clip.right > nextX ) nextX = whichChild.clip.right; TocArrangeLayerNS(whichChild, true, iLevel + 1, bChangeImg); whichChild.clip.bottom = nextY - window.NSscrollbar.GetContentVerticalPos(); if( nextX > whichChild.clip.right ) whichChild.clip.right = nextX; } else { if (bChangeImg) whichParent.document.images[0].src = imgBookClose; TocArrangeLayerNS(whichChild, false, iLevel + 1, bChangeImg); } } else { if (bChangeImg) whichParent.document.images[0].src = imgBookClose; whichParent.visibility = "hide"; whichParent.clip.bottom = 0; whichParent.clip.right = 0; whichChild.visibility = "hide"; whichChild.clip.bottom = 0; whichChild.clip.right = 0; TocArrangeLayerNS(whichChild, false, iLevel, bChangeImg); } i += 2; } } return; } function TocArrangeAllLayerNS(bChangeImg) { if (document.layers.length > 0) { nextX = document.layers[0].pageX; nextY = document.layers[0].pageY; TocArrangeLayerNS(document, true, 0, bChangeImg); } return; } ////////////////////////////////////////////////////////////////////////////////////////////////////////// // // FTS code // ////////////////////////////////////////////////////////////////////////////////////////////////////////// function FtsWriteClassStyle() { document.write("
"); return; } //Define variable arguments as: strKeyword [,strTopicIndex]* //function KeywordEntry() function FtsKeywordEntry() { var argLen = FtsKeywordEntry.arguments.length; this.strKeyword = FtsKeywordEntry.arguments[0]; this.arrayTopics = new Array(); // Now add all of the topic entries for (var i=0; i < argLen - 1; i++) { this.arrayTopics[i] = FtsKeywordEntry.arguments[i + 1]; } } function FtsStopWord() { this.strStopWord = FtsStopWord.arguments[0]; } function FtsInputEnable(bEnable) { gbFtsInputEnable = bEnable; return; } function FtsInputSubmit() { //Hack for IE, have to use keydown to get enter event, //Embedding WebHelp to WinHelp2000 will fail to fire the submit the form. if (!gbIE4) { FtsLookup(); } return false; } //Initize the site function FtsInit() { if (!window.Array) return; if (gbNav4) document.captureEvents(Event.KEYUP); document.onkeyup = FtsLookupKeydown; } function FtsLookupKeydown() { if (gbIE4) { if (event.keyCode == 13) //Enter key { FtsLookup(); } } } function FtsLookup() { if (!gbFtsInputEnable && !gbMac) return; var strInput = document.FtsInputForm.ftsField.value.toLowerCase(); if (strInput != "") { FtsDisplay(strInput); } if (gbMac) { document.FtsInputForm.ftsField.focus(); } } var gstrDisplayInput = ""; function FtsFindTable() { // Get the appropriate item to add items to var layerFind = null; if (gbIE4) { layerFind = parent.document.frames['ftsbody'].document.all.FtsFindTable; } else if (gbNav4) { layerFind = parent.document.ftsbody.document.FtsFindTable.document; } return layerFind; } function FtsBody() { // Get the appropriate item to add items to var layerFind = null; if (gbIE4) { layerFind = parent.document.frames['ftsbody']; } else if (gbNav4) { layerFind = parent.document.ftsbody.document; } return layerFind; } function FtsDisplay(strInput) { var layerFind = FtsFindTable(); if (layerFind == null) { return; } // Let the user know we are busy var strHtm = "

Finding topics...

" if (gbIE4) { layerFind.innerHTML = strHtm; } else if (gbNav4) { layerFind.write(strHtm); layerFind.close(); } window.gstrDisplayInput = strInput; setTimeout("FtsDisplayReal()", 50); return; } function FtsDisplayReal() { var FtsDiv = FtsBody(); // if (gbNav4) { // FtsDiv = FindTopLevelLayer('FtsNav'); // } else if (gbIE4) { // FtsDiv = parent.parent.FindTopLevelLayer('FtsNav'); // FtsDiv = FtsDiv.document.frames['FtsIFrame'].document.all.ftsbody; // } var strInput = window.gstrDisplayInput; var nKeywordArrayLen = FtsDiv.gFtsKeywordArray.length; var nTopicArrayLen = FtsDiv.gFtsTopicArray.length; var nStopArrayLen = FtsDiv.gFtsStopArray.length; // Get the appropriate item to add items to var layerFind = FtsFindTable(); if (layerFind == null) { return; } // Keep track of which operation we are currently in // 0 = OR; 1 = AND var nCurrentOp = 0; var bNot = false; // Loop through the words in the input string var bFinished = false; var bFirstKeyword = true; var strCurrentWord = ""; var strCurrentStem = ""; var strKeyword = ""; var strHtm = ""; var nFirstMatch = -1; var nLastMatch = -1; var i=0; var iSpace = 0; var iFound = 0; var SearchTopicArray = new Array(); var iSearch = 0; // If you change this Word Break string make sure you also change it in FtsDataBase.CPP var FTS_WORD_BREAK_CHARS = "\t\r\n\"\\ .,!@#$%^&*()~'`:;<>?/{}[]|+-=\x85\x92\x93\x94\x95\x96\x97\x99\xA9\xAE\xB7"; var nNumWordBreakChars = FTS_WORD_BREAK_CHARS.length; // Clear the flags for each of the topics var iTopic = 0; for (iTopic = 0; iTopic < nTopicArrayLen; iTopic++) { SearchTopicArray[iTopic] = 0; } while (!bFinished) { // Get the next word iSpace = -1; iChar = 0; iSep = -1; for (var iChar = 0; iChar < nNumWordBreakChars; iChar++) { iFound = strInput.indexOf(FTS_WORD_BREAK_CHARS.charAt(iChar)); if ((iFound != -1) && ((iSpace == -1) || (iFound < iSpace))) { iSpace = iFound; iSep = iChar; } } if (iSpace == -1) { strCurrentWord = strInput; strInput = ""; } else { strCurrentWord = strInput.substr(0, iSpace); strInput = strInput.substr(iSpace + 1); } // Check for operators or a blank word if ((strCurrentWord == "or") || ((iSep >= 0) && (FTS_WORD_BREAK_CHARS.charAt(iSep) == "|"))) { nCurrentOp = 0; bNot = false; } else if ((strCurrentWord == "and") || ((iSep >= 0) && (FTS_WORD_BREAK_CHARS.charAt(iSep) == "&"))) { nCurrentOp = 1; bNot = false; } else if ((strCurrentWord == "not") || ((iSep >= 0) && (FTS_WORD_BREAK_CHARS.charAt(iSep) == "~"))) { bNot = true; } else if (strCurrentWord == "") { if (strInput == "") { break; } else { continue; } } else if (!IsStopWord(strCurrentWord, FtsDiv.gFtsStopArray, nStopArrayLen)){ // See if this is has a NOT at the beginning if (strCurrentWord.substr(0, 1) == "~") { bNot = true; strCurrentWord = strCurrentWord.substr(1); } // Get the stemmed version of the word strCurrentStem = GetStem(strCurrentWord); // See if the stemmed word is found in the list iFound = -1; iFound = FtsFindKeyword(strCurrentStem, FtsDiv.gFtsKeywordArray, nKeywordArrayLen); // Did we find the keyword? if (iFound != -1) { // alert("found " + strCurrentWord); // See if we are performing an OR operation var nNumTopics = FtsDiv.gFtsKeywordArray[iFound].arrayTopics.length; if (nCurrentOp == 0) { if (bNot) { var cFoundArrayTopics = FtsDiv.gFtsKeywordArray[iFound].arrayTopics; // Add all topics that are not in the list for this keyword for (iTopic = 0; iTopic < nTopicArrayLen; iTopic++) { // See if the topic is in the list for this keyword for (iListTopic = 0; iListTopic < nNumTopics; iListTopic++) { if (cFoundArrayTopics[iListTopic] == iTopic) { break; } } if (iListTopic == nNumTopics) { // The topic is not in the list for the current keyword, so add it SearchTopicArray[iTopic] = 1; } } } else { // Loop through the topics that have the keyword and add them to the list for (iTopic = 0; iTopic < nNumTopics; iTopic++) { var nTopicNum = FtsDiv.gFtsKeywordArray[iFound].arrayTopics[iTopic]; // Add the topic to the list SearchTopicArray[nTopicNum] = 1; } } // See if this is an AND operation } else if (nCurrentOp == 1) { if (bNot) { // Loop through the topics for the current word and remove them from the list for (iTopic = 0; iTopic < nNumTopics; iTopic++) { SearchTopicArray[FtsDiv.gFtsKeywordArray[iFound].arrayTopics[iTopic]] = 0; } } else { // Loop through the topics already in the list and remove them if they are not // in the list for the current word for (iTopic = 0; iTopic < nNumTopics; iTopic++) { if (SearchTopicArray[FtsDiv.gFtsKeywordArray[iFound].arrayTopics[iTopic]] == 1) { SearchTopicArray[FtsDiv.gFtsKeywordArray[iFound].arrayTopics[iTopic]] = -1; } } for (iTopic = 0; iTopic < nTopicArrayLen; iTopic++) { if (SearchTopicArray[iTopic] == -1) { SearchTopicArray[iTopic] = 1; } else { SearchTopicArray[iTopic] = 0; } } } } } else { // Word was not found // Clear the list if this is an AND operation if ((nCurrentOp == 1) && (!bNot)) { for (iSearch = 0; iSearch < nTopicArrayLen; iSearch++) { SearchTopicArray[iSearch] = 0; } // Add all items to the list if this is an OR operation with a NOT operator } else if ((nCurrentOp == 0) && (bNot)) { // Add all topics that are not in the list for this keyword // First set all flags to -1 if they are not already set for (iTopic = 0; iTopic < nTopicArrayLen; iTopic++) { if (SearchTopicArray[iTopic] == 0) { SearchTopicArray[iTopic] = -1; } } // Now clear all -1s for topics associated with this keyword for (iTopic = 0; iTopic < nNumTopics; iTopic++) { if (SearchTopicArray[FtsDiv.gFtsKeywordArray[iFound].arrayTopics[iTopic]] == -1) { SearchTopicArray[FtsDiv.gFtsKeywordArray[iFound].arrayTopics[iTopic]] = 0; } } // Finally change all -1s to 1s for (iTopic = 0; iTopic < nTopicArrayLen; iTopic++) { if (SearchTopicArray[iTopic] == -1) { SearchTopicArray[iTopic] = 1; } } } } // If this was the first word change the operation to "and". We need to have it be // an "or" for the first keyword so we would add the items for the first search word. if (bFirstKeyword) { bFirstKeyword = false; nCurrentOp = 1; } } } var aSortedTopics = new Array(); var nNumSortTopics = 0; for (iSearch = 0; iSearch < nTopicArrayLen; iSearch++) { if (SearchTopicArray[iSearch]) { aSortedTopics[nNumSortTopics++] = iSearch; } } // Limit the number of topics in the result set if (nNumSortTopics > 75) { nNumSortTopics = 75; } // alert("Num Topics in Search array: " + nNumTopicsInSearch); // Sort the topics by title SortTopics(FtsDiv, aSortedTopics, 0, nNumSortTopics - 1); // Add hyperlinks for all of the found topics var strLine = ""; for (iSearch = 0; iSearch < nNumSortTopics; iSearch++) { i = aSortedTopics[iSearch]; if (i != -1) { strLine = "
"; strLine += FtsDiv.gFtsTopicArray[i].strTitle; strLine += "
"; strHtm += strLine; } } // Give a special message if none were found if (strHtm == "") { strHtm = "

No topics found.

" } else { strHtm = "

" + strHtm + "

"; } if (gbIE4) { layerFind.innerHTML = strHtm; } else if (gbNav4) { layerFind.write(strHtm); layerFind.close(); } return; } function FtsFindKeyword(strCurrentWord, aFtsKeywordArray, nKeywordArrayLen) { // Search for the current word in the array (binary search) // alert("search for: " + strCurrentWord); var nLow = 0; var nHigh = nKeywordArrayLen - 1; var nMid = 0; var bFound = false; var strKeyword = ""; while (nLow <= nHigh) { nMid = (nLow + nHigh); nMid >>= 1; strKeyword = aFtsKeywordArray[nMid].strKeyword; // alert("low: " + nLow + " high: " + nHigh + " mid: " + nMid); // alert("search: " + strCurrentWord + " Keyword: " + strKeyword); if (strCurrentWord > strKeyword) { nLow = (nLow == nMid) ? nMid + 1 : nMid; } else { if (strCurrentWord < strKeyword) { nHigh = (nHigh == nMid) ? nMid - 1: nMid; } else { bFound = true; break; } } } if (bFound) { return nMid; } else { return -1; } } // QuickSort function SortTopics(FtsDiv, SearchTopicArray, nStart, nEnd) { if (nEnd - nStart > 0) { var nLastLow = nStart; // Get the first value into its proper spot for (var i = nStart + 1; i <= nEnd; i++) { if ((SearchTopicArray[i] != -1) && (SearchTopicArray[nStart] != -1) && (FtsDiv.gFtsTopicArray[SearchTopicArray[i]].strTitle < FtsDiv.gFtsTopicArray[SearchTopicArray[nStart]].strTitle)) { nLastLow++; temp = SearchTopicArray[i]; SearchTopicArray[i] = SearchTopicArray[nLastLow]; SearchTopicArray[nLastLow] = temp; } } temp = SearchTopicArray[nStart]; SearchTopicArray[nStart] = SearchTopicArray[nLastLow]; SearchTopicArray[nLastLow] = temp; // Sort the two halves of this array surrounding the new spot for the first value SortTopics(FtsDiv, SearchTopicArray, nStart, nLastLow); SortTopics(FtsDiv, SearchTopicArray, nLastLow + 1, nEnd); } } function IsStopWord(strCurrentWord, aFtsStopArray, nStopArrayLen) { // Search for the current word in the array (binary search) var nLow = 0; var nHigh = nStopArrayLen - 1; var nMid = 0; var bFound = false; var strStopWord = ""; while (nLow <= nHigh) { nMid = (nLow + nHigh); nMid >>= 1; strStopWord = aFtsStopArray[nMid].strStopWord; if (strCurrentWord > strStopWord) { nLow = (nLow == nMid) ? nMid + 1 : nMid; } else { if (strCurrentWord < strStopWord) { nHigh = (nHigh == nMid) ? nMid - 1: nMid; } else { bFound = true; break; } } } if (bFound) { return true; } else { return false; } } ///////////////////////////////////////////////////////////// // // NOTE: If you change this function, you should also change // it in the FtsDatabase.CPP file // ///////////////////////////////////////////////////////////// function GetStem(szWord) { var aStems = new Array(); aStems[0] = "ed"; aStems[1] = "es"; aStems[2] = "er"; aStems[3] = "e"; aStems[4] = "s"; aStems[5] = "ingly"; aStems[6] = "ing"; aStems[7] = "ly"; // Loop through all the stems var nNumStems = aStems.length; var nStemPos = 0; var csStem = ""; var csSubString = ""; for (var iStem = 0; iStem < nNumStems; iStem++) { // Get the "would be" position of the stem in the word and see // if this word has the stem nStemPos = szWord.lastIndexOf(aStems[iStem]); if (nStemPos > 0) { csSubString = szWord.substring(nStemPos); if (csSubString == aStems[iStem]) { // Found a stem // Check for double consonant csStem = szWord; if (szWord.charAt(nStemPos - 2) == szWord.charAt(nStemPos - 1)) { csStem = csStem.substring(0, nStemPos - 1); } else { csStem = csStem.substring(0, nStemPos); } return csStem; } } } // No stem found csStem = szWord; return csStem; } //////////////////////////////////////////////////////////////////////////////////////////////// // // Navgation Bar Code // //////////////////////////////////////////////////////////////////////////////////////////////// function NavBar_SelectTOC() { var frameLeft = null if (gbNav4) { frameLeft = window.parent.left; } else { frameLeft = window.parent.frames("left"); } frameLeft.ChangeToTOC(); } function NavBar_SelectIndex() { var frameLeft = null if (gbNav4) { frameLeft = window.parent.left; } else { frameLeft = window.parent.frames("left"); } frameLeft.ChangeToIndex(); }