// Copyright (c) 2000-2003 Quadralay Corporation. All rights reserved.
//
function WWHTabs_Object(ParamPanels)
{
this.mWidth = null;
this.fReload = WWHTabs_Reload;
this.fHeadHTML = WWHTabs_HeadHTML;
this.fBodyHTML = WWHTabs_BodyHTML;
this.fLoaded = WWHTabs_Loaded;
// Calculate width based on number of panels
//
if (ParamPanels > 0)
{
this.mWidth = "" + (100 / ParamPanels) + "%";
}
}
function WWHTabs_Reload()
{
WWHFrame.WWHHelp.fReplaceLocation("WWHTabsFrame", WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/js/html/tabs.htm");
}
function WWHTabs_HeadHTML()
{
var StylesHTML = "";
// Generate style section
//
StylesHTML += "\n";
return StylesHTML;
}
function WWHTabs_BodyHTML()
{
var TabsHTML = "";
var ImageDir = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/js/images";
var MaxIndex;
var Index;
var VarTabTitle;
var VarAccessibilityTitle = "";
var CellType;
var WrapPrefix;
var WrapSuffix;
var StyleAttribute;
var OnClick;
var ImgSuffix;
var TableWidth;
// Set style attribute to insure small image height
//
StyleAttribute = " style=\"font-size: 1px; line-height: 1px;\"";
// Force on one line with a table, except for Netscape 4.x
//
if (WWHFrame.WWHBrowser.mBrowser != 1) // Shorthand for Netscape
{
TabsHTML += "
\n";
TabsHTML += "";
}
// Tabs
//
for (MaxIndex = WWHFrame.WWHJavaScript.mPanels.mPanelEntries.length, Index = 0 ; Index < MaxIndex ; Index++)
{
// Get tab title
//
VarTabTitle = WWHFrame.WWHJavaScript.mPanels.mPanelEntries[Index].mPanelObject.mPanelTabTitle;
// Display anchor only if not selected
//
if (Index == WWHFrame.WWHJavaScript.mCurrentTab)
{
// Determine title for accessibility
//
if (WWHFrame.WWHHelp.mbAccessible)
{
VarAccessibilityTitle = WWHStringUtilities_FormatMessage(WWHFrame.WWHJavaScript.mMessages.mAccessibilityActiveTab,
VarTabTitle);
VarAccessibilityTitle = " title=\"" + WWHStringUtilities_EscapeHTML(VarAccessibilityTitle) + "\"";
}
CellType = "th";
WrapPrefix = "";
WrapSuffix = "";
OnClick = "";
ImgSuffix = "";
}
else
{
// Determine title for accessibility
//
if (WWHFrame.WWHHelp.mbAccessible)
{
VarAccessibilityTitle = WWHStringUtilities_FormatMessage(WWHFrame.WWHJavaScript.mMessages.mAccessibilityInactiveTab,
VarTabTitle);
VarAccessibilityTitle = " title=\"" + WWHStringUtilities_EscapeHTML(VarAccessibilityTitle) + "\"";
}
CellType = "td";
WrapPrefix = "";
WrapSuffix = "";
OnClick = " onclick=\"WWHFrame.WWHJavaScript.fClickedChangeTabWithDelay(" + Index + ");\"";
ImgSuffix = "x";
}
// Force on one line with a table, except for Netscape 4.x
//
if (WWHFrame.WWHBrowser.mBrowser != 1) // Shorthand for Netscape
{
TabsHTML += "";
}
// Force on one line with a table, except for Netscape 4.x
//
if (WWHFrame.WWHBrowser.mBrowser == 1) // Shorthand for Netscape
{
TableWidth = this.mWidth;
}
else
{
TableWidth = "100%";
}
TabsHTML += "";
// Top spacer
//
TabsHTML += ""
TabsHTML += " | ";
TabsHTML += " "
// Top row
//
TabsHTML += "";
if (Index == 0)
{
TabsHTML += " | \n";
}
else
{
TabsHTML += " | \n";
}
TabsHTML += " | \n";
TabsHTML += " | \n";
TabsHTML += " | \n";
if ((Index + 1) == MaxIndex)
{
TabsHTML += " | \n";
}
TabsHTML += " ";
// Middle row
//
TabsHTML += "";
if (Index == 0)
{
TabsHTML += " | \n";
}
else
{
TabsHTML += " | \n";
}
TabsHTML += " | \n";
TabsHTML += "<" + CellType + " background=\"" + ImageDir + "/btn_bg" + ImgSuffix + ".gif\" nowrap align=\"center\" width=\"100%\"" + OnClick + ">";
TabsHTML += WrapPrefix;
TabsHTML += VarTabTitle;
TabsHTML += WrapSuffix;
TabsHTML += "" + CellType + ">";
TabsHTML += " | \n";
if ((Index + 1) == MaxIndex)
{
TabsHTML += " | \n";
}
TabsHTML += " ";
// Bottom row
//
TabsHTML += "";
if (Index == 0)
{
TabsHTML += " | \n";
}
else
{
TabsHTML += " | \n";
}
TabsHTML += " | \n";
TabsHTML += " | \n";
TabsHTML += " | \n";
if ((Index + 1) == MaxIndex)
{
TabsHTML += " | \n";
}
TabsHTML += " ";
TabsHTML += " ";
// Force on one line with a table, except for Netscape 4.x
//
if (WWHFrame.WWHBrowser.mBrowser != 1) // Shorthand for Netscape
{
TabsHTML += " | \n";
}
}
// Force on one line with a table, except for Netscape 4.x
//
if (WWHFrame.WWHBrowser.mBrowser != 1) // Shorthand for Netscape
{
TabsHTML += "
\n";
TabsHTML += "
\n";
}
return TabsHTML;
}
function WWHTabs_Loaded()
{
// Set frame name for accessibility
//
if (WWHFrame.WWHHelp.mbAccessible)
{
WWHFrame.WWHHelp.fSetFrameName("WWHTabsFrame");
}
// Display requested panel
//
WWHFrame.WWHJavaScript.mPanels.fChangePanel(WWHFrame.WWHJavaScript.mCurrentTab);
}