";
//HTMLStr += "
";
if (!RTL){
//HTMLStr = "
";
HTMLStr += "";
HTMLStr += "";
}
HTMLStr += "" +
"
";
// Define event handlers
if(!RTL){
window.onresize = resizeToolbar;
window.onscroll = scrollbaroptions;
}
// Intialize global variables
ToolbarBGColor = "white"; // toolbar background color
if (Strict_Compat)
{
MSFont = "bold x-small Arial";
ICPFont = "bold x-small Verdana";
}
else
{
if( !RTL ){
MSFont = "xx-small Verdana";
ICPFont = "bold xx-small Verdana";
}else if(RTL){
MSFont = "x-small Arial"; // RTL Correction: (was Verdana)
ICPFont = "bold x-small Arial"; // RTL Correction: (was Verdana)
//MNP1 RTL revision
MSFTFont = "11px Arial";
ICPFTFont = "bold 11px Arial"
//end
}
}
aDefMSColor[0] = aCurMSColor[0] = "black"; // bgcolor;
aDefMSColor[1] = aCurMSColor[1] = "white"; // text font color
aDefMSColor[2] = aCurMSColor[2] = "red"; // mouseover font color
aDefICPColor[0] = aCurICPColor[0] = "#6699CC"; // bgcolor;
aDefICPColor[1] = aCurICPColor[1] = "white"; // text font color
aDefICPColor[2] = aCurICPColor[2] = "red"; // mouseover font color
}
// The hard-coded numbers in functions - drawToolbar() & resizeToolbar()
// correspond to the dimension of the four gif files:
// ICP_BANNER: 60h x 250w
// ADS_BANNER: 40h x 200w
// MSC_BANNER: 40h x 112w
// Curve: 20h x 18w
function drawFooter(sLastUpdated, position)
{
if(!RTL){
var re = "";
var sUpdatedDate = "";
if (ToolbarBGColor.toUpperCase() == "WHITE" || ToolbarBGColor.toUpperCase() == "#FFFFFF")
{
while (FooterStr.indexOf(re) != -1)
FooterStr = FooterStr.replace(re, "000000");
}
else
{
while (FooterStr.indexOf(re) != -1)
FooterStr = FooterStr.replace(re, aDefICPColor[1]);
}
var re2 = "";
while (FooterStr.indexOf(re2) != -1)
FooterStr = FooterStr.replace(re2, aDefICPColor[2]);
}else if (RTL){
var re = //g;
var sUpdatedDate = "";
if (ToolbarBGColor.toUpperCase() == "WHITE" || ToolbarBGColor.toUpperCase() == "#FFFFFF")
FooterStr = FooterStr.replace(re, "000000");
else
FooterStr = FooterStr.replace(re, aDefICPColor[1]);
var re2 = //g;
FooterStr = FooterStr.replace(re2, aDefICPColor[2]);
}
sUpdatedDate = ""
if (typeof sLastUpdated != "undefined")
sUpdatedDate += sLastUpdated;
sUpdatedDate += "";
FooterStr = FooterStr.replace("", sUpdatedDate);
document.body.innerHTML += FooterStr;
idFooterRow1.style.backgroundColor = aDefICPColor[0];
idFooterRow2.style.backgroundColor = ToolbarBGColor;
if (typeof sLastUpdated == "undefined")
idFooter1.style.display = "none";
if (typeof position != "undefined")
idPosition.width = position;
}
function drawToolbar()
{
HTMLStr += "
";
document.write(HTMLStr);
ToolbarLoaded = true;
MSMenuWidth = Math.max(idMSMenuPane.offsetWidth, (200+112));
ToolbarMinWidth = (250+18) + MSMenuWidth;
idToolbar.style.backgroundColor = ToolbarBGColor;
idMSMenuPane.style.backgroundColor = aDefMSColor[0];
idICPMenuPane.style.backgroundColor = aDefICPColor[0];
if (RTL){
idMSMenuPane.style.color = aDefMSColor[1];
idICPMenuPane.style.color = aDefICPColor[1];
}
resizeToolbar();
for (i = 0; i < TotalMenu; i++)
{
thisMenu = document.all(arrMenuInfo[i].IDStr);
if (thisMenu != null)
{
if (arrMenuInfo[i].IDStr == LastMSMenu && arrMenuInfo[i].type == "R")
{
//Last MSMenu has to be absolute width
arrMenuInfo[i].type = "A";
arrMenuInfo[i].unit = 200;
}
if (arrMenuInfo[i].type == "A")
if(!RTL){
thisMenu.style.width = arrMenuInfo[i].unit + 'px';
}else{
thisMenu.style.width = arrMenuInfo[i].unit;
}
else
thisMenu.style.width = Math.round(arrMenuInfo[i].width * arrMenuInfo[i].unit) + 'em';
}
}
}
function resizeToolbar()
{
scFlag = false;
scrollcount = 0;
if (ToolBar_Supported == false) return;
w = Math.max(ToolbarMinWidth, document.body.clientWidth) - ToolbarMinWidth;
if ( !RTL ){
if (document.all("idMSMenuCurve"))
{
idMSMenuCurve.style.left = (250+w) + 'px';
idMSMenuPane.style.left = (250+w+18) + 'px';
idMSMenuPane.style.width = MSMenuWidth + 'px';
idADSBanner.style.left = (w+18) + 'px';
idMSCBanner.style.left = (w+18+200) + 'px';
idMSCBanner.style.width = (MSMenuWidth - 200) + 'px';
idICPMenuPane.style.width = ToolbarMinWidth + w + 'px';
}
}else if( RTL ){
idMSMenuCurve.style.left = MSMenuWidth; // RTL Correction: was (250+w);
idMSMenuPane.style.left = 0; // RTL Correction: was (250+w+18);
idMSMenuPane.style.width = MSMenuWidth;
idADSBanner.style.left = 112; // RTL Correction: was (w+18);
idMSCBanner.style.left = 0; // RTL Correction: was (w+18+200);
idMSCBanner.style.width = (MSMenuWidth - 200);
idICPMenuPane.style.width = ToolbarMinWidth + w;
idICPBanner.style.left = MSMenuWidth + 18 + w; // RTL Correction: line added for ICPBanner positioning
}
}
function setToolbarBGColor(color)
{
ToolbarBGColor = color;
if (ToolbarLoaded == true)
idToolbar.style.backgroundColor = ToolbarBGColor;
}
function setBannerColor(bannerColor, bgColor, fontColor, mouseoverColor)
{
if (bannerColor.toUpperCase() != "WHITE" && bannerColor.toUpperCase() != "FFFFFF")
bgColor = bannerColor;
setToolbarBGColor(bannerColor);
setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor);
}
function setMSMenuFont(sFont)
{
MSFont = sFont;
}
function setICPMenuFont(sFont)
{
ICPFont = sFont;
}
function setDefaultMSMenuColor(bgColor, fontColor, mouseoverColor)
{
if (bgColor != "") aDefMSColor[0] = bgColor;
if (fontColor != "") aDefMSColor[1] = fontColor;
if (mouseoverColor != "") aDefMSColor[2] = mouseoverColor;
}
function setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor)
{
if (bgColor != "") aDefICPColor[0] = bgColor;
if (fontColor != "") aDefICPColor[1] = fontColor;
if (mouseoverColor != "") aDefICPColor[2] = mouseoverColor;
}
function setICPMenuColor(MenuIDStr, bgColor, fontColor, mouseoverColor)
{
if (ToolbarLoaded == false) return;
// Reset previous ICP Menu color if any
if (CurICPMenu != "")
{
PrevID = CurICPMenu.substring(4);
CurICPMenu = "";
setICPMenuColor(PrevID, aDefICPColor[0], aDefICPColor[1], aDefICPColor[2]);
}
var id = "AM_" + "ICP_" + MenuIDStr;
var thisMenu = document.all(id);
if (thisMenu != null)
{
CurICPMenu = "ICP_" + MenuIDStr;
aCurICPColor[0] = bgColor;
aCurICPColor[1] = fontColor;
aCurICPColor[2] = mouseoverColor;
// Change menu color
if (bgColor != "")
thisMenu.style.backgroundColor = bgColor;
if (fontColor != "")
thisMenu.style.color = fontColor;
// Change subMenu color
id = "ICP_" + MenuIDStr;
thisMenu = document.all(id);
if (thisMenu != null)
{
if (bgColor != "")
thisMenu.style.backgroundColor = bgColor;
if (fontColor != "")
{
i = 0;
id = "AS_" + "ICP_" + MenuIDStr;
thisMenu = document.all.item(id,i);
while (thisMenu != null)
{
thisMenu.style.color = fontColor;
i += 1;
thisMenu = document.all.item(id,i);
}
}
}
}
}
function setAds(Gif,Url,AltStr)
{ setBanner(Gif,Url,AltStr,"","");
}
function setICPBanner(Gif,Url,AltStr)
{
if(RTL){
if (Gif.indexOf("training_banner_training.gif") > 0){
Gif = "training_banner_training.gif";
}
}
setBanner(Gif,Url,AltStr,"","");
}
function setMSBanner(Gif,Url,AltStr)
{ tempGif = "http://www.microsoft.com/library/toolbar/images/" + Gif;
setBanner(tempGif,Url,AltStr,"","");
}
function setBanner(BanGif, BanUrl, BanAltStr, BanBegTag, BanEndTag)
{
begPos = HTMLStr.indexOf(BanBegTag);
endPos = HTMLStr.indexOf(BanEndTag) + BanEndTag.length;
SubStr = HTMLStr.substring(begPos, endPos);
SrcStr = "";
if (BanUrl != "")
SrcStr += "
";
SrcStr += "";
if (BanUrl != "")
SrcStr += "";
SrcStr = BanBegTag + SrcStr + BanEndTag;
HTMLStr = HTMLStr.replace(SubStr, SrcStr);
}
function setICPSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
{ tempID = "ICP_" + MenuIDStr;
setSubMenuWidth(tempID, WidthType, WidthUnit);
}
function setMSSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
{ tempID = "MS_" + MenuIDStr;
setSubMenuWidth(tempID, WidthType, WidthUnit);
}
function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
{
var fFound = false;
if (TotalMenu == MaxMenu)
{
alert("Unable to process menu. Maximum of " + MaxMenu + " reached.");
return;
}
for (i = 0; i < TotalMenu; i++)
if (arrMenuInfo[i].IDStr == MenuIDStr)
{
fFound = true;
break;
}
if (!fFound)
{
arrMenuInfo[i] = new menuInfo(MenuIDStr);
TotalMenu += 1;
}
if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1)
{
arrMenuInfo[i].type = "A";
arrMenuInfo[i].unit = 160;
}
else
{
arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R";
arrMenuInfo[i].unit = WidthUnit;
}
}
// This function creates a menuInfo object instance.
function menuInfo(MenuIDStr)
{
this.IDStr = MenuIDStr;
this.type = "";
this.unit = 0;
this.width = 0;
this.count = 0;
}
function updateSubMenuWidth(MenuIDStr)
{
for (i = 0; i < TotalMenu; i++)
if (arrMenuInfo[i].IDStr == MenuIDStr)
{
if (arrMenuInfo[i].width < MenuIDStr.length)
arrMenuInfo[i].width = MenuIDStr.length;
arrMenuInfo[i].count = arrMenuInfo[i].count + 1;
break;
}
}
function addICPMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
{
if(RTL){
if (LastICPMenu == "") HTMLStr = HTMLStr.replace("", TBLStr);
}
if (addICPMenu.arguments.length > 4)
TargetStr = addICPMenu.arguments[4];
else
TargetStr = "_top";
tempID = "ICP_" + MenuIDStr;
addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, true);
if (RTL){
LastICPMenu = tempID;
}else{
bFstICPTBMenu=false;
}
}
function addMSMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
{
TargetStr = "_top";
tempID = "MS_" + MenuIDStr;
//alert(" TempID: " + tempID + " MenuDisplayString: " + MenuDisplayStr + " Menu Help String :" + MenuHelpStr + " MenuUrl:" + MenuURLStr + " Target:" + TargetStr);
addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, false);
LastMSMenu = tempID;
}
function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, bICPMenu)
{
cFont = bICPMenu? ICPFont : MSFont;
cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
if (RTL){
cStyle = "font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";";
if (MenuHelpStr == "") MenuHelpStr = MenuDisplayStr; // Shailr. This line should have been before the line MenuStr = newLineChar; but I am tryig to avoid another if..else
}
tagStr = bICPMenu? "" : "";
MenuStr = newLineChar;
if (!RTL){
if ((bICPMenu == false && LastMSMenu != "") || (bICPMenu == true && bFstICPTBMenu==false))
MenuStr += "
| ";
MenuStr += "";
MenuStr += tagStr;
}
if ( RTL ){
if (bICPMenu)
MenuStr += "
| | ";
else
MenuStr += "";
MenuStr += tagStr;
}
HTMLStr = HTMLStr.replace(tagStr, MenuStr);
setSubMenuWidth(MenuIDStr,"default",0);
}
function addICPSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
{
if (addICPSubMenu.arguments.length > 3)
TargetStr = addICPSubMenu.arguments[3];
else
TargetStr = "_top";
tempID = "ICP_" + MenuIDStr;
addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,true);
}
function addMSSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
{
TargetStr = "_top";
tempID = "MS_" + MenuIDStr;
//alert("TempID: " + tempID + "\nSubMenuStr: " + SubMenuStr + "\n SubMenuURLStr: " + SubMenuURLStr + "\n TargetStr: " + TargetStr);
addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,false);
}
function addSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, TargetStr, bICPMenu)
{
cFont = bICPMenu? ICPFont : MSFont;
cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU");
if (MenuPos == -1) { MenuPos = MenuIDStr.length; }
InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "|" + SubMenuStr;
URLStr = formatURL(SubMenuURLStr, InstrumentStr);
var LookUpTag = "";
var sPos = HTMLStr.indexOf(LookUpTag);
if (sPos <= 0)
{
HTMLStr += newLineChar + newLineChar +
"