Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

899 lines
25 KiB

  1. var ToolBar_Supported = false;
  2. var Frame_Supported = false;
  3. var DoInstrumentation = false;
  4. var doImage = doImage;
  5. var TType = TType;
  6. if (navigator.userAgent.indexOf("MSIE") != -1 &&
  7. navigator.userAgent.indexOf("Windows") != -1 &&
  8. navigator.appVersion.substring(0,1) > 3)
  9. {
  10. ToolBar_Supported = true;
  11. }
  12. if(doImage == null)
  13. {
  14. var a= new Array();
  15. a[0] = prepTrackingString(window.location.hostname,7);
  16. if (TType == null)
  17. {
  18. a[1] = prepTrackingString('PV',8);
  19. }
  20. else
  21. {
  22. a[1] = prepTrackingString(TType,8);
  23. }
  24. a[2] = prepTrackingString(window.location.pathname,0);
  25. if(window.location.search != '')
  26. {
  27. a[a.length] = prepTrackingString(window.location.search,1);
  28. }
  29. if( '' != window.document.referrer)
  30. {
  31. a[a.length] = prepTrackingString(window.document.referrer,5);
  32. }
  33. if (navigator.userAgent.indexOf("SunOS") == -1 && navigator.userAgent.indexOf("Linux") == -1)
  34. {
  35. buildIMG(a);
  36. }
  37. }
  38. if (ToolBar_Supported)
  39. {
  40. var newLineChar = String.fromCharCode(10);
  41. var char34 = String.fromCharCode(34);
  42. var LastMSMenu = "";
  43. var CurICPMenu = "";
  44. var IsMSMenu = false;
  45. var IsMenuDropDown = true;
  46. var HTMLStr;
  47. var FooterStr;
  48. var x = 0;
  49. var y = 0;
  50. var x2 = 0;
  51. var y2 = 0;
  52. var MSMenuWidth;
  53. var ToolbarMinWidth;
  54. var ToolbarMenu;
  55. var ToolbarBGColor;
  56. var ToolbarLoaded = false;
  57. var aDefMSColor = new Array(3);
  58. var aDefICPColor = new Array(3);
  59. var aCurMSColor = new Array(3);
  60. var aCurICPColor = new Array(3);
  61. var MSFont;
  62. var ICPFont;
  63. var MaxMenu = 30;
  64. var TotalMenu = 0;
  65. var arrMenuInfo = new Array(30);
  66. var bFstICPTBMenu = true;
  67. var bFstICPFTMenu = true;
  68. var HTMLStr2;
  69. // Output style sheet and toolbar ID
  70. document.write("<SPAN ID='StartMenu' STYLE='display:none;'></SPAN>");
  71. // Build Footer template
  72. FooterStr = "<TABLE ID='idFooter1' STYLE='background-color:white;' cellSpacing='0' cellPadding='0' border='0'>" +
  73. "<TR VALIGN='BOTTOM'><TD ID='idPosition' WIDTH='185'>&nbsp;</TD><TD ID='idFooterDate1' STYLE='background-color:white;height:30' NOWRAP><!--ICP_FOOTERDATE1_TITLES--></TD></TR>" +
  74. "<TR VALIGN='BOTTOM'><TD COLSPAN='2' ID='idFooterDate2' STYLE='background-color:white;height:13;width:100%' NOWRAP><!--ICP_FOOTERDATE2_TITLES--></TD></TR>" +
  75. "</TABLE><TABLE ID='idFooter' STYLE='background-color:white;width:100%' cellSpacing='0' cellPadding='0' border='0'>" +
  76. "<TR VALIGN='MIDDLE'><TD ID='idFooterRow1' STYLE='background-color:white;height:20;width:100%' NOWRAP><!--ICP_FOOTERMENU_TITLES--></TD></TR>" +
  77. "<TR VALIGN='MIDDLE'><TD ID='idFooterRow2' STYLE='background-color:white;height:30;width:100%' NOWRAP><!--MS_FOOTERMENU_TITLES--></TD></TR>" +
  78. "</TABLE>";
  79. // Build toolbar template
  80. HTMLStr =
  81. "<DIV ID='idToolbar' STYLE='background-color:white;width:100%'>" +
  82. "<DIV ID='idRow1' STYLE='position:relative;height:20;'>" +
  83. "<DIV ID='idICPBanner' STYLE='position:absolute;top:0;left:0;height:60;width:420;overflow:hidden;vertical-align:top;'><!--BEG_ICP_BANNER--><!--END_ICP_BANNER--></DIV>" +
  84. "<DIV ID='idMSMenuCurve' STYLE='position:absolute;top:0;left:420;height:20;width:18;overflow:hidden;vertical-align:top;'><IMG SRC='/include/images/curve.gif' BORDER=0></DIV>" +
  85. "<DIV ID='idMSMenuPane' STYLE='position:absolute;top:0;left:420;height:20;width:10;background-color:black;float:right;' NOWRAP><!--MS_MENU_TITLES--></DIV>" +
  86. "</DIV>" +
  87. "<DIV ID='idRow2' STYLE='position:relative;left:250;height:40;'>" +
  88. "<DIV ID='idADSBanner' STYLE='position:absolute;top:0;left:0;height:40;width:200;vertical-align:top;overflow:hidden;'><!--BEG_ADS_BANNER--><!--END_ADS_BANNER--></DIV>" +
  89. "<DIV ID='idMSCBanner' STYLE='position:absolute;top:10;left:200;height:16;width:89;vertical-align:top;overflow:hidden;' ALIGN=RIGHT><!--BEG_MSC_BANNER--><!--END_MSC_BANNER--></DIV>" +
  90. "</DIV>" + //Microsoft Image
  91. "<DIV ID='idRow3' STYLE='position:relative;height:20;width:100%'>" +
  92. "<DIV ID='idICPMenuPane' STYLE='position:absolute;top:0;left:0;height:20;background-color:black;' NOWRAP><!--ICP_MENU_TITLES--></div>" +
  93. "</DIV>" +
  94. "</DIV>" +
  95. "<SCRIPT TYPE='text/javascript'>" +
  96. " var ToolbarMenu = StartMenu;" +
  97. "</SCRIPT>" +
  98. "<DIV WIDTH=100%>";
  99. HTMLStr2 = "</Div></div></div><SCRIPT TYPE='text/javascript'>var ToolbarMenu = StartMenu;</SCRIPT><DIV WIDTH=100%>"
  100. HTMLStr2 = "";
  101. // Define event handlers
  102. window.onresize = resizeToolbar;
  103. // Intialize global variables
  104. ToolbarBGColor = "white"; // toolbar background color
  105. MSFont = "xx-small Verdana";
  106. ICPFont = "bold xx-small Verdana";
  107. aDefMSColor[0] = aCurMSColor[0] = "black"; // bgcolor;
  108. aDefMSColor[1] = aCurMSColor[1] = "white"; // text font color
  109. aDefMSColor[2] = aCurMSColor[2] = "#AEB2FE"; // mouseover font color
  110. aDefICPColor[0] = aCurICPColor[0] = "#6699cc"; // bgcolor;
  111. aDefICPColor[1] = aCurICPColor[1] = "white"; // text font color
  112. aDefICPColor[2] = aCurICPColor[2] = "#AEB2FE"; // mouseover font color
  113. }
  114. // The hard-coded numbers in functions - drawToolbar() & resizeToolbar()
  115. // correspond to the dimension of the four gif files:
  116. // ICP_BANNER: 60h x 250w
  117. // ADS_BANNER: 40h x 200w
  118. // MSC_BANNER: 16h x 89w
  119. // Curve: 20h x 18w
  120. function drawFooter(sLastUpdated, position)
  121. {
  122. var re = "<!--TEMPCOLOR-->";
  123. var sUpdatedDate = "";
  124. if (ToolbarBGColor.toUpperCase() == "WHITE" || ToolbarBGColor.toUpperCase() == "#FFFFFF")
  125. {
  126. while (FooterStr.indexOf(re) != -1)
  127. FooterStr = FooterStr.replace(re, "000000");
  128. }
  129. else
  130. {
  131. while (FooterStr.indexOf(re) != -1)
  132. FooterStr = FooterStr.replace(re, aDefICPColor[1]);
  133. }
  134. var re2 = "<!--TEMPCOLOR2-->";
  135. while (FooterStr.indexOf(re2) != -1)
  136. FooterStr = FooterStr.replace(re2, aDefICPColor[2]);
  137. sUpdatedDate = "<SPAN STYLE='font:" + MSFont + "'>"
  138. if (typeof sLastUpdated != "undefined")
  139. sUpdatedDate += sLastUpdated;
  140. sUpdatedDate += "</SPAN>";
  141. FooterStr = FooterStr.replace("<!--ICP_FOOTERDATE1_TITLES-->", sUpdatedDate);
  142. document.body.innerHTML += FooterStr;
  143. idFooterRow1.style.backgroundColor = aDefICPColor[0];
  144. idFooterRow2.style.backgroundColor = ToolbarBGColor;
  145. if (typeof sLastUpdated == "undefined")
  146. idFooter1.style.display = "none";
  147. if (typeof position != "undefined")
  148. idPosition.width = position;
  149. }
  150. function drawClosingTags()
  151. {
  152. document.write (HTMLStr2);
  153. }
  154. function drawToolbar()
  155. {
  156. HTMLStr += "</DIV>";
  157. document.write(HTMLStr);
  158. ToolbarLoaded = true;
  159. MSMenuWidth = Math.max(idMSMenuPane.offsetWidth, (200+112));
  160. ToolbarMinWidth = (420+18) + MSMenuWidth;
  161. idToolbar.style.backgroundColor = ToolbarBGColor;
  162. idMSMenuPane.style.backgroundColor = aDefMSColor[0];
  163. idICPMenuPane.style.backgroundColor = aDefICPColor[0];
  164. resizeToolbar();
  165. for (i = 0; i < TotalMenu; i++)
  166. {
  167. thisMenu = document.all(arrMenuInfo[i].IDStr);
  168. if (thisMenu != null)
  169. {
  170. if (arrMenuInfo[i].IDStr == LastMSMenu && arrMenuInfo[i].type == "R")
  171. {
  172. //Last MSMenu has to be absolute width
  173. arrMenuInfo[i].type = "A";
  174. arrMenuInfo[i].unit = 200;
  175. }
  176. if (arrMenuInfo[i].type == "A")
  177. thisMenu.style.width = arrMenuInfo[i].unit;
  178. else
  179. thisMenu.style.width = Math.round(arrMenuInfo[i].width * arrMenuInfo[i].unit) + 'em';
  180. }
  181. }
  182. }
  183. function resizeToolbar()
  184. {
  185. if (ToolBar_Supported == false) return;
  186. w = Math.max(ToolbarMinWidth, document.body.clientWidth) - ToolbarMinWidth;
  187. if (document.all("idMSMenuCurve"))
  188. {
  189. idMSMenuCurve.style.left = (420+w);
  190. idMSMenuPane.style.left = (420+w+18);
  191. idMSMenuPane.style.width = MSMenuWidth;
  192. idADSBanner.style.left = (w+18);
  193. idMSCBanner.style.left = (w+18+365);
  194. idMSCBanner.style.width = (MSMenuWidth - 200);
  195. idICPMenuPane.style.width = '100%';ToolbarMinWidth + w;
  196. }
  197. }
  198. function setToolbarBGColor(color)
  199. {
  200. ToolbarBGColor = color;
  201. if (ToolbarLoaded == true)
  202. idToolbar.style.backgroundColor = ToolbarBGColor;
  203. }
  204. function setBannerColor(bannerColor, bgColor, fontColor, mouseoverColor)
  205. {
  206. if (bannerColor.toUpperCase() != "WHITE" && bannerColor.toUpperCase() != "FFFFFF")
  207. bgColor = bannerColor;
  208. setToolbarBGColor(bannerColor);
  209. setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor);
  210. }
  211. function setMSMenuFont(sFont)
  212. { MSFont = sFont;
  213. }
  214. function setICPMenuFont(sFont)
  215. { ICPFont = sFont;
  216. }
  217. function setDefaultMSMenuColor(bgColor, fontColor, mouseoverColor)
  218. {
  219. if (bgColor != "") aDefMSColor[0] = bgColor;
  220. if (fontColor != "") aDefMSColor[1] = fontColor;
  221. if (mouseoverColor != "") aDefMSColor[2] = mouseoverColor;
  222. }
  223. function setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor)
  224. {
  225. if (bgColor != "") aDefICPColor[0] = bgColor;
  226. if (fontColor != "") aDefICPColor[1] = fontColor;
  227. if (mouseoverColor != "") aDefICPColor[2] = mouseoverColor;
  228. }
  229. function setICPMenuColor(MenuIDStr, bgColor, fontColor, mouseoverColor)
  230. {
  231. if (ToolbarLoaded == false) return;
  232. // Reset previous ICP Menu color if any
  233. if (CurICPMenu != "")
  234. {
  235. PrevID = CurICPMenu.substring(4);
  236. CurICPMenu = "";
  237. setICPMenuColor(PrevID, aDefICPColor[0], aDefICPColor[1], aDefICPColor[2]);
  238. }
  239. var id = "AM_" + "ICP_" + MenuIDStr;
  240. var thisMenu = document.all(id);
  241. if (thisMenu != null)
  242. {
  243. CurICPMenu = "ICP_" + MenuIDStr;
  244. aCurICPColor[0] = bgColor;
  245. aCurICPColor[1] = fontColor;
  246. aCurICPColor[2] = mouseoverColor;
  247. // Change menu color
  248. if (bgColor != "")
  249. thisMenu.style.backgroundColor = bgColor;
  250. if (fontColor != "")
  251. thisMenu.style.color = fontColor;
  252. // Change subMenu color
  253. id = "ICP_" + MenuIDStr;
  254. thisMenu = document.all(id);
  255. if (thisMenu != null)
  256. {
  257. if (bgColor != "")
  258. thisMenu.style.backgroundColor = bgColor;
  259. if (fontColor != "")
  260. {
  261. i = 0;
  262. id = "AS_" + "ICP_" + MenuIDStr;
  263. thisMenu = document.all.item(id,i);
  264. while (thisMenu != null)
  265. {
  266. thisMenu.style.color = fontColor;
  267. i += 1;
  268. thisMenu = document.all.item(id,i);
  269. }
  270. }
  271. }
  272. }
  273. }
  274. function setAds(Gif,Url,AltStr)
  275. { setBanner(Gif,Url,AltStr,"<!--BEG_ADS_BANNER-->","<!--END_ADS_BANNER-->");
  276. }
  277. function setICPBanner(Gif,Url,AltStr)
  278. { setBanner(Gif,Url,AltStr,"<!--BEG_ICP_BANNER-->","<!--END_ICP_BANNER-->");
  279. }
  280. function setMSBanner(Gif,Url,AltStr)
  281. { //tempGif = "/library/toolbar/images/" + Gif;
  282. setBanner(Gif,Url,AltStr,"<!--BEG_MSC_BANNER-->","<!--END_MSC_BANNER-->");
  283. }
  284. function setBanner(BanGif, BanUrl, BanAltStr, BanBegTag, BanEndTag)
  285. {
  286. begPos = HTMLStr.indexOf(BanBegTag);
  287. endPos = HTMLStr.indexOf(BanEndTag) + BanEndTag.length;
  288. SubStr = HTMLStr.substring(begPos, endPos);
  289. SrcStr = "";
  290. if (BanUrl != "")
  291. SrcStr += "<A Target='_top' HREF='" + formatURL(BanUrl, BanGif) + "'>";
  292. SrcStr += "<IMG SRC='" + BanGif + "' ALT='" + BanAltStr + "' BORDER=0>";
  293. if (BanUrl != "")
  294. SrcStr += "</A>";
  295. SrcStr = BanBegTag + SrcStr + BanEndTag;
  296. HTMLStr = HTMLStr.replace(SubStr, SrcStr);
  297. }
  298. function setICPSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  299. { tempID = "ICP_" + MenuIDStr;
  300. setSubMenuWidth(tempID, WidthType, WidthUnit);
  301. }
  302. function setMSSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  303. { tempID = "MS_" + MenuIDStr;
  304. setSubMenuWidth(tempID, WidthType, WidthUnit);
  305. }
  306. //********************Bottom Menus******************************
  307. function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  308. {
  309. var fFound = false;
  310. if (TotalMenu == MaxMenu)
  311. {
  312. alert("Unable to process menu. Maximum of " + MaxMenu + " reached.");
  313. return;
  314. }
  315. for (i = 0; i < TotalMenu; i++)
  316. if (arrMenuInfo[i].IDStr == MenuIDStr)
  317. {
  318. fFound = true;
  319. break;
  320. }
  321. if (!fFound)
  322. {
  323. arrMenuInfo[i] = new menuInfo(MenuIDStr);
  324. TotalMenu += 1;
  325. }
  326. if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1)
  327. {
  328. arrMenuInfo[i].type = "A";
  329. arrMenuInfo[i].unit = 160;
  330. }
  331. else
  332. {
  333. arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R";
  334. arrMenuInfo[i].unit = WidthUnit;
  335. }
  336. }
  337. // This function creates a menuInfo object instance.
  338. function menuInfo(MenuIDStr)
  339. {
  340. this.IDStr = MenuIDStr;
  341. this.type = "";
  342. this.unit = 0;
  343. this.width = 0;
  344. this.count = 0;
  345. }
  346. function updateSubMenuWidth(MenuIDStr)
  347. {
  348. for (i = 0; i < TotalMenu; i++)
  349. if (arrMenuInfo[i].IDStr == MenuIDStr)
  350. {
  351. if (arrMenuInfo[i].width < MenuIDStr.length)
  352. arrMenuInfo[i].width = MenuIDStr.length;
  353. arrMenuInfo[i].count = arrMenuInfo[i].count + 1;
  354. break;
  355. }
  356. }
  357. //********************Bottom Menus******************************
  358. function addICPMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
  359. {
  360. if (addICPMenu.arguments.length > 4)
  361. TargetStr = addICPMenu.arguments[4];
  362. else
  363. TargetStr = "_top";
  364. tempID = "ICP_" + MenuIDStr;
  365. addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, true);
  366. bFstICPTBMenu=false;
  367. }
  368. function addMSMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
  369. {
  370. TargetStr = "_top";
  371. tempID = "MS_" + MenuIDStr;
  372. addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, false);
  373. LastMSMenu = tempID;
  374. }
  375. //********************Bottom Menus******************************
  376. function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, bICPMenu)
  377. {
  378. cFont = bICPMenu? ICPFont : MSFont;
  379. cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
  380. cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  381. cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
  382. tagStr = bICPMenu? "<!--ICP_MENU_TITLES-->" : "<!--MS_MENU_TITLES-->";
  383. MenuStr = newLineChar;
  384. if ((bICPMenu == false && LastMSMenu != "") || (bICPMenu == true && bFstICPTBMenu==false))
  385. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>|&nbsp;</SPAN>";
  386. MenuStr += "<A TARGET='" + TargetStr + "' TITLE='" + MenuHelpStr + "'" +
  387. " ID='AM_" + MenuIDStr + "'" +
  388. " STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";'";
  389. if (MenuURLStr != "")
  390. {
  391. if (bICPMenu)
  392. MenuStr += " HREF='" + formatURL(MenuURLStr, ("ICP_" + MenuDisplayStr)) + "'";
  393. else
  394. MenuStr += " HREF='" + formatURL(MenuURLStr, ("MS_" + MenuDisplayStr)) + "'";
  395. }
  396. else
  397. MenuStr += " HREF='' onclick='window.event.returnValue=false;'";
  398. MenuStr += " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "'); hideMenu();" + char34 +
  399. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "'); doMenu('"+ MenuIDStr + "');" + char34 + ">" +
  400. "&nbsp;" + MenuDisplayStr + "&nbsp;</a>";
  401. MenuStr += tagStr;
  402. HTMLStr = HTMLStr.replace(tagStr, MenuStr);
  403. setSubMenuWidth(MenuIDStr,"default",0);
  404. }
  405. function addICPSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
  406. {
  407. if (addICPSubMenu.arguments.length > 3)
  408. TargetStr = addICPSubMenu.arguments[3];
  409. else
  410. TargetStr = "_top";
  411. tempID = "ICP_" + MenuIDStr;
  412. addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,true);
  413. }
  414. function addMSSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
  415. {
  416. TargetStr = "_top";
  417. tempID = "MS_" + MenuIDStr;
  418. addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,false);
  419. }
  420. function addSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, TargetStr, bICPMenu)
  421. {
  422. cFont = bICPMenu? ICPFont : MSFont;
  423. cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
  424. cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  425. cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
  426. var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU");
  427. if (MenuPos == -1) { MenuPos = MenuIDStr.length; }
  428. InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "|" + SubMenuStr;;
  429. URLStr = formatURL(SubMenuURLStr, InstrumentStr);
  430. var LookUpTag = "<!--" + MenuIDStr + "-->";
  431. var sPos = HTMLStr.indexOf(LookUpTag);
  432. if (sPos <= 0)
  433. {
  434. HTMLStr += newLineChar + newLineChar +
  435. "<SPAN ID='" + MenuIDStr + "'" +
  436. " STYLE='display:none;position:absolute;width:160;background-color:" + cColor0 + ";padding-top:0;padding-left:0;padding-bottom:20;z-index:9;'" +
  437. " onmouseout='hideMenu();'>";
  438. if (Frame_Supported == false || bICPMenu == false)
  439. HTMLStr += "<HR STYLE='position:absolute;left:0;top:0;color:" + cColor1 + "' SIZE=1>";
  440. HTMLStr += "<DIV STYLE='position:relative;left:0;top:8;'>";
  441. }
  442. TempStr = newLineChar +
  443. "<A ID='AS_" + MenuIDStr + "'" +
  444. " STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
  445. " HREF='" + URLStr + "' TARGET='" + TargetStr + "'" +
  446. " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "');" + char34 +
  447. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "');" + char34 + ">" +
  448. "&nbsp;" + SubMenuStr + "</A><BR>" + LookUpTag;
  449. if (sPos <= 0)
  450. HTMLStr += TempStr + "</DIV></SPAN>";
  451. else
  452. HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
  453. updateSubMenuWidth(MenuIDStr);
  454. }
  455. function addICPSubMenuLine(MenuIDStr)
  456. {
  457. tempID = "ICP_" + MenuIDStr;
  458. addSubMenuLine(tempID,true);
  459. }
  460. function addMSSubMenuLine(MenuIDStr)
  461. {
  462. tempID = "MS_" + MenuIDStr;
  463. addSubMenuLine(tempID,false);
  464. }
  465. function addSubMenuLine(MenuIDStr, bICPMenu)
  466. {
  467. var LookUpTag = "<!--" + MenuIDStr + "-->";
  468. var sPos = HTMLStr.indexOf(LookUpTag);
  469. if (sPos > 0)
  470. {
  471. cColor = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  472. TempStr = newLineChar + "<HR STYLE='color:" + cColor + "' SIZE=1>" + LookUpTag;
  473. HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
  474. }
  475. }
  476. function addMSFooterMenu(MenuDisplayStr, MenuURLStr)
  477. {
  478. addFooterMenu(MenuDisplayStr, MenuURLStr, false)
  479. }
  480. function addICPFooterMenu(MenuDisplayStr, MenuURLStr)
  481. {
  482. addFooterMenu(MenuDisplayStr, MenuURLStr, true)
  483. bFstICPFTMenu = false;
  484. }
  485. function addFooterMenu(MenuDisplayStr, MenuURLStr, bICPMenu)
  486. {
  487. cFont = bICPMenu? ICPFont : MSFont;
  488. cColor1 = aDefICPColor[1];
  489. cColor2 = aDefICPColor[2];
  490. tagStr = bICPMenu? "<!--ICP_FOOTERMENU_TITLES-->" : "<!--MS_FOOTERMENU_TITLES-->";
  491. MenuStr = "";
  492. if ((bICPMenu) && bFstICPFTMenu == false)
  493. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>&nbsp;|</SPAN>";
  494. if ((bICPMenu == false) && (MenuURLStr == ''))
  495. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:<!--TEMPCOLOR-->'>&nbsp;" + MenuDisplayStr + "&nbsp;</SPAN>";
  496. else
  497. {
  498. MenuStr += "&nbsp;<A TARGET='_top' STYLE='";
  499. if (bICPMenu)
  500. MenuStr += "text-decoration:none;";
  501. MenuStr += "cursor:hand;font:" + cFont + ";"
  502. if (bICPMenu)
  503. MenuStr += "color:" + cColor1 + ";'";
  504. else
  505. MenuStr += "color:<!--TEMPCOLOR-->" + ";'";
  506. MenuStr += " HREF='" + MenuURLStr + "'";
  507. MenuStr += " onmouseout=" + char34 + "this.style.color = '";
  508. if (bICPMenu)
  509. MenuStr += cColor1;
  510. else
  511. MenuStr += "<!--TEMPCOLOR-->";
  512. MenuStr += "'" + char34 + " onmouseover=" + char34 + "this.style.color = '"
  513. if (bICPMenu)
  514. MenuStr += cColor2
  515. else
  516. MenuStr += "<!--TEMPCOLOR2-->";
  517. MenuStr += "'" + char34 + ">" + MenuDisplayStr + "</A>&nbsp;";
  518. }
  519. MenuStr += tagStr;
  520. FooterStr = FooterStr.replace(tagStr, MenuStr);
  521. }
  522. function mouseMenu(id, MenuIDStr)
  523. {
  524. IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
  525. IsMouseout = (id.toUpperCase().indexOf("OUT") != -1);
  526. if (IsMouseout)
  527. {
  528. color = IsMSMenu? aDefMSColor[1] : aDefICPColor[1];
  529. if (MenuIDStr == CurICPMenu && aCurICPColor[1] != "")
  530. color = aCurICPColor[1];
  531. }
  532. else
  533. {
  534. color = IsMSMenu? aDefMSColor[2] : aDefICPColor[2];
  535. if (MenuIDStr == CurICPMenu && aCurICPColor[2] != "")
  536. color = aCurICPColor[2];
  537. }
  538. window.event.srcElement.style.color = color;
  539. }
  540. function doMenu(MenuIDStr)
  541. {
  542. var thisMenu = document.all(MenuIDStr);
  543. if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu)
  544. {
  545. window.event.cancelBubble = true;
  546. return false;
  547. }
  548. // Reset dropdown menu
  549. window.event.cancelBubble = true;
  550. ToolbarMenu.style.display = "none";
  551. showElement("SELECT");
  552. showElement("OBJECT");
  553. ToolbarMenu = thisMenu;
  554. IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
  555. // Set dropdown menu display position
  556. x = window.event.srcElement.offsetLeft +
  557. window.event.srcElement.offsetParent.offsetLeft;
  558. if (MenuIDStr == LastMSMenu)
  559. x += (window.event.srcElement.offsetWidth - thisMenu.style.posWidth);
  560. x2 = x + window.event.srcElement.offsetWidth;
  561. y = (IsMSMenu)?
  562. (idRow1.offsetHeight) :
  563. (idRow1.offsetHeight + idRow2.offsetHeight + idRow3.offsetHeight);
  564. thisMenu.style.top = y;
  565. thisMenu.style.left = x;
  566. thisMenu.style.clip = "rect(0 0 0 0)";
  567. thisMenu.style.display = "block";
  568. // delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
  569. window.setTimeout("showMenu()", 2);
  570. return true;
  571. }
  572. function showMenu()
  573. {
  574. if (ToolbarMenu != null)
  575. {
  576. IsMenuDropDown = (Frame_Supported && IsMSMenu == false)? false : true;
  577. if (IsMenuDropDown == false)
  578. {
  579. y = (y - ToolbarMenu.offsetHeight - idRow3.offsetHeight);
  580. if (y < 0) y = 0;
  581. ToolbarMenu.style.top = y;
  582. }
  583. y2 = y + ToolbarMenu.offsetHeight;
  584. ToolbarMenu.style.clip = "rect(auto auto auto auto)";
  585. hideElement("SELECT");
  586. hideElement("OBJECT");
  587. hideElement("IFRAME"); //FRANKLO
  588. }
  589. }
  590. function hideMenu()
  591. {
  592. if (ToolbarMenu != null && ToolbarMenu != StartMenu)
  593. {
  594. // Don't hide the menu if the mouse move between the menu and submenus
  595. cY = event.clientY + document.body.scrollTop;
  596. if ( (event.clientX >= (x+5) && event.clientX <= x2) &&
  597. ((IsMenuDropDown == true && cY > (y-10) && cY <= y2) ||
  598. (IsMenuDropDown == false && cY >= y && cY <= (y2+10)) ))
  599. {
  600. window.event.cancelBubble = true;
  601. return;
  602. }
  603. ToolbarMenu.style.display = "none";
  604. ToolbarMenu = StartMenu;
  605. window.event.cancelBubble = true;
  606. showElement("SELECT");
  607. showElement("OBJECT");
  608. showElement("IFRAME"); //FRANKLO
  609. }
  610. }
  611. function hideElement(elmID)
  612. {
  613. for (i = 0; i < document.all.tags(elmID).length; i++)
  614. {
  615. obj = document.all.tags(elmID)[i];
  616. if (! obj || ! obj.offsetParent)
  617. continue;
  618. // Find the element's offsetTop and offsetLeft relative to the BODY tag.
  619. objLeft = obj.offsetLeft;
  620. objTop = obj.offsetTop;
  621. objParent = obj.offsetParent;
  622. while (objParent.tagName.toUpperCase() != "BODY")
  623. {
  624. objLeft += objParent.offsetLeft;
  625. objTop += objParent.offsetTop;
  626. objParent = objParent.offsetParent;
  627. }
  628. // Adjust the element's offsetTop relative to the dropdown menu
  629. objTop = objTop - y;
  630. if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth))
  631. ;
  632. else if (objTop > ToolbarMenu.offsetHeight)
  633. ;
  634. else if (IsMSMenu && (y + ToolbarMenu.offsetHeight) <= 80)
  635. ;
  636. else
  637. obj.style.visibility = "hidden";
  638. }
  639. }
  640. function showElement(elmID)
  641. {
  642. for (i = 0; i < document.all.tags(elmID).length; i++)
  643. {
  644. obj = document.all.tags(elmID)[i];
  645. if (! obj || ! obj.offsetParent)
  646. continue;
  647. obj.style.visibility = "";
  648. }
  649. }
  650. function formatURL(URLStr, InstrumentStr)
  651. {
  652. var tempStr = URLStr;
  653. if (DoInstrumentation && URLStr != "" )
  654. {
  655. var ParamPos1 = URLStr.indexOf("?");
  656. var ParamPos2 = URLStr.lastIndexOf("?");
  657. var ParamPos3 = URLStr.toLowerCase().indexOf("target=");
  658. var ParamPos4 = URLStr.indexOf("#");
  659. var Bookmark = "";
  660. var URL = URLStr;
  661. if (ParamPos4 >= 0)
  662. {
  663. URL = URLStr.substr(0, ParamPos4);
  664. Bookmark = URLStr.substr(ParamPos4);
  665. }
  666. if (ParamPos1 == -1)
  667. tempStr = "?MSCOMTB=";
  668. else if (ParamPos1 == ParamPos2 && ParamPos3 == -1)
  669. tempStr = "&MSCOMTB=";
  670. else if (ParamPos1 == ParamPos2 && ParamPos3 != -1)
  671. tempStr = "?MSCOMTB=";
  672. else if (ParamPos1 < ParamPos2)
  673. tempStr = "&MSCOMTB=";
  674. tempStr = URL + tempStr + InstrumentStr.replace(" ","%20") + Bookmark;
  675. }
  676. return tempStr;
  677. }
  678. function prepTrackingString(ts, type)
  679. {
  680. var rArray;
  681. var rString;
  682. var pName = '';
  683. if (0 == type)
  684. {
  685. pName = 'p=';
  686. rString = ts.substring(1);
  687. rArray = rString.split('/');
  688. }
  689. if (1 == type)
  690. {
  691. pName = 'qs=';
  692. rString = ts.substring(1);
  693. rArray = rString.split('&');
  694. }
  695. if (2 == type)
  696. {
  697. pName = 'f=';
  698. rString = escape(ts);
  699. return pName + rString;
  700. }
  701. if (3 == type)
  702. {
  703. pName = 'tPage=';
  704. rString = escape(ts);
  705. return pName+rString;
  706. }
  707. if (4 == type)
  708. {
  709. pName = 'sPage=';
  710. rString = escape(ts);
  711. return pName + rString;
  712. }
  713. if (5 == type)
  714. {
  715. pName = 'r=';
  716. rString = escape(ts);
  717. return pName + rString;
  718. }
  719. if (6 == type)
  720. {
  721. pName = 'MSID=';
  722. rString = escape(ts);
  723. return pName + rString;
  724. }
  725. if (7 == type)
  726. {
  727. pName = 'source=';
  728. rString = ts.toLowerCase();
  729. if(rString.indexOf("microsoft.com") != -1)
  730. {
  731. rString = rString.substring(0,rString.indexOf("microsoft.com"));
  732. if('' == rString)
  733. {
  734. rString = "www";
  735. }
  736. else
  737. {
  738. rString = rString.substring(0,rString.length -1);
  739. }
  740. }
  741. return pName + rString;
  742. }
  743. if (8 == type)
  744. {
  745. pName = 'TYPE=';
  746. rString = escape(ts);
  747. return pName + rString;
  748. }
  749. rString = '';
  750. if(null != rArray)
  751. {
  752. if(0 == type)
  753. {
  754. for( j=0; j < rArray.length - 1; j++)
  755. {
  756. rString += rArray[j] + '_';
  757. }
  758. }
  759. else
  760. {
  761. for( j=0; j < rArray.length ; j++)
  762. {
  763. rString += rArray[j] + '_';
  764. }
  765. }
  766. }
  767. rString = rString.substring(0, rString.length - 1);
  768. return pName + rString;
  769. }
  770. function buildIMG(pArr)
  771. {
  772. /*
  773. var TG = '<LAYER visibility="hide"><div style="display:none;"><IMG src="' + location.protocol + '//c.microsoft.com/trans_pixel.asp?';
  774. for(var i=0; i<pArr.length; i++)
  775. {
  776. if(0 == i)
  777. {
  778. TG += pArr[i];
  779. }
  780. else
  781. {
  782. TG += '&' + pArr[i];
  783. }
  784. }
  785. TG +='" height="0" width="0" hspace="0" vspace="0" Border="0"></div></layer>';
  786. document.writeln(TG);
  787. */
  788. return;
  789. }