// Copyright (c) 2000-2003 Quadralay Corporation. All rights reserved.
//
function WWHRelatedTopics_Object()
{
this.mRelatedTopicList = new Array();
this.mPopup = new WWHPopup_Object("WWHFrame.WWHRelatedTopics.mPopup",
WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"),
WWHRelatedTopicsPopup_Translate,
WWHRelatedTopicsPopup_Format,
"WWHRelatedTopicsDIV", "WWHRelatedTopicsText", 10, 0, 0,
WWHFrame.WWHHelp.mSettings.mRelatedTopics.mWidth);
this.fHasRelatedTopics = WWHRelatedTopics_HasRelatedTopics;
this.fClear = WWHRelatedTopics_Clear;
this.fAdd = WWHRelatedTopics_Add;
this.fHTML = WWHRelatedTopics_HTML;
this.fDisplayTopic = WWHRelatedTopics_DisplayTopic;
this.fShow = WWHRelatedTopics_Show;
this.fShowAtEvent = WWHRelatedTopics_ShowAtEvent;
this.fHide = WWHRelatedTopics_Hide;
this.fInlineHTML = WWHRelatedTopics_InlineHTML;
this.fPopupHTML = WWHRelatedTopics_PopupHTML;
}
function WWHRelatedTopics_HasRelatedTopics()
{
var bVarHasRelatedTopics = false;
if (this.mRelatedTopicList.length > 0)
{
bVarHasRelatedTopics = true;
}
return bVarHasRelatedTopics;
}
function WWHRelatedTopics_Clear()
{
this.mRelatedTopicList.length = 0;
}
function WWHRelatedTopics_Add(ParamText,
ParamContext,
ParamFileURL)
{
this.mRelatedTopicList[this.mRelatedTopicList.length] = new WWHRelatedTopicEntry_Object(ParamText, ParamContext, ParamFileURL);
}
function WWHRelatedTopics_HTML()
{
var HTML = new WWHStringBuffer_Object();
var Settings = WWHFrame.WWHHelp.mSettings.mRelatedTopics;
var FontFamily = "";
var FontSize;
var MaxIndex;
var Index;
var ContextBook;
if ( ! WWHFrame.WWHBrowser.mbSupportsPopups)
{
// Determine font family if running Netscape 4.x
// Required due to errors processing style attributes
//
if (WWHFrame.WWHBrowser.mBrowser == 1) // Shorthand for Netscape 4.x
{
FontFamily = WWHStringUtilities_ExtractStyleAttribute("font-family", Settings.mInlineFontStyle);
FontSize = WWHStringUtilities_ExtractStyleAttribute("font-size", Settings.mInlineFontStyle);
}
}
for (MaxIndex = this.mRelatedTopicList.length, Index = 0 ; Index < MaxIndex ; Index++)
{
ContextBook = WWHFrame.WWHHelp.mBooks.fGetContextBook(this.mRelatedTopicList[Index].mContext);
if (ContextBook != null)
{
if (WWHFrame.WWHBrowser.mbSupportsPopups)
{
HTML.fAppend("
tags that are rewritten on the fly
//
if (WWHFrame.WWHBrowser.mBrowser == 4) // Shorthand for Netscape 6.x (Mozilla)
{
Spacer1w2h = "";
Spacer2w1h = "";
Spacer4w4h = "";
}
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer1w2h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer4w4h + WWHFrame.WWHHelp.mMessages.mRelatedTopicsIconLabel + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ParamText + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer1w2h + " | ";
FormattedText += "
";
FormattedText += "
";
return FormattedText;
}
function WWHALinks_Object()
{
this.mALinksHash = new Object();
this.mPopup = new WWHPopup_Object("WWHFrame.WWHALinks.mPopup",
WWHFrame.WWHHelp.fGetFrameReference("WWHDocumentFrame"),
WWHALinksPopup_Translate,
WWHALinksPopup_Format,
"WWHALinksDIV", "WWHALinksText", 10, 0, 0,
WWHFrame.WWHHelp.mSettings.mALinks.mWidth);
this.mALinks = new Array();
this.mbSingle = false;
this.fAdd = WWHALinks_Add;
this.fA = WWHALinks_Add;
this.fSetALinks = WWHALinks_SetALinks;
this.fHTML = WWHALinks_HTML;
this.fGotoALink = WWHALinks_GotoALink;
this.fShow = WWHALinks_Show;
this.fHide = WWHALinks_Hide;
this.fInlineHTML = WWHALinks_InlineHTML;
this.fPopupHTML = WWHALinks_PopupHTML;
}
function WWHALinks_Add(ParamKeyword,
ParamALinksArray)
{
var VarALinksEntry;
// Access alink entry
//
VarALinksEntry = this.mALinksHash[ParamKeyword + "~"];
if ((typeof(VarALinksEntry) == "undefined") ||
(VarALinksEntry == null))
{
VarALinksEntry = new WWHALinksEntry_Object();
this.mALinksHash[ParamKeyword + "~"] = VarALinksEntry;
}
// Add links
//
VarALinksEntry.fAddLinks(WWHFrame.WWHHelp.mBooks.mInitIndex, ParamALinksArray);
}
function WWHALinks_SetALinks(ParamKeywordsArray)
{
var bVarFirstLink = true;
var VarMaxIndex;
var VarIndex;
var VarKeyword;
var VarALinksEntry;
var VarMaxBookLinksIndex;
var VarBookLinksIndex;
var VarBookLinks;
var VarCheckHashArray = new Array();
var VarALinkEntry;
var VarCheckHash;
var VarMaxLinkIndex;
var VarLinkIndex;
var VarCheckLink;
// Reset alinks info
//
this.mALinks = new Array();
this.mbSingle = false;
// Get links for each keyword
//
for (VarMaxIndex = ParamKeywordsArray.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
{
VarKeyword = ParamKeywordsArray[VarIndex];
// Get keyword links
//
VarALinksEntry = this.mALinksHash[VarKeyword + "~"];
if ((typeof(VarALinksEntry) != "undefined") &&
(VarALinksEntry != null))
{
// Add links
//
for (VarMaxBookLinksIndex = VarALinksEntry.mBookLinks.length, VarBookLinksIndex = 0 ; VarBookLinksIndex < VarMaxBookLinksIndex ; VarBookLinksIndex++)
{
// Access book info
//
VarBookLinks = VarALinksEntry.mBookLinks[VarBookLinksIndex];
// Access book entries
//
while (this.mALinks.length <= VarBookLinks.mBookIndex)
{
this.mALinks[this.mALinks.length] = new Array();
VarCheckHashArray[VarCheckHashArray.length] = new Object();
}
VarALinkEntry = this.mALinks[VarBookLinks.mBookIndex];
VarCheckHash = VarCheckHashArray[VarBookLinks.mBookIndex];
// Add entries
//
for (VarMaxLinkIndex = VarBookLinks.mLinks.length, VarLinkIndex = 0 ; VarLinkIndex < VarMaxLinkIndex ; VarLinkIndex++)
{
// Confirm link will not be added more than once per book
//
VarCheckLink = VarCheckHash[VarBookLinks.mLinks[VarLinkIndex] + "~"];
if ((typeof(VarCheckLink) == "undefined") ||
(VarCheckLink == null))
{
// Add the link
//
VarALinkEntry[VarALinkEntry.length] = VarBookLinks.mLinks[VarLinkIndex];
VarCheckHash[VarBookLinks.mLinks[VarLinkIndex] + "~"] = "1";
// Single link?
//
if (bVarFirstLink)
{
this.mbSingle = true;
bVarFirstLink = false;
}
else
{
this.mbSingle = false;
}
}
}
}
}
}
}
function WWHALinks_HTML(bParamReplace)
{
var VarHTML = new WWHStringBuffer_Object();
var VarImageDirectory = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
var VarSettings = WWHFrame.WWHHelp.mSettings.mALinks;
var VarFontFamily = "";
var VarFontSize;
var VarMaxIndex;
var VarIndex;
var VarLinks;
var VarLink;
var VarParts;
var VarLinkFileIndex;
// Get font information
//
if ( ! WWHFrame.WWHBrowser.mbSupportsPopups)
{
// Determine font family if running Netscape 4.x
// Required due to errors processing style attributes
//
if (WWHFrame.WWHBrowser.mBrowser == 1) // Shorthand for Netscape 4.x
{
VarFontFamily = WWHStringUtilities_ExtractStyleAttribute("font-family", VarSettings.mInlineFontStyle);
VarFontSize = WWHStringUtilities_ExtractStyleAttribute("font-size", VarSettings.mInlineFontStyle);
}
}
// Format and display as HTML
//
VarHTML.fReset();
for (VarMaxIndex = this.mALinks.length, VarIndex = 0; VarIndex < VarMaxIndex ; VarIndex++)
{
VarLinks = this.mALinks[VarIndex];
if (VarLinks.length > 0)
{
// Emit book title
//
if (VarSettings.mbShowBook)
{
// Emit the book title
//
VarHTML.fAppend("
");
VarHTML.fAppend("");
VarHTML.fAppend("");
VarHTML.fAppend("");
VarHTML.fAppend(" | ");
VarHTML.fAppend("");
VarHTML.fAppend("");
VarHTML.fAppend(WWHFrame.WWHHelp.mBooks.fGetBookTitle(VarIndex));
VarHTML.fAppend("");
VarHTML.fAppend(" | ");
VarHTML.fAppend("
");
VarHTML.fAppend("
\n");
// Open indentation
//
VarHTML.fAppend("
\n");
}
for (VarMaxLinkIndex = VarLinks.length, VarLinkIndex = 0 ; VarLinkIndex < VarMaxLinkIndex ; VarLinkIndex++)
{
// Get link info
//
VarLink = VarLinks[VarLinkIndex];
VarParts = VarLink.split("#");
VarLinkFileIndex = parseInt(VarParts[0]);
// Emit link entry
//
VarHTML.fAppend("
\n");
}
if (VarSettings.mbShowBook)
{
// Close indendation
//
VarHTML.fAppend("
\n");
}
}
}
return VarHTML.fGetBuffer();
}
function WWHALinks_GotoALink(ParamBookIndex,
ParamLinkIndex,
bParamReplace)
{
var VarLinks;
var VarLink;
var VarParts;
var VarLinkFileIndex;
var VarLinkAnchor;
var VarDocumentURL;
// Hide popup to prevent JavaScript errors before displaying target document
//
if (WWHFrame.WWHBrowser.mbSupportsPopups)
{
this.fHide();
}
// Determine document URL
//
VarLinks = this.mALinks[ParamBookIndex];
VarLink = VarLinks[ParamLinkIndex];
VarParts = VarLink.split("#");
VarLinkFileIndex = parseInt(VarParts[0]);
VarLinkAnchor = null;
if (VarParts.length > 1)
{
if (VarParts[1].length > 0)
{
VarLinkAnchor = VarParts[1];
}
}
VarDocumentURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(ParamBookIndex, VarLinkFileIndex, VarLinkAnchor);
// Reset alinks list
//
this.mALinks = new Array();
this.mbSingle = false;
// Goto document
//
WWHFrame.WWHHelp.fSetDocumentHREF(VarDocumentURL, bParamReplace);
}
function WWHALinks_Show(ParamKeywordArray,
ParamEvent)
{
var VarMaxIndex;
var VarIndex;
var VarLinks;
var VarALinksHTML;
// Set alinks for given keywords
//
this.fSetALinks(ParamKeywordArray);
if (this.mALinks.length > 0)
{
if (this.mbSingle)
{
// Just go to single target
//
for (VarMaxIndex = this.mALinks.length, VarIndex = 0 ; VarIndex < VarMaxIndex ; VarIndex++)
{
VarLinks = this.mALinks[VarIndex];
if (VarLinks.length > 0)
{
// Display single link
//
this.fGotoALink(VarIndex, 0, false);
// Exit loop
//
VarIndex = VarMaxIndex;
}
}
}
else
{
if (WWHFrame.WWHBrowser.mbSupportsPopups)
{
// Show popup
//
VarALinksHTML = this.fHTML(false);
if (VarALinksHTML.length > 0)
{
this.mPopup.fShow(VarALinksHTML, ParamEvent);
}
}
else
{
// Display selection page in browser window
//
WWHFrame.WWHHelp.fSetDocumentHREF(WWHFrame.WWHHelp.mBaseURL + "wwhelp/wwhimpl/common/html/alinks.htm", false);
}
}
}
}
function WWHALinks_Hide()
{
this.mPopup.fHide();
}
function WWHALinks_InlineHTML()
{
var VarHTML = new WWHStringBuffer_Object();
var VarSettings = WWHFrame.WWHHelp.mSettings.mALinks;
var ImageDir = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
var BackgroundColor = VarSettings.mBackgroundColor;
var BorderColor = VarSettings.mBorderColor;
var TitleForegroundColor = VarSettings.mTitleForegroundColor;
var TitleBackgroundColor = VarSettings.mTitleBackgroundColor;
var ReqSpacer1w2h = "
";
var ReqSpacer2w1h = "
";
var ReqSpacer4w4h = "
";
var Spacer1w2h = ReqSpacer1w2h;
var Spacer2w1h = ReqSpacer2w1h;
var Spacer4w4h = ReqSpacer4w4h;
VarHTML.fReset();
// Netscape 6.x (Mozilla) renders table cells with graphics
// incorrectly inside of
tags that are rewritten on the fly
//
if (WWHFrame.WWHBrowser.mBrowser == 4) // Shorthand for Netscape 6.x (Mozilla)
{
Spacer1w2h = "";
Spacer2w1h = "";
Spacer4w4h = "";
}
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer1w2h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + ReqSpacer2w1h + " | ");
VarHTML.fAppend(" " + ReqSpacer4w4h + " | ");
VarHTML.fAppend(" " + ReqSpacer4w4h + WWHFrame.WWHHelp.mMessages.mSeeAlsoLabel + " | ");
VarHTML.fAppend(" " + ReqSpacer4w4h + " | ");
VarHTML.fAppend(" " + ReqSpacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + ReqSpacer2w1h + " | ");
VarHTML.fAppend(" " + ReqSpacer4w4h + " | ");
VarHTML.fAppend(" " + WWHFrame.WWHALinks.fHTML(true) + " | ");
VarHTML.fAppend(" " + ReqSpacer4w4h + " | ");
VarHTML.fAppend(" " + ReqSpacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend(" " + Spacer4w4h + " | ");
VarHTML.fAppend(" " + Spacer2w1h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend(" ");
VarHTML.fAppend(" " + Spacer1w2h + " | ");
VarHTML.fAppend("
");
VarHTML.fAppend("
");
return VarHTML.fGetBuffer();
}
function WWHALinks_PopupHTML()
{
var VarHTML = "";
if (WWHFrame.WWHBrowser.mbSupportsPopups)
{
VarHTML = this.mPopup.fDivTagText();
}
return VarHTML;
}
function WWHALinksPopup_Translate(ParamText)
{
return ParamText;
}
function WWHALinksPopup_Format(ParamWidth,
ParamTextID,
ParamText)
{
var FormattedText = "";
var VarSettings = WWHFrame.WWHHelp.mSettings.mALinks;
var ImageDir = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
var BackgroundColor = VarSettings.mBackgroundColor;
var BorderColor = VarSettings.mBorderColor;
var TitleForegroundColor = VarSettings.mTitleForegroundColor;
var TitleBackgroundColor = VarSettings.mTitleBackgroundColor;
var ReqSpacer1w2h = "
";
var ReqSpacer2w1h = "
";
var ReqSpacer4w4h = "
";
var Spacer1w2h = ReqSpacer1w2h;
var Spacer2w1h = ReqSpacer2w1h;
var Spacer4w4h = ReqSpacer4w4h;
// Netscape 6.x (Mozilla) renders table cells with graphics
// incorrectly inside of
tags that are rewritten on the fly
//
if (WWHFrame.WWHBrowser.mBrowser == 4) // Shorthand for Netscape 6.x (Mozilla)
{
Spacer1w2h = "";
Spacer2w1h = "";
Spacer4w4h = "";
}
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer1w2h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer4w4h + WWHFrame.WWHHelp.mMessages.mSeeAlsoLabel + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ParamText + " | ";
FormattedText += " " + ReqSpacer4w4h + " | ";
FormattedText += " " + ReqSpacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += " " + Spacer4w4h + " | ";
FormattedText += " " + Spacer2w1h + " | ";
FormattedText += "
";
FormattedText += " ";
FormattedText += " " + Spacer1w2h + " | ";
FormattedText += "
";
FormattedText += "
";
return FormattedText;
}
function WWHALinksEntry_Object()
{
this.mBookLinks = new Array();
this.fAddLinks = WWHALinksEntry_AddLinks;
}
function WWHALinksEntry_AddLinks(ParamBookIndex,
ParamLinksArray)
{
var VarBookLinks;
VarBookLinks = new WWHALinksBookLinks_Object(ParamBookIndex, ParamLinksArray);
this.mBookLinks[this.mBookLinks.length] = VarBookLinks;
}
function WWHALinksBookLinks_Object(ParamBookIndex,
ParamLinksArray)
{
this.mBookIndex = ParamBookIndex;
this.mLinks = ParamLinksArray;
}