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.

897 lines
26 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:250;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:250;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 = (250+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. w = Math.max(ToolbarMinWidth, 1014) - ToolbarMinWidth;
  188. if (document.all("idMSMenuCurve"))
  189. {
  190. idMSMenuCurve.style.left = (250+w);
  191. idMSMenuPane.style.left = (250+w+18);
  192. idMSMenuPane.style.width = MSMenuWidth;
  193. idADSBanner.style.left = (w+18);
  194. idMSCBanner.style.left = (w+18+200);
  195. idMSCBanner.style.width = (MSMenuWidth - 200);
  196. idICPMenuPane.style.width = '100%';ToolbarMinWidth + w;
  197. }
  198. }
  199. function setToolbarBGColor(color)
  200. {
  201. ToolbarBGColor = color;
  202. if (ToolbarLoaded == true)
  203. idToolbar.style.backgroundColor = ToolbarBGColor;
  204. }
  205. function setBannerColor(bannerColor, bgColor, fontColor, mouseoverColor)
  206. {
  207. if (bannerColor.toUpperCase() != "WHITE" && bannerColor.toUpperCase() != "FFFFFF")
  208. bgColor = bannerColor;
  209. setToolbarBGColor(bannerColor);
  210. setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor);
  211. }
  212. function setMSMenuFont(sFont)
  213. { MSFont = sFont;
  214. }
  215. function setICPMenuFont(sFont)
  216. { ICPFont = sFont;
  217. }
  218. function setDefaultMSMenuColor(bgColor, fontColor, mouseoverColor)
  219. {
  220. if (bgColor != "") aDefMSColor[0] = bgColor;
  221. if (fontColor != "") aDefMSColor[1] = fontColor;
  222. if (mouseoverColor != "") aDefMSColor[2] = mouseoverColor;
  223. }
  224. function setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor)
  225. {
  226. if (bgColor != "") aDefICPColor[0] = bgColor;
  227. if (fontColor != "") aDefICPColor[1] = fontColor;
  228. if (mouseoverColor != "") aDefICPColor[2] = mouseoverColor;
  229. }
  230. function setICPMenuColor(MenuIDStr, bgColor, fontColor, mouseoverColor)
  231. {
  232. if (ToolbarLoaded == false) return;
  233. // Reset previous ICP Menu color if any
  234. if (CurICPMenu != "")
  235. {
  236. PrevID = CurICPMenu.substring(4);
  237. CurICPMenu = "";
  238. setICPMenuColor(PrevID, aDefICPColor[0], aDefICPColor[1], aDefICPColor[2]);
  239. }
  240. var id = "AM_" + "ICP_" + MenuIDStr;
  241. var thisMenu = document.all(id);
  242. if (thisMenu != null)
  243. {
  244. CurICPMenu = "ICP_" + MenuIDStr;
  245. aCurICPColor[0] = bgColor;
  246. aCurICPColor[1] = fontColor;
  247. aCurICPColor[2] = mouseoverColor;
  248. // Change menu color
  249. if (bgColor != "")
  250. thisMenu.style.backgroundColor = bgColor;
  251. if (fontColor != "")
  252. thisMenu.style.color = fontColor;
  253. // Change subMenu color
  254. id = "ICP_" + MenuIDStr;
  255. thisMenu = document.all(id);
  256. if (thisMenu != null)
  257. {
  258. if (bgColor != "")
  259. thisMenu.style.backgroundColor = bgColor;
  260. if (fontColor != "")
  261. {
  262. i = 0;
  263. id = "AS_" + "ICP_" + MenuIDStr;
  264. thisMenu = document.all.item(id,i);
  265. while (thisMenu != null)
  266. {
  267. thisMenu.style.color = fontColor;
  268. i += 1;
  269. thisMenu = document.all.item(id,i);
  270. }
  271. }
  272. }
  273. }
  274. }
  275. function setAds(Gif,Url,AltStr)
  276. { setBanner(Gif,Url,AltStr,"<!--BEG_ADS_BANNER-->","<!--END_ADS_BANNER-->");
  277. }
  278. function setICPBanner(Gif,Url,AltStr)
  279. { setBanner(Gif,Url,AltStr,"<!--BEG_ICP_BANNER-->","<!--END_ICP_BANNER-->");
  280. }
  281. function setMSBanner(Gif,Url,AltStr)
  282. { //tempGif = "/library/toolbar/images/" + Gif;
  283. setBanner(Gif,Url,AltStr,"<!--BEG_MSC_BANNER-->","<!--END_MSC_BANNER-->");
  284. }
  285. function setBanner(BanGif, BanUrl, BanAltStr, BanBegTag, BanEndTag)
  286. {
  287. begPos = HTMLStr.indexOf(BanBegTag);
  288. endPos = HTMLStr.indexOf(BanEndTag) + BanEndTag.length;
  289. SubStr = HTMLStr.substring(begPos, endPos);
  290. SrcStr = "";
  291. if (BanUrl != "")
  292. SrcStr += "<A Target='_top' HREF='" + formatURL(BanUrl, BanGif) + "'>";
  293. SrcStr += "<IMG SRC='" + BanGif + "' ALT='" + BanAltStr + "' BORDER=0>";
  294. if (BanUrl != "")
  295. SrcStr += "</A>";
  296. SrcStr = BanBegTag + SrcStr + BanEndTag;
  297. HTMLStr = HTMLStr.replace(SubStr, SrcStr);
  298. }
  299. function setICPSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  300. { tempID = "ICP_" + MenuIDStr;
  301. setSubMenuWidth(tempID, WidthType, WidthUnit);
  302. }
  303. function setMSSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  304. { tempID = "MS_" + MenuIDStr;
  305. setSubMenuWidth(tempID, WidthType, WidthUnit);
  306. }
  307. //********************Bottom Menus******************************
  308. function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  309. {
  310. var fFound = false;
  311. if (TotalMenu == MaxMenu)
  312. {
  313. alert("Unable to process menu. Maximum of " + MaxMenu + " reached.");
  314. return;
  315. }
  316. for (i = 0; i < TotalMenu; i++)
  317. if (arrMenuInfo[i].IDStr == MenuIDStr)
  318. {
  319. fFound = true;
  320. break;
  321. }
  322. if (!fFound)
  323. {
  324. arrMenuInfo[i] = new menuInfo(MenuIDStr);
  325. TotalMenu += 1;
  326. }
  327. if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1)
  328. {
  329. arrMenuInfo[i].type = "A";
  330. arrMenuInfo[i].unit = 160;
  331. }
  332. else
  333. {
  334. arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R";
  335. arrMenuInfo[i].unit = WidthUnit;
  336. }
  337. }
  338. // This function creates a menuInfo object instance.
  339. function menuInfo(MenuIDStr)
  340. {
  341. this.IDStr = MenuIDStr;
  342. this.type = "";
  343. this.unit = 0;
  344. this.width = 0;
  345. this.count = 0;
  346. }
  347. function updateSubMenuWidth(MenuIDStr)
  348. {
  349. for (i = 0; i < TotalMenu; i++)
  350. if (arrMenuInfo[i].IDStr == MenuIDStr)
  351. {
  352. if (arrMenuInfo[i].width < MenuIDStr.length)
  353. arrMenuInfo[i].width = MenuIDStr.length;
  354. arrMenuInfo[i].count = arrMenuInfo[i].count + 1;
  355. break;
  356. }
  357. }
  358. //********************Bottom Menus******************************
  359. function addICPMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
  360. {
  361. if (addICPMenu.arguments.length > 4)
  362. TargetStr = addICPMenu.arguments[4];
  363. else
  364. TargetStr = "_top";
  365. tempID = "ICP_" + MenuIDStr;
  366. addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, true);
  367. bFstICPTBMenu=false;
  368. }
  369. function addMSMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
  370. {
  371. TargetStr = "_top";
  372. tempID = "MS_" + MenuIDStr;
  373. addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, false);
  374. LastMSMenu = tempID;
  375. }
  376. //********************Bottom Menus******************************
  377. function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, bICPMenu)
  378. {
  379. cFont = bICPMenu? ICPFont : MSFont;
  380. cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
  381. cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  382. cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
  383. tagStr = bICPMenu? "<!--ICP_MENU_TITLES-->" : "<!--MS_MENU_TITLES-->";
  384. MenuStr = newLineChar;
  385. if ((bICPMenu == false && LastMSMenu != "") || (bICPMenu == true && bFstICPTBMenu==false))
  386. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>|&nbsp;</SPAN>";
  387. MenuStr += "<A TARGET='" + TargetStr + "' TITLE='" + MenuHelpStr + "'" +
  388. " ID='AM_" + MenuIDStr + "'" +
  389. " STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";'";
  390. if (MenuURLStr != "")
  391. {
  392. if (bICPMenu)
  393. MenuStr += " HREF='" + formatURL(MenuURLStr, ("ICP_" + MenuDisplayStr)) + "'";
  394. else
  395. MenuStr += " HREF='" + formatURL(MenuURLStr, ("MS_" + MenuDisplayStr)) + "'";
  396. }
  397. else
  398. MenuStr += " HREF='' onclick='window.event.returnValue=false;'";
  399. MenuStr += " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "'); hideMenu();" + char34 +
  400. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "'); doMenu('"+ MenuIDStr + "');" + char34 + ">" +
  401. "&nbsp;" + MenuDisplayStr + "&nbsp;</a>";
  402. MenuStr += tagStr;
  403. HTMLStr = HTMLStr.replace(tagStr, MenuStr);
  404. setSubMenuWidth(MenuIDStr,"default",0);
  405. }
  406. function addICPSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
  407. {
  408. if (addICPSubMenu.arguments.length > 3)
  409. TargetStr = addICPSubMenu.arguments[3];
  410. else
  411. TargetStr = "_top";
  412. tempID = "ICP_" + MenuIDStr;
  413. addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,true);
  414. }
  415. function addMSSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
  416. {
  417. TargetStr = "_top";
  418. tempID = "MS_" + MenuIDStr;
  419. addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,false);
  420. }
  421. function addSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, TargetStr, bICPMenu)
  422. {
  423. cFont = bICPMenu? ICPFont : MSFont;
  424. cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
  425. cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  426. cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
  427. var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU");
  428. if (MenuPos == -1) { MenuPos = MenuIDStr.length; }
  429. InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "|" + SubMenuStr;;
  430. URLStr = formatURL(SubMenuURLStr, InstrumentStr);
  431. var LookUpTag = "<!--" + MenuIDStr + "-->";
  432. var sPos = HTMLStr.indexOf(LookUpTag);
  433. if (sPos <= 0)
  434. {
  435. HTMLStr += newLineChar + newLineChar +
  436. "<SPAN ID='" + MenuIDStr + "'" +
  437. " STYLE='display:none;position:absolute;width:160;background-color:" + cColor0 + ";padding-top:0;padding-left:0;padding-bottom:20;z-index:9;'" +
  438. " onmouseout='hideMenu();'>";
  439. if (Frame_Supported == false || bICPMenu == false)
  440. HTMLStr += "<HR STYLE='position:absolute;left:0;top:0;color:" + cColor1 + "' SIZE=1>";
  441. HTMLStr += "<DIV STYLE='position:relative;left:0;top:8;'>";
  442. }
  443. TempStr = newLineChar +
  444. "<A ID='AS_" + MenuIDStr + "'" +
  445. " STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
  446. " HREF='" + URLStr + "' TARGET='" + TargetStr + "'" +
  447. " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "');" + char34 +
  448. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "');" + char34 + ">" +
  449. "&nbsp;" + SubMenuStr + "</A><BR>" + LookUpTag;
  450. if (sPos <= 0)
  451. HTMLStr += TempStr + "</DIV></SPAN>";
  452. else
  453. HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
  454. updateSubMenuWidth(MenuIDStr);
  455. }
  456. function addICPSubMenuLine(MenuIDStr)
  457. {
  458. tempID = "ICP_" + MenuIDStr;
  459. addSubMenuLine(tempID,true);
  460. }
  461. function addMSSubMenuLine(MenuIDStr)
  462. {
  463. tempID = "MS_" + MenuIDStr;
  464. addSubMenuLine(tempID,false);
  465. }
  466. function addSubMenuLine(MenuIDStr, bICPMenu)
  467. {
  468. var LookUpTag = "<!--" + MenuIDStr + "-->";
  469. var sPos = HTMLStr.indexOf(LookUpTag);
  470. if (sPos > 0)
  471. {
  472. cColor = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  473. TempStr = newLineChar + "<HR STYLE='color:" + cColor + "' SIZE=1>" + LookUpTag;
  474. HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
  475. }
  476. }
  477. function addMSFooterMenu(MenuDisplayStr, MenuURLStr)
  478. {
  479. addFooterMenu(MenuDisplayStr, MenuURLStr, false)
  480. }
  481. function addICPFooterMenu(MenuDisplayStr, MenuURLStr)
  482. {
  483. addFooterMenu(MenuDisplayStr, MenuURLStr, true)
  484. bFstICPFTMenu = false;
  485. }
  486. function addFooterMenu(MenuDisplayStr, MenuURLStr, bICPMenu)
  487. {
  488. cFont = bICPMenu? ICPFont : MSFont;
  489. cColor1 = aDefICPColor[1];
  490. cColor2 = aDefICPColor[2];
  491. tagStr = bICPMenu? "<!--ICP_FOOTERMENU_TITLES-->" : "<!--MS_FOOTERMENU_TITLES-->";
  492. MenuStr = "";
  493. if ((bICPMenu) && bFstICPFTMenu == false)
  494. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>&nbsp;|</SPAN>";
  495. if ((bICPMenu == false) && (MenuURLStr == ''))
  496. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:<!--TEMPCOLOR-->'>&nbsp;" + MenuDisplayStr + "&nbsp;</SPAN>";
  497. else
  498. {
  499. MenuStr += "&nbsp;<A TARGET='_top' STYLE='";
  500. if (bICPMenu)
  501. MenuStr += "text-decoration:none;";
  502. MenuStr += "cursor:hand;font:" + cFont + ";"
  503. if (bICPMenu)
  504. MenuStr += "color:" + cColor1 + ";'";
  505. else
  506. MenuStr += "color:<!--TEMPCOLOR-->" + ";'";
  507. MenuStr += " HREF='" + MenuURLStr + "'";
  508. MenuStr += " onmouseout=" + char34 + "this.style.color = '";
  509. if (bICPMenu)
  510. MenuStr += cColor1;
  511. else
  512. MenuStr += "<!--TEMPCOLOR-->";
  513. MenuStr += "'" + char34 + " onmouseover=" + char34 + "this.style.color = '"
  514. if (bICPMenu)
  515. MenuStr += cColor2
  516. else
  517. MenuStr += "<!--TEMPCOLOR2-->";
  518. MenuStr += "'" + char34 + ">" + MenuDisplayStr + "</A>&nbsp;";
  519. }
  520. MenuStr += tagStr;
  521. FooterStr = FooterStr.replace(tagStr, MenuStr);
  522. }
  523. function mouseMenu(id, MenuIDStr)
  524. {
  525. IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
  526. IsMouseout = (id.toUpperCase().indexOf("OUT") != -1);
  527. if (IsMouseout)
  528. {
  529. color = IsMSMenu? aDefMSColor[1] : aDefICPColor[1];
  530. if (MenuIDStr == CurICPMenu && aCurICPColor[1] != "")
  531. color = aCurICPColor[1];
  532. }
  533. else
  534. {
  535. color = IsMSMenu? aDefMSColor[2] : aDefICPColor[2];
  536. if (MenuIDStr == CurICPMenu && aCurICPColor[2] != "")
  537. color = aCurICPColor[2];
  538. }
  539. window.event.srcElement.style.color = color;
  540. }
  541. function doMenu(MenuIDStr)
  542. {
  543. var thisMenu = document.all(MenuIDStr);
  544. if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu)
  545. {
  546. window.event.cancelBubble = true;
  547. return false;
  548. }
  549. // Reset dropdown menu
  550. window.event.cancelBubble = true;
  551. ToolbarMenu.style.display = "none";
  552. showElement("SELECT");
  553. showElement("OBJECT");
  554. ToolbarMenu = thisMenu;
  555. IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
  556. // Set dropdown menu display position
  557. x = window.event.srcElement.offsetLeft +
  558. window.event.srcElement.offsetParent.offsetLeft;
  559. if (MenuIDStr == LastMSMenu)
  560. x += (window.event.srcElement.offsetWidth - thisMenu.style.posWidth);
  561. x2 = x + window.event.srcElement.offsetWidth;
  562. y = (IsMSMenu)?
  563. (idRow1.offsetHeight) :
  564. (idRow1.offsetHeight + idRow2.offsetHeight + idRow3.offsetHeight);
  565. thisMenu.style.top = y;
  566. thisMenu.style.left = x;
  567. thisMenu.style.clip = "rect(0 0 0 0)";
  568. thisMenu.style.display = "block";
  569. // delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
  570. window.setTimeout("showMenu()", 2);
  571. return true;
  572. }
  573. function showMenu()
  574. {
  575. if (ToolbarMenu != null)
  576. {
  577. IsMenuDropDown = (Frame_Supported && IsMSMenu == false)? false : true;
  578. if (IsMenuDropDown == false)
  579. {
  580. y = (y - ToolbarMenu.offsetHeight - idRow3.offsetHeight);
  581. if (y < 0) y = 0;
  582. ToolbarMenu.style.top = y;
  583. }
  584. y2 = y + ToolbarMenu.offsetHeight;
  585. ToolbarMenu.style.clip = "rect(auto auto auto auto)";
  586. hideElement("SELECT");
  587. hideElement("OBJECT");
  588. hideElement("IFRAME"); //FRANKLO
  589. }
  590. }
  591. function hideMenu()
  592. {
  593. if (ToolbarMenu != null && ToolbarMenu != StartMenu)
  594. {
  595. // Don't hide the menu if the mouse move between the menu and submenus
  596. cY = event.clientY + document.body.scrollTop;
  597. if ( (event.clientX >= (x+5) && event.clientX <= x2) &&
  598. ((IsMenuDropDown == true && cY > (y-10) && cY <= y2) ||
  599. (IsMenuDropDown == false && cY >= y && cY <= (y2+10)) ))
  600. {
  601. window.event.cancelBubble = true;
  602. return;
  603. }
  604. ToolbarMenu.style.display = "none";
  605. ToolbarMenu = StartMenu;
  606. window.event.cancelBubble = true;
  607. showElement("SELECT");
  608. showElement("OBJECT");
  609. showElement("IFRAME"); //FRANKLO
  610. }
  611. }
  612. function hideElement(elmID)
  613. {
  614. for (i = 0; i < document.all.tags(elmID).length; i++)
  615. {
  616. obj = document.all.tags(elmID)[i];
  617. if (! obj || ! obj.offsetParent)
  618. continue;
  619. // Find the element's offsetTop and offsetLeft relative to the BODY tag.
  620. objLeft = obj.offsetLeft;
  621. objTop = obj.offsetTop;
  622. objParent = obj.offsetParent;
  623. while (objParent.tagName.toUpperCase() != "BODY")
  624. {
  625. objLeft += objParent.offsetLeft;
  626. objTop += objParent.offsetTop;
  627. objParent = objParent.offsetParent;
  628. }
  629. // Adjust the element's offsetTop relative to the dropdown menu
  630. objTop = objTop - y;
  631. if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth))
  632. ;
  633. else if (objTop > ToolbarMenu.offsetHeight)
  634. ;
  635. else if (IsMSMenu && (y + ToolbarMenu.offsetHeight) <= 80)
  636. ;
  637. else
  638. obj.style.visibility = "hidden";
  639. }
  640. }
  641. function showElement(elmID)
  642. {
  643. for (i = 0; i < document.all.tags(elmID).length; i++)
  644. {
  645. obj = document.all.tags(elmID)[i];
  646. if (! obj || ! obj.offsetParent)
  647. continue;
  648. obj.style.visibility = "";
  649. }
  650. }
  651. function formatURL(URLStr, InstrumentStr)
  652. {
  653. var tempStr = URLStr;
  654. if (DoInstrumentation && URLStr != "" )
  655. {
  656. var ParamPos1 = URLStr.indexOf("?");
  657. var ParamPos2 = URLStr.lastIndexOf("?");
  658. var ParamPos3 = URLStr.toLowerCase().indexOf("target=");
  659. var ParamPos4 = URLStr.indexOf("#");
  660. var Bookmark = "";
  661. var URL = URLStr;
  662. if (ParamPos4 >= 0)
  663. {
  664. URL = URLStr.substr(0, ParamPos4);
  665. Bookmark = URLStr.substr(ParamPos4);
  666. }
  667. if (ParamPos1 == -1)
  668. tempStr = "?MSCOMTB=";
  669. else if (ParamPos1 == ParamPos2 && ParamPos3 == -1)
  670. tempStr = "&MSCOMTB=";
  671. else if (ParamPos1 == ParamPos2 && ParamPos3 != -1)
  672. tempStr = "?MSCOMTB=";
  673. else if (ParamPos1 < ParamPos2)
  674. tempStr = "&MSCOMTB=";
  675. tempStr = URL + tempStr + InstrumentStr.replace(" ","%20") + Bookmark;
  676. }
  677. return tempStr;
  678. }
  679. function prepTrackingString(ts, type)
  680. {
  681. var rArray;
  682. var rString;
  683. var pName = '';
  684. if (0 == type)
  685. {
  686. pName = 'p=';
  687. rString = ts.substring(1);
  688. rArray = rString.split('/');
  689. }
  690. if (1 == type)
  691. {
  692. pName = 'qs=';
  693. rString = ts.substring(1);
  694. rArray = rString.split('&');
  695. }
  696. if (2 == type)
  697. {
  698. pName = 'f=';
  699. rString = escape(ts);
  700. return pName + rString;
  701. }
  702. if (3 == type)
  703. {
  704. pName = 'tPage=';
  705. rString = escape(ts);
  706. return pName+rString;
  707. }
  708. if (4 == type)
  709. {
  710. pName = 'sPage=';
  711. rString = escape(ts);
  712. return pName + rString;
  713. }
  714. if (5 == type)
  715. {
  716. pName = 'r=';
  717. rString = escape(ts);
  718. return pName + rString;
  719. }
  720. if (6 == type)
  721. {
  722. pName = 'MSID=';
  723. rString = escape(ts);
  724. return pName + rString;
  725. }
  726. if (7 == type)
  727. {
  728. pName = 'source=';
  729. rString = ts.toLowerCase();
  730. if(rString.indexOf("microsoft.com") != -1)
  731. {
  732. rString = rString.substring(0,rString.indexOf("microsoft.com"));
  733. if('' == rString)
  734. {
  735. rString = "www";
  736. }
  737. else
  738. {
  739. rString = rString.substring(0,rString.length -1);
  740. }
  741. }
  742. return pName + rString;
  743. }
  744. if (8 == type)
  745. {
  746. pName = 'TYPE=';
  747. rString = escape(ts);
  748. return pName + rString;
  749. }
  750. rString = '';
  751. if(null != rArray)
  752. {
  753. if(0 == type)
  754. {
  755. for( j=0; j < rArray.length - 1; j++)
  756. {
  757. rString += rArray[j] + '_';
  758. }
  759. }
  760. else
  761. {
  762. for( j=0; j < rArray.length ; j++)
  763. {
  764. rString += rArray[j] + '_';
  765. }
  766. }
  767. }
  768. rString = rString.substring(0, rString.length - 1);
  769. return pName + rString;
  770. }
  771. function buildIMG(pArr)
  772. {
  773. /*
  774. var TG = '<LAYER visibility="hide"><div style="display:none;"><IMG src="' + location.protocol + '//c.microsoft.com/trans_pixel.asp?';
  775. for(var i=0; i<pArr.length; i++)
  776. {
  777. if(0 == i)
  778. {
  779. TG += pArr[i];
  780. }
  781. else
  782. {
  783. TG += '&' + pArr[i];
  784. }
  785. }
  786. TG +='" height="0" width="0" hspace="0" vspace="0" Border="0"></div></layer>';
  787. document.writeln(TG);
  788. */
  789. return;
  790. }