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.

1191 lines
37 KiB

  1. var RTL = false;
  2. var scFlag = false;
  3. var scrollcount = 0;
  4. if (document.dir == 'rtl')
  5. RTL = true;
  6. var Strict_Compat = false;
  7. var ToolBar_Supported = false;
  8. var Frame_Supported = false;
  9. var DoInstrumentation = false;
  10. var doImage = doImage;
  11. var TType = TType;
  12. if (navigator.userAgent.indexOf("MSIE") != -1 &&
  13. navigator.userAgent.indexOf("Windows") != -1 &&
  14. navigator.appVersion.substring(0,1) > 3)
  15. {
  16. ToolBar_Supported = true;
  17. if(!RTL){
  18. if (document.compatMode == "CSS1Compat")
  19. {
  20. //alert("strict!");
  21. Strict_Compat = true;
  22. }
  23. }
  24. }
  25. if(doImage == null)
  26. {
  27. var a= new Array();
  28. a[0] = prepTrackingString(window.location.hostname,7);
  29. if (TType == null)
  30. {
  31. a[1] = prepTrackingString('PV',8);
  32. }
  33. else
  34. {
  35. a[1] = prepTrackingString(TType,8);
  36. }
  37. a[2] = prepTrackingString(window.location.pathname,0);
  38. if( '' != window.document.referrer)
  39. {
  40. a[a.length] = prepTrackingString(window.document.referrer,5);
  41. }
  42. if (navigator.userAgent.indexOf("SunOS") == -1 && navigator.userAgent.indexOf("Linux") == -1)
  43. {
  44. buildIMG(a);
  45. }
  46. }
  47. if (ToolBar_Supported)
  48. {
  49. var newLineChar = String.fromCharCode(10);
  50. var char34 = String.fromCharCode(34);
  51. var LastMSMenu = "";
  52. var LastICPMenu = "";
  53. var CurICPMenu = "";
  54. var IsMSMenu = false;
  55. var IsMenuDropDown = true;
  56. var HTMLStr;
  57. var FooterStr;
  58. var TBLStr;
  59. var x = 0;
  60. var y = 0;
  61. var x2 = 0;
  62. var y2 = 0;
  63. var x3 = 0;
  64. var MSMenuWidth;
  65. var ToolbarMinWidth;
  66. var ToolbarMenu;
  67. var ToolbarBGColor;
  68. var ToolbarLoaded = false;
  69. var aDefMSColor = new Array(3);
  70. var aDefICPColor = new Array(3);
  71. var aCurMSColor = new Array(3);
  72. var aCurICPColor = new Array(3);
  73. var MSFont;
  74. var ICPFont;
  75. var MSFTFont;
  76. var ICPFTFont;
  77. var MaxMenu = 30;
  78. var TotalMenu = 0;
  79. var arrMenuInfo = new Array(30);
  80. var bFstICPTBMenu = true;
  81. var bFstICPFTMenu = true;
  82. // Output style sheet and toolbar ID
  83. document.write("<SPAN ID='StartMenu' STYLE='display:none;'></SPAN>");
  84. // Build Footer template
  85. if ( !RTL ){
  86. FooterStr = "<TABLE ID='idFooter1' STYLE='background-color:white;' cellSpacing='0' cellPadding='0' border='0'>" +
  87. "<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>" +
  88. "<TR VALIGN='BOTTOM'><TD COLSPAN='2' ID='idFooterDate2' STYLE='background-color:white;height:13;width:100%' NOWRAP><!--ICP_FOOTERDATE2_TITLES--></TD></TR>" +
  89. "</TABLE><TABLE ID='idFooter' STYLE='background-color:white;width:100%' cellSpacing='0' cellPadding='0' border='0'>" +
  90. "<TR VALIGN='MIDDLE'><TD ID='idFooterRow1' STYLE='background-color:white;height:20;width:100%' NOWRAP><!--ICP_FOOTERMENU_TITLES--></TD></TR>" +
  91. "<TR VALIGN='MIDDLE'><TD ID='idFooterRow2' STYLE='background-color:white;height:30;width:100%' NOWRAP><!--MS_FOOTERMENU_TITLES--></TD></TR>" +
  92. "</TABLE>";
  93. }else if(RTL){
  94. // Shailr - Not sure if I need this code yet.
  95. // RTL Correction: Check if <html> or <body> have the dir="rtl" attribute
  96. var isRTL = false;
  97. var isIE5 = navigator.appVersion.indexOf("MSIE 4") == -1;
  98. if (isIE5)
  99. {
  100. if (document.body.dir == 'rtl' || document.dir == 'rtl')
  101. isRTL = true;
  102. }
  103. else // test RTL in IE4
  104. {
  105. var ht = document.body.outerHTML;
  106. ht = ht.substring(1, ht.indexOf(">")).toLowerCase();
  107. //if (ht.indexOf("dir=rtl") > -1) isRTL = true;
  108. if ((ht.indexOf("iedir=rtl") > -1) || (ht.indexOf("dir=rtl") > -1)) isRTL = true;
  109. }
  110. // End of RTL Correction.
  111. // MNP1 addition - Build Footer template
  112. FooterStr = "<TABLE ID='idFooter1' STYLE='background-color:white;' cellSpacing='0' cellPadding='0' border='0'>" +
  113. "<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>" +
  114. "<TR VALIGN='BOTTOM'><TD COLSPAN='2' ID='idFooterDate2' STYLE='background-color:white;height:13;width:100%' NOWRAP><!--ICP_FOOTERDATE2_TITLES--></TD></TR>" +
  115. "</TABLE><TABLE ID='idFooter' STYLE='background-color:white;width:100%' cellSpacing='0' cellPadding='0' border='0'>" +
  116. "<TR VALIGN='MIDDLE'><TD ID='idFooterRow1' STYLE='background-color:white;height:20;width:100%' NOWRAP><!--ICP_FOOTERMENU_TITLES--></TD></TR>" +
  117. "<TR VALIGN='MIDDLE'><TD ID='idFooterRow2' STYLE='background-color:white;height:30;width:100%' NOWRAP><!--MS_FOOTERMENU_TITLES--></TD></TR>" +
  118. "</TABLE>";
  119. //end of MNP1 addition
  120. //isRTL = true;
  121. }
  122. // Build toolbar template
  123. HTMLStr = "<DIV ID='idToolbar' STYLE='background-color:white;width:100%;'>";
  124. HTMLStr += "<DIV ID='idRow1' STYLE='position:relative;height:20px;'>";
  125. //HTMLStr += "<DIV ID='idICPBanner' STYLE='position:absolute;top:0px;left:0px;height:60px;width:250px;overflow:hidden;vertical-align:top;'><!--BEG_ICP_BANNER--><!--END_ICP_BANNER--></DIV>";
  126. if (!RTL){
  127. //HTMLStr = "<DIV ID='idToolbar' STYLE='background-color:white;width:100%'>";
  128. //HTMLStr += "<DIV ID='idRow1' STYLE='position:relative;height:20px;'>";
  129. HTMLStr += "<DIV ID='idICPBanner' STYLE='position:absolute;top:0px;left:0px;height:60px;width:250px;overflow:hidden;vertical-align:top;'><!--BEG_ICP_BANNER--><!--END_ICP_BANNER--></DIV>";
  130. HTMLStr += "<DIV ID='idMSMenuCurve' STYLE='position:absolute;top:0px;left:250px;height:20px;width:18px;overflow:hidden;vertical-align:top;'><IMG SRC='http://www.microsoft.com/library/toolbar/images/curve.gif' BORDER=0></DIV>";
  131. HTMLStr += "<DIV ID='idMSMenuPane' STYLE='position:absolute;top:0px;left:250px;height:20px;width:10px;background-color:black;float:right;' NOWRAP><!--MS_MENU_TITLES--></DIV>";
  132. HTMLStr += "</DIV>";
  133. }else if(RTL){
  134. TBLStr = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><TR STYLE='height:20;vertical-align:middle'><!--ICP_MENU_TITLES--></TR></TABLE>";
  135. //HTMLStr = "<DIV ID='idToolbar' STYLE='background-color:white;width:100%'>";
  136. //HTMLStr += "<DIV ID='idRow1' STYLE='position:relative;height:20;'>";
  137. HTMLStr += "<DIV ID='idICPBanner' STYLE='position:absolute;top:0;left:0;height:60;width:250;overflow:hidden;vertical-align:top;'><!--BEG_ICP_BANNER--><!--END_ICP_BANNER--></DIV>";
  138. HTMLStr += "<DIV ID='idMSMenuCurve' STYLE='position:absolute;top:0;left:250;height:20;width:18;overflow:hidden;vertical-align:top;'><IMG SRC='/library/toolbar/iw/images/curve.gif' BORDER=0></DIV>";
  139. // RTL Correction: added: dir='ltr' (forcing LTR!), added: &nbsp; (prevents last menu problem)
  140. HTMLStr += "<DIV dir='ltr' lang='he' ID='idMSMenuPane' STYLE='position:absolute;top:0;left:250;height:20;width:10;color:white;background-color:black;float:left;' NOWRAP><!--MS_MENU_TITLES-->&nbsp;</DIV>";
  141. HTMLStr += "</DIV>";
  142. }
  143. if(!RTL){
  144. HTMLStr += "<DIV ID='idRow2' STYLE='position:relative;left:250px;height:40px;'>";
  145. HTMLStr += "<DIV ID='idADSBanner' STYLE='position:absolute;top:0px;left:0px;height:40px;width:200px;vertical-align:top;overflow:hidden;'><!--BEG_ADS_BANNER--><!--END_ADS_BANNER--></DIV>";
  146. HTMLStr += "<DIV ID='idMSCBanner' STYLE='position:absolute;top:0px;left:180px;height:40px;width:112px;vertical-align:top;overflow:hidden;' ALIGN=RIGHT><!--BEG_MSC_BANNER--><!--END_MSC_BANNER--></DIV>";
  147. HTMLStr += "</DIV>";
  148. }else if(RTL){
  149. HTMLStr += "<DIV ID='idRow2' STYLE='position:relative;left:000;height:40px;'>" ; // RTL Correction: was left:250
  150. HTMLStr += "<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>";
  151. HTMLStr += "<DIV ID='idMSCBanner' STYLE='position:absolute;top:0;left:200;height:40;width:112;vertical-align:top;overflow:hidden;' ALIGN=LEFT><!--BEG_MSC_BANNER--><!--END_MSC_BANNER--></DIV>";
  152. HTMLStr += "</DIV>";
  153. }
  154. if(!RTL){
  155. HTMLStr += "<DIV ID='idRow3' STYLE='position:relative;height:20px;width:100%'>";
  156. // zIndex Correction
  157. HTMLStr += "<DIV ID='idICPMenuPane' STYLE='position:absolute;top:0px;left:0px;height:20px;background-color:black;' NOWRAP><!--ICP_MENU_TITLES--></DIV>";
  158. HTMLStr += "</DIV>";
  159. HTMLStr += "</DIV>";
  160. }else if (RTL){
  161. HTMLStr += "<DIV ID='idRow3' STYLE='position:relative;height:20px;width:100%'>";
  162. // RTL Correction: added: dir='rtl'
  163. HTMLStr += "<DIV dir='rtl' ID='idICPMenuPane' STYLE='position:absolute;top:0;left:0;height:20px;color:white;background-color:black;' NOWRAP><!--ICP_MENU_TITLES--></DIV>";
  164. HTMLStr += "</DIV>";
  165. HTMLStr += "</DIV>";
  166. HTMLStr += "<SCRIPT FOR=idToolbar EVENT=onresize>resizeToolbar();</SCRIPT>";
  167. HTMLStr += "<SCRIPT FOR=idToolbar EVENT=onmouseover>hideMenu();</SCRIPT>";
  168. }
  169. HTMLStr += "<SCRIPT TYPE='text/javascript'>" +
  170. " var ToolbarMenu = StartMenu;" +
  171. "</SCRIPT>" +
  172. "<DIV WIDTH=100%>";
  173. // Define event handlers
  174. if(!RTL){
  175. window.onresize = resizeToolbar;
  176. window.onscroll = scrollbaroptions;
  177. }
  178. // Intialize global variables
  179. ToolbarBGColor = "white"; // toolbar background color
  180. if (Strict_Compat)
  181. {
  182. MSFont = "bold x-small Arial";
  183. ICPFont = "bold x-small Verdana";
  184. }
  185. else
  186. {
  187. if( !RTL ){
  188. MSFont = "xx-small Verdana";
  189. ICPFont = "bold xx-small Verdana";
  190. }else if(RTL){
  191. MSFont = "x-small Arial"; // RTL Correction: (was Verdana)
  192. ICPFont = "bold x-small Arial"; // RTL Correction: (was Verdana)
  193. //MNP1 RTL revision
  194. MSFTFont = "11px Arial";
  195. ICPFTFont = "bold 11px Arial"
  196. //end
  197. }
  198. }
  199. aDefMSColor[0] = aCurMSColor[0] = "black"; // bgcolor;
  200. aDefMSColor[1] = aCurMSColor[1] = "white"; // text font color
  201. aDefMSColor[2] = aCurMSColor[2] = "red"; // mouseover font color
  202. aDefICPColor[0] = aCurICPColor[0] = "#6699CC"; // bgcolor;
  203. aDefICPColor[1] = aCurICPColor[1] = "white"; // text font color
  204. aDefICPColor[2] = aCurICPColor[2] = "red"; // mouseover font color
  205. }
  206. // The hard-coded numbers in functions - drawToolbar() & resizeToolbar()
  207. // correspond to the dimension of the four gif files:
  208. // ICP_BANNER: 60h x 250w
  209. // ADS_BANNER: 40h x 200w
  210. // MSC_BANNER: 40h x 112w
  211. // Curve: 20h x 18w
  212. function drawFooter(sLastUpdated, position)
  213. {
  214. if(!RTL){
  215. var re = "<!--TEMPCOLOR-->";
  216. var sUpdatedDate = "";
  217. if (ToolbarBGColor.toUpperCase() == "WHITE" || ToolbarBGColor.toUpperCase() == "#FFFFFF")
  218. {
  219. while (FooterStr.indexOf(re) != -1)
  220. FooterStr = FooterStr.replace(re, "000000");
  221. }
  222. else
  223. {
  224. while (FooterStr.indexOf(re) != -1)
  225. FooterStr = FooterStr.replace(re, aDefICPColor[1]);
  226. }
  227. var re2 = "<!--TEMPCOLOR2-->";
  228. while (FooterStr.indexOf(re2) != -1)
  229. FooterStr = FooterStr.replace(re2, aDefICPColor[2]);
  230. }else if (RTL){
  231. var re = /<!--TEMPCOLOR-->/g;
  232. var sUpdatedDate = "";
  233. if (ToolbarBGColor.toUpperCase() == "WHITE" || ToolbarBGColor.toUpperCase() == "#FFFFFF")
  234. FooterStr = FooterStr.replace(re, "000000");
  235. else
  236. FooterStr = FooterStr.replace(re, aDefICPColor[1]);
  237. var re2 = /<!--TEMPCOLOR2-->/g;
  238. FooterStr = FooterStr.replace(re2, aDefICPColor[2]);
  239. }
  240. sUpdatedDate = "<SPAN STYLE='font:" + MSFont + "'>"
  241. if (typeof sLastUpdated != "undefined")
  242. sUpdatedDate += sLastUpdated;
  243. sUpdatedDate += "</SPAN>";
  244. FooterStr = FooterStr.replace("<!--ICP_FOOTERDATE1_TITLES-->", sUpdatedDate);
  245. document.body.innerHTML += FooterStr;
  246. idFooterRow1.style.backgroundColor = aDefICPColor[0];
  247. idFooterRow2.style.backgroundColor = ToolbarBGColor;
  248. if (typeof sLastUpdated == "undefined")
  249. idFooter1.style.display = "none";
  250. if (typeof position != "undefined")
  251. idPosition.width = position;
  252. }
  253. function drawToolbar()
  254. {
  255. HTMLStr += "</DIV>";
  256. document.write(HTMLStr);
  257. ToolbarLoaded = true;
  258. MSMenuWidth = Math.max(idMSMenuPane.offsetWidth, (200+112));
  259. ToolbarMinWidth = (250+18) + MSMenuWidth;
  260. idToolbar.style.backgroundColor = ToolbarBGColor;
  261. idMSMenuPane.style.backgroundColor = aDefMSColor[0];
  262. idICPMenuPane.style.backgroundColor = aDefICPColor[0];
  263. if (RTL){
  264. idMSMenuPane.style.color = aDefMSColor[1];
  265. idICPMenuPane.style.color = aDefICPColor[1];
  266. }
  267. resizeToolbar();
  268. for (i = 0; i < TotalMenu; i++)
  269. {
  270. thisMenu = document.all(arrMenuInfo[i].IDStr);
  271. if (thisMenu != null)
  272. {
  273. if (arrMenuInfo[i].IDStr == LastMSMenu && arrMenuInfo[i].type == "R")
  274. {
  275. //Last MSMenu has to be absolute width
  276. arrMenuInfo[i].type = "A";
  277. arrMenuInfo[i].unit = 200;
  278. }
  279. if (arrMenuInfo[i].type == "A")
  280. if(!RTL){
  281. thisMenu.style.width = arrMenuInfo[i].unit + 'px';
  282. }else{
  283. thisMenu.style.width = arrMenuInfo[i].unit;
  284. }
  285. else
  286. thisMenu.style.width = Math.round(arrMenuInfo[i].width * arrMenuInfo[i].unit) + 'em';
  287. }
  288. }
  289. }
  290. function resizeToolbar()
  291. {
  292. scFlag = false;
  293. scrollcount = 0;
  294. if (ToolBar_Supported == false) return;
  295. w = Math.max(ToolbarMinWidth, document.body.clientWidth) - ToolbarMinWidth;
  296. if ( !RTL ){
  297. if (document.all("idMSMenuCurve"))
  298. {
  299. idMSMenuCurve.style.left = (250+w) + 'px';
  300. idMSMenuPane.style.left = (250+w+18) + 'px';
  301. idMSMenuPane.style.width = MSMenuWidth + 'px';
  302. idADSBanner.style.left = (w+18) + 'px';
  303. idMSCBanner.style.left = (w+18+200) + 'px';
  304. idMSCBanner.style.width = (MSMenuWidth - 200) + 'px';
  305. idICPMenuPane.style.width = ToolbarMinWidth + w + 'px';
  306. }
  307. }else if( RTL ){
  308. idMSMenuCurve.style.left = MSMenuWidth; // RTL Correction: was (250+w);
  309. idMSMenuPane.style.left = 0; // RTL Correction: was (250+w+18);
  310. idMSMenuPane.style.width = MSMenuWidth;
  311. idADSBanner.style.left = 112; // RTL Correction: was (w+18);
  312. idMSCBanner.style.left = 0; // RTL Correction: was (w+18+200);
  313. idMSCBanner.style.width = (MSMenuWidth - 200);
  314. idICPMenuPane.style.width = ToolbarMinWidth + w;
  315. idICPBanner.style.left = MSMenuWidth + 18 + w; // RTL Correction: line added for ICPBanner positioning
  316. }
  317. }
  318. function setToolbarBGColor(color)
  319. {
  320. ToolbarBGColor = color;
  321. if (ToolbarLoaded == true)
  322. idToolbar.style.backgroundColor = ToolbarBGColor;
  323. }
  324. function setBannerColor(bannerColor, bgColor, fontColor, mouseoverColor)
  325. {
  326. if (bannerColor.toUpperCase() != "WHITE" && bannerColor.toUpperCase() != "FFFFFF")
  327. bgColor = bannerColor;
  328. setToolbarBGColor(bannerColor);
  329. setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor);
  330. }
  331. function setMSMenuFont(sFont)
  332. {
  333. MSFont = sFont;
  334. }
  335. function setICPMenuFont(sFont)
  336. {
  337. ICPFont = sFont;
  338. }
  339. function setDefaultMSMenuColor(bgColor, fontColor, mouseoverColor)
  340. {
  341. if (bgColor != "") aDefMSColor[0] = bgColor;
  342. if (fontColor != "") aDefMSColor[1] = fontColor;
  343. if (mouseoverColor != "") aDefMSColor[2] = mouseoverColor;
  344. }
  345. function setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor)
  346. {
  347. if (bgColor != "") aDefICPColor[0] = bgColor;
  348. if (fontColor != "") aDefICPColor[1] = fontColor;
  349. if (mouseoverColor != "") aDefICPColor[2] = mouseoverColor;
  350. }
  351. function setICPMenuColor(MenuIDStr, bgColor, fontColor, mouseoverColor)
  352. {
  353. if (ToolbarLoaded == false) return;
  354. // Reset previous ICP Menu color if any
  355. if (CurICPMenu != "")
  356. {
  357. PrevID = CurICPMenu.substring(4);
  358. CurICPMenu = "";
  359. setICPMenuColor(PrevID, aDefICPColor[0], aDefICPColor[1], aDefICPColor[2]);
  360. }
  361. var id = "AM_" + "ICP_" + MenuIDStr;
  362. var thisMenu = document.all(id);
  363. if (thisMenu != null)
  364. {
  365. CurICPMenu = "ICP_" + MenuIDStr;
  366. aCurICPColor[0] = bgColor;
  367. aCurICPColor[1] = fontColor;
  368. aCurICPColor[2] = mouseoverColor;
  369. // Change menu color
  370. if (bgColor != "")
  371. thisMenu.style.backgroundColor = bgColor;
  372. if (fontColor != "")
  373. thisMenu.style.color = fontColor;
  374. // Change subMenu color
  375. id = "ICP_" + MenuIDStr;
  376. thisMenu = document.all(id);
  377. if (thisMenu != null)
  378. {
  379. if (bgColor != "")
  380. thisMenu.style.backgroundColor = bgColor;
  381. if (fontColor != "")
  382. {
  383. i = 0;
  384. id = "AS_" + "ICP_" + MenuIDStr;
  385. thisMenu = document.all.item(id,i);
  386. while (thisMenu != null)
  387. {
  388. thisMenu.style.color = fontColor;
  389. i += 1;
  390. thisMenu = document.all.item(id,i);
  391. }
  392. }
  393. }
  394. }
  395. }
  396. function setAds(Gif,Url,AltStr)
  397. { setBanner(Gif,Url,AltStr,"<!--BEG_ADS_BANNER-->","<!--END_ADS_BANNER-->");
  398. }
  399. function setICPBanner(Gif,Url,AltStr)
  400. {
  401. if(RTL){
  402. if (Gif.indexOf("training_banner_training.gif") > 0){
  403. Gif = "training_banner_training.gif";
  404. }
  405. }
  406. setBanner(Gif,Url,AltStr,"<!--BEG_ICP_BANNER-->","<!--END_ICP_BANNER-->");
  407. }
  408. function setMSBanner(Gif,Url,AltStr)
  409. { tempGif = "http://www.microsoft.com/library/toolbar/images/" + Gif;
  410. setBanner(tempGif,Url,AltStr,"<!--BEG_MSC_BANNER-->","<!--END_MSC_BANNER-->");
  411. }
  412. function setBanner(BanGif, BanUrl, BanAltStr, BanBegTag, BanEndTag)
  413. {
  414. begPos = HTMLStr.indexOf(BanBegTag);
  415. endPos = HTMLStr.indexOf(BanEndTag) + BanEndTag.length;
  416. SubStr = HTMLStr.substring(begPos, endPos);
  417. SrcStr = "";
  418. if (BanUrl != "")
  419. SrcStr += "<A Target='_top' HREF='" + formatURL(BanUrl, BanGif) + "'>";
  420. SrcStr += "<IMG SRC='" + BanGif + "' ALT='" + BanAltStr + "' BORDER=0>";
  421. if (BanUrl != "")
  422. SrcStr += "</A>";
  423. SrcStr = BanBegTag + SrcStr + BanEndTag;
  424. HTMLStr = HTMLStr.replace(SubStr, SrcStr);
  425. }
  426. function setICPSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  427. { tempID = "ICP_" + MenuIDStr;
  428. setSubMenuWidth(tempID, WidthType, WidthUnit);
  429. }
  430. function setMSSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  431. { tempID = "MS_" + MenuIDStr;
  432. setSubMenuWidth(tempID, WidthType, WidthUnit);
  433. }
  434. function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit)
  435. {
  436. var fFound = false;
  437. if (TotalMenu == MaxMenu)
  438. {
  439. alert("Unable to process menu. Maximum of " + MaxMenu + " reached.");
  440. return;
  441. }
  442. for (i = 0; i < TotalMenu; i++)
  443. if (arrMenuInfo[i].IDStr == MenuIDStr)
  444. {
  445. fFound = true;
  446. break;
  447. }
  448. if (!fFound)
  449. {
  450. arrMenuInfo[i] = new menuInfo(MenuIDStr);
  451. TotalMenu += 1;
  452. }
  453. if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1)
  454. {
  455. arrMenuInfo[i].type = "A";
  456. arrMenuInfo[i].unit = 160;
  457. }
  458. else
  459. {
  460. arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R";
  461. arrMenuInfo[i].unit = WidthUnit;
  462. }
  463. }
  464. // This function creates a menuInfo object instance.
  465. function menuInfo(MenuIDStr)
  466. {
  467. this.IDStr = MenuIDStr;
  468. this.type = "";
  469. this.unit = 0;
  470. this.width = 0;
  471. this.count = 0;
  472. }
  473. function updateSubMenuWidth(MenuIDStr)
  474. {
  475. for (i = 0; i < TotalMenu; i++)
  476. if (arrMenuInfo[i].IDStr == MenuIDStr)
  477. {
  478. if (arrMenuInfo[i].width < MenuIDStr.length)
  479. arrMenuInfo[i].width = MenuIDStr.length;
  480. arrMenuInfo[i].count = arrMenuInfo[i].count + 1;
  481. break;
  482. }
  483. }
  484. function addICPMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
  485. {
  486. if(RTL){
  487. if (LastICPMenu == "") HTMLStr = HTMLStr.replace("<!--ICP_MENU_TITLES-->", TBLStr);
  488. }
  489. if (addICPMenu.arguments.length > 4)
  490. TargetStr = addICPMenu.arguments[4];
  491. else
  492. TargetStr = "_top";
  493. tempID = "ICP_" + MenuIDStr;
  494. addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, true);
  495. if (RTL){
  496. LastICPMenu = tempID;
  497. }else{
  498. bFstICPTBMenu=false;
  499. }
  500. }
  501. function addMSMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr)
  502. {
  503. TargetStr = "_top";
  504. tempID = "MS_" + MenuIDStr;
  505. //alert(" TempID: " + tempID + " MenuDisplayString: " + MenuDisplayStr + " Menu Help String :" + MenuHelpStr + " MenuUrl:" + MenuURLStr + " Target:" + TargetStr);
  506. addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, false);
  507. LastMSMenu = tempID;
  508. }
  509. function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, bICPMenu)
  510. {
  511. cFont = bICPMenu? ICPFont : MSFont;
  512. cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
  513. cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  514. cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
  515. if (RTL){
  516. cStyle = "font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";";
  517. if (MenuHelpStr == "") MenuHelpStr = MenuDisplayStr; // Shailr. This line should have been before the line MenuStr = newLineChar; but I am tryig to avoid another if..else
  518. }
  519. tagStr = bICPMenu? "<!--ICP_MENU_TITLES-->" : "<!--MS_MENU_TITLES-->";
  520. MenuStr = newLineChar;
  521. if (!RTL){
  522. if ((bICPMenu == false && LastMSMenu != "") || (bICPMenu == true && bFstICPTBMenu==false))
  523. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>|&nbsp;</SPAN>";
  524. MenuStr += "<A TARGET='" + TargetStr + "' TITLE='" + MenuHelpStr + "'" +
  525. " ID='AM_" + MenuIDStr + "'" +
  526. " STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";'";
  527. if (MenuURLStr != "")
  528. {
  529. if (bICPMenu)
  530. MenuStr += " HREF='" + formatURL(MenuURLStr, ("ICP_" + MenuDisplayStr)) + "'";
  531. else
  532. MenuStr += " HREF='" + formatURL(MenuURLStr, ("MS_" + MenuDisplayStr)) + "'";
  533. }
  534. else
  535. MenuStr += " HREF='' onclick='window.event.returnValue=false;'";
  536. MenuStr += " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "'); hideMenu();" + char34 +
  537. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "'); doMenu('"+ MenuIDStr + "');" + char34 + ">" +
  538. "&nbsp;" + MenuDisplayStr + "&nbsp;</a>";
  539. MenuStr += tagStr;
  540. }
  541. if ( RTL ){
  542. if (bICPMenu)
  543. MenuStr += "<TD STYLE='" + cStyle + "' ID='AM_" + MenuIDStr + "' NOWRAP>";
  544. else{
  545. // RTL Correction: added: dir='rtl' (for MSMenu)
  546. MenuStr += "<SPAN dir='rtl' STYLE='" + cStyle + "'>";
  547. if (LastMSMenu != "") MenuStr += "|";
  548. MenuStr += "&nbsp;";
  549. }
  550. MenuStr += "<A STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + ";'" +
  551. " TARGET='" + TargetStr + "'" +
  552. " TITLE=" + char34 + MenuHelpStr + char34;
  553. if (MenuURLStr != "")
  554. MenuStr += " HREF='" + formatURL(MenuURLStr, ((bICPMenu? "ICP_":"MS_") + MenuDisplayStr)) + "'";
  555. else
  556. MenuStr += " HREF='' onclick='window.event.returnValue=false;'";
  557. MenuStr += " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "'); hideMenu();" + char34 +
  558. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "'); doMenu('"+ MenuIDStr + "');" + char34 + ">" +
  559. "&nbsp;" + MenuDisplayStr + "&nbsp;</a>";
  560. if (bICPMenu)
  561. MenuStr += "&nbsp;</TD><TD STYLE='" + cStyle + "'>|</TD>";
  562. else
  563. MenuStr += "</SPAN>";
  564. MenuStr += tagStr;
  565. }
  566. HTMLStr = HTMLStr.replace(tagStr, MenuStr);
  567. setSubMenuWidth(MenuIDStr,"default",0);
  568. }
  569. function addICPSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
  570. {
  571. if (addICPSubMenu.arguments.length > 3)
  572. TargetStr = addICPSubMenu.arguments[3];
  573. else
  574. TargetStr = "_top";
  575. tempID = "ICP_" + MenuIDStr;
  576. addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,true);
  577. }
  578. function addMSSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr)
  579. {
  580. TargetStr = "_top";
  581. tempID = "MS_" + MenuIDStr;
  582. //alert("TempID: " + tempID + "\nSubMenuStr: " + SubMenuStr + "\n SubMenuURLStr: " + SubMenuURLStr + "\n TargetStr: " + TargetStr);
  583. addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,false);
  584. }
  585. function addSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, TargetStr, bICPMenu)
  586. {
  587. cFont = bICPMenu? ICPFont : MSFont;
  588. cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0];
  589. cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  590. cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2];
  591. var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU");
  592. if (MenuPos == -1) { MenuPos = MenuIDStr.length; }
  593. InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "|" + SubMenuStr;
  594. URLStr = formatURL(SubMenuURLStr, InstrumentStr);
  595. var LookUpTag = "<!--" + MenuIDStr + "-->";
  596. var sPos = HTMLStr.indexOf(LookUpTag);
  597. if (sPos <= 0)
  598. {
  599. HTMLStr += newLineChar + newLineChar +
  600. "<SPAN ID='" + MenuIDStr + "'";
  601. if (!RTL){
  602. HTMLStr += " STYLE='display:none;position:absolute;width:160px;background-color:" + cColor0 + ";padding-top:0px;padding-left:0px;padding-bottom:20px;z-index:9px;'";
  603. }else if (RTL){
  604. HTMLStr += " STYLE='display:none;position:absolute;width:160;background-color:" + cColor0 + ";padding-top:0;padding-left:0;padding-bottom:20;z-index:9;'";
  605. }
  606. HTMLStr += "onmouseout='hideMenu();'>";
  607. if (Frame_Supported == false || bICPMenu == false)
  608. if (!RTL){
  609. HTMLStr += "<HR STYLE='position:absolute;left:0px;top:0px;color:" + cColor1 + "' SIZE=1>";
  610. HTMLStr += "<DIV STYLE='position:relative;left:0px;top:8px;'>";
  611. } else if (RTL){
  612. HTMLStr += "<HR STYLE='position:absolute;left:0;top:0;color:" + cColor1 + "' SIZE=1>";
  613. HTMLStr += "<DIV STYLE='right:0;top:8;' dir='rtl'>";
  614. }
  615. }
  616. TempStr = newLineChar +
  617. "<A ID='AS_" + MenuIDStr + "'" +
  618. " STYLE='text-decoration:none;cursor:hand;font:" + cFont + ";color:" + cColor1 + "'" +
  619. " HREF='" + URLStr + "' TARGET='" + TargetStr + "'" +
  620. " onmouseout=" + char34 + "mouseMenu('out' ,'" + MenuIDStr + "');" + char34 +
  621. " onmouseover=" + char34 + "mouseMenu('over','" + MenuIDStr + "');" + char34 + ">" +
  622. "&nbsp;" + SubMenuStr + "</A><BR>" + LookUpTag;
  623. if (sPos <= 0)
  624. HTMLStr += TempStr + "</DIV></SPAN>";
  625. else
  626. HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
  627. updateSubMenuWidth(MenuIDStr);
  628. }
  629. function addICPSubMenuLine(MenuIDStr)
  630. {
  631. tempID = "ICP_" + MenuIDStr;
  632. addSubMenuLine(tempID,true);
  633. }
  634. function addMSSubMenuLine(MenuIDStr)
  635. {
  636. tempID = "MS_" + MenuIDStr;
  637. addSubMenuLine(tempID,false);
  638. }
  639. function addSubMenuLine(MenuIDStr, bICPMenu)
  640. {
  641. var LookUpTag = "<!--" + MenuIDStr + "-->";
  642. var sPos = HTMLStr.indexOf(LookUpTag);
  643. if (sPos > 0)
  644. {
  645. cColor = bICPMenu? aDefICPColor[1] : aDefMSColor[1];
  646. TempStr = newLineChar + "<HR STYLE='color:" + cColor + "' SIZE=1>" + LookUpTag;
  647. HTMLStr = HTMLStr.replace(LookUpTag, TempStr);
  648. }
  649. }
  650. function addMSFooterMenu(MenuDisplayStr, MenuURLStr)
  651. {
  652. addFooterMenu(MenuDisplayStr, MenuURLStr, false)
  653. }
  654. function addICPFooterMenu(MenuDisplayStr, MenuURLStr)
  655. {
  656. addFooterMenu(MenuDisplayStr, MenuURLStr, true)
  657. bFstICPFTMenu = false;
  658. }
  659. function addFooterMenu(MenuDisplayStr, MenuURLStr, bICPMenu)
  660. {
  661. cFont = bICPMenu? ICPFont : MSFont;
  662. cColor1 = aDefICPColor[1];
  663. cColor2 = aDefICPColor[2];
  664. tagStr = bICPMenu? "<!--ICP_FOOTERMENU_TITLES-->" : "<!--MS_FOOTERMENU_TITLES-->";
  665. MenuStr = "";
  666. if ((bICPMenu) && bFstICPFTMenu == false)
  667. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:" + cColor1 + "'>&nbsp;|</SPAN>";
  668. if ((bICPMenu == false) && (MenuURLStr == ''))
  669. MenuStr += "<SPAN STYLE='font:" + cFont + ";color:<!--TEMPCOLOR-->'>&nbsp;" + MenuDisplayStr + "&nbsp;</SPAN>";
  670. else
  671. {
  672. MenuStr += "&nbsp;<A TARGET='_top' STYLE='";
  673. if (bICPMenu)
  674. MenuStr += "text-decoration:none;";
  675. MenuStr += "cursor:hand;font:" + cFont + ";"
  676. if (bICPMenu)
  677. MenuStr += "color:" + cColor1 + ";'";
  678. else
  679. MenuStr += "color:<!--TEMPCOLOR-->" + ";'";
  680. MenuStr += " HREF='" + MenuURLStr + "'";
  681. MenuStr += " onmouseout=" + char34 + "this.style.color = '";
  682. if (bICPMenu)
  683. MenuStr += cColor1;
  684. else
  685. MenuStr += "<!--TEMPCOLOR-->";
  686. MenuStr += "'" + char34 + " onmouseover=" + char34 + "this.style.color = '"
  687. if (bICPMenu)
  688. MenuStr += cColor2
  689. else
  690. MenuStr += "<!--TEMPCOLOR2-->";
  691. MenuStr += "'" + char34 + ">" + MenuDisplayStr + "</A>&nbsp;";
  692. }
  693. MenuStr += tagStr;
  694. FooterStr = FooterStr.replace(tagStr, MenuStr);
  695. }
  696. function mouseMenu(id, MenuIDStr)
  697. {
  698. IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
  699. IsMouseout = (id.toUpperCase().indexOf("OUT") != -1);
  700. if (IsMouseout)
  701. {
  702. color = IsMSMenu? aDefMSColor[1] : aDefICPColor[1];
  703. if (MenuIDStr == CurICPMenu && aCurICPColor[1] != "")
  704. color = aCurICPColor[1];
  705. }
  706. else
  707. {
  708. color = IsMSMenu? aDefMSColor[2] : aDefICPColor[2];
  709. if (MenuIDStr == CurICPMenu && aCurICPColor[2] != "")
  710. color = aCurICPColor[2];
  711. }
  712. window.event.srcElement.style.color = color;
  713. }
  714. function doMenu(MenuIDStr)
  715. {
  716. var thisMenu = document.all(MenuIDStr);
  717. if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu)
  718. {
  719. window.event.cancelBubble = true;
  720. return false;
  721. }
  722. // Reset dropdown menu
  723. window.event.cancelBubble = true;
  724. ToolbarMenu.style.display = "none";
  725. showElement("SELECT");
  726. showElement("OBJECT");
  727. ToolbarMenu = thisMenu;
  728. IsMSMenu = (MenuIDStr.toUpperCase().indexOf("MS_") != -1);
  729. // Set dropdown menu display position
  730. x = window.event.srcElement.offsetLeft +
  731. window.event.srcElement.offsetParent.offsetLeft;
  732. if (RTL){
  733. // RTL correction:
  734. var ICPstart = 0;
  735. if (!IsMSMenu)
  736. {
  737. if (isIE5)
  738. ICPstart = window.event.srcElement.offsetParent.offsetParent.offsetLeft;
  739. else // for IE4 we must use...
  740. ICPstart = window.event.srcElement.offsetParent.offsetParent.offsetParent.offsetParent.offsetWidth -
  741. window.event.srcElement.offsetParent.offsetParent.offsetWidth;
  742. x += ICPstart;
  743. }
  744. x -= thisMenu.style.posWidth;
  745. x += IsMSMenu ? 8 : -2;
  746. if (x < 0) x = 0;
  747. // End of RTL Correction
  748. }
  749. if (MenuIDStr == LastMSMenu){
  750. if (!RTL){
  751. x += (window.event.srcElement.offsetWidth - thisMenu.style.posWidth);
  752. }else if (RTL){
  753. if (x < 0) x = 0;
  754. }
  755. }
  756. x2 = x + window.event.srcElement.offsetWidth;
  757. y = (IsMSMenu)?
  758. (idRow1.offsetHeight) :
  759. (idRow1.offsetHeight + idRow2.offsetHeight + idRow3.offsetHeight);
  760. if (RTL){
  761. // Get main menu width
  762. // RTL Correction:
  763. if (IsMSMenu)
  764. x2 = window.event.srcElement.offsetLeft - window.event.srcElement.offsetWidth;
  765. else
  766. x2 = window.event.srcElement.offsetParent.offsetLeft + ICPstart;
  767. // End of RTL Correction.
  768. // Get dropdown menu width
  769. x3 = x + 160;
  770. for (i = 0; i < TotalMenu; i++){
  771. if (arrMenuInfo[i].IDStr == MenuIDStr)
  772. {
  773. x3 = x+ arrMenuInfo[i].unit;
  774. break;
  775. }
  776. }
  777. }
  778. thisMenu.style.top = y;
  779. thisMenu.style.left = x;
  780. thisMenu.style.clip = "rect(0 0 0 0)";
  781. thisMenu.style.display = "block";
  782. thisMenu.style.zIndex = 102;
  783. // delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
  784. window.setTimeout("showMenu()", 2);
  785. return true;
  786. }
  787. function showMenu()
  788. {
  789. if (ToolbarMenu != null)
  790. {
  791. IsMenuDropDown = (Frame_Supported && IsMSMenu == false)? false : true;
  792. if (IsMenuDropDown == false)
  793. {
  794. y = (y - ToolbarMenu.offsetHeight - idRow3.offsetHeight);
  795. if (y < 0) y = 0;
  796. ToolbarMenu.style.top = y;
  797. }
  798. y2 = y + ToolbarMenu.offsetHeight;
  799. ToolbarMenu.style.clip = "rect(auto auto auto auto)";
  800. hideElement("SELECT");
  801. hideElement("OBJECT");
  802. if (!RTL)
  803. x2 = x + ToolbarMenu.offsetWidth;
  804. hideElement("IFRAME"); //FRANKLO
  805. }
  806. }
  807. function hideMenu()
  808. {
  809. if (ToolbarMenu != null && ToolbarMenu != StartMenu)
  810. {
  811. // Don't hide the menu if the mouse move between the menu and submenus
  812. if (!RTL){
  813. cY = event.clientY + document.body.scrollTop;
  814. cX = event.clientX;
  815. //window.status = " flag: " + scFlag + " Count: " + scrollcount + " cx: " + cX + " x: " + x + " x2: " + x2 + " offset: " + document.body.scrollWidth;
  816. //window.status = "CY: " + cY + " Y: " + y + " Y2: " + y2 + " offTop: " + document.body.scrollTop ;
  817. window.status = ToolbarMenu.style.zIndex;
  818. if (document.body.offsetWidth > x && scFlag) {
  819. cX = x + 9;
  820. }
  821. if ( (cX >= (x+5) && cX<=x2) &&
  822. ((IsMenuDropDown == true && cY > (y-10) && cY <= y2) ||
  823. (IsMenuDropDown == false && cY >= y && cY <= (y2+10)) ))
  824. {
  825. window.event.cancelBubble = true;
  826. return;
  827. }
  828. }else if(RTL){
  829. var cX = event.clientX //+ document.body.scrollLeft;
  830. // RTL correction: considers left scrollbar width!
  831. if (isRTL) cX -= 16;
  832. var cY = event.clientY + document.body.scrollTop;
  833. var bHideMenu = true;
  834. window.status = "CX: " + cX + " X: " + x + "x3: " + x3 + "TBLOFFSET: " + document.body.scrollLeft + "x2: " + x2 + "Cy: " + cY + " Y: " + y + "idrow: " +idRow3.offsetHeight ;
  835. if (cX > document.body.scrollLeft && document.body.scrollLeft > 1){
  836. cX = x3; //x + 9;
  837. }
  838. if (IsMenuDropDown == true)
  839. {// RTL Correction: cY-8 instead of cY
  840. if ( cY-8 >= (y - idRow3.offsetHeight) && cY < y)
  841. {// RTL Correction: [x,x2] --> [x2,x3]
  842. if (cX >= (x2+5) && cX <= x3) bHideMenu = false;
  843. }
  844. else if (cY >= y && cY <= y2)
  845. {
  846. if (cX > (x+5) && cX <= x3) bHideMenu = false;
  847. }
  848. }
  849. else
  850. {
  851. if (cY >= y2 && cY < (y2 + idRow3.offsetHeight))
  852. {// RTL Correction: [x,x2] --> [x2,x3]
  853. if (cX >= (x2+5) && cX <= x3) bHideMenu = false;
  854. }
  855. else if (cY >= y && cY <= y2)
  856. {
  857. if (cX > (x+5) && cX <= x3) bHideMenu = false;
  858. }
  859. }
  860. if (! bHideMenu)
  861. {
  862. window.event.cancelBubble = true;
  863. return;
  864. }
  865. }
  866. ToolbarMenu.style.display = "none";
  867. ToolbarMenu = StartMenu;
  868. window.event.cancelBubble = true;
  869. showElement("SELECT");
  870. showElement("OBJECT");
  871. if(!RTL){
  872. showElement("IFRAME"); //FRANKLO
  873. }
  874. }
  875. }
  876. function hideElement(elmID)
  877. {
  878. for (i = 0; i < document.all.tags(elmID).length; i++)
  879. {
  880. obj = document.all.tags(elmID)[i];
  881. if (! obj || ! obj.offsetParent)
  882. continue;
  883. // Find the element's offsetTop and offsetLeft relative to the BODY tag.
  884. objLeft = obj.offsetLeft;
  885. objTop = obj.offsetTop;
  886. objParent = obj.offsetParent;
  887. while (objParent.tagName.toUpperCase() != "BODY")
  888. {
  889. objLeft += objParent.offsetLeft;
  890. objTop += objParent.offsetTop;
  891. objParent = objParent.offsetParent;
  892. }
  893. // Adjust the element's offsetTop relative to the dropdown menu
  894. objTop = objTop - y;
  895. if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth))
  896. ;
  897. else if (objTop > ToolbarMenu.offsetHeight)
  898. ;
  899. else if (IsMSMenu && (y + ToolbarMenu.offsetHeight) <= 80)
  900. ;
  901. else
  902. obj.style.visibility = "hidden";
  903. }
  904. }
  905. function showElement(elmID)
  906. {
  907. for (i = 0; i < document.all.tags(elmID).length; i++)
  908. {
  909. obj = document.all.tags(elmID)[i];
  910. if (! obj || ! obj.offsetParent)
  911. continue;
  912. obj.style.visibility = "";
  913. }
  914. }
  915. function formatURL(URLStr, InstrumentStr)
  916. {
  917. var tempStr = URLStr;
  918. if (DoInstrumentation && URLStr != "" )
  919. {
  920. var ParamPos1 = URLStr.indexOf("?");
  921. var ParamPos2 = URLStr.lastIndexOf("?");
  922. var ParamPos3 = URLStr.toLowerCase().indexOf("target=");
  923. var ParamPos4 = URLStr.indexOf("#");
  924. var Bookmark = "";
  925. var URL = URLStr;
  926. if (ParamPos4 >= 0)
  927. {
  928. URL = URLStr.substr(0, ParamPos4);
  929. Bookmark = URLStr.substr(ParamPos4);
  930. }
  931. if (ParamPos1 == -1)
  932. tempStr = "?MSCOMTB=";
  933. else if (ParamPos1 == ParamPos2 && ParamPos3 == -1)
  934. tempStr = "&MSCOMTB=";
  935. else if (ParamPos1 == ParamPos2 && ParamPos3 != -1)
  936. tempStr = "?MSCOMTB=";
  937. else if (ParamPos1 < ParamPos2)
  938. tempStr = "&MSCOMTB=";
  939. tempStr = URL + tempStr + InstrumentStr.replace(" ","%20") + Bookmark;
  940. }
  941. return tempStr;
  942. }
  943. function prepTrackingString(ts, type)
  944. {
  945. var rArray;
  946. var rString;
  947. var pName = '';
  948. if (0 == type)
  949. {
  950. pName = 'p=';
  951. rString = ts.substring(1);
  952. rArray = rString.split('/');
  953. }
  954. if (1 == type)
  955. {
  956. pName = 'qs=';
  957. rString = ts.substring(1);
  958. rArray = rString.split('&');
  959. }
  960. if (2 == type)
  961. {
  962. pName = 'f=';
  963. rString = escape(ts);
  964. return pName + rString;
  965. }
  966. if (3 == type)
  967. {
  968. pName = 'tPage=';
  969. rString = escape(ts);
  970. return pName+rString;
  971. }
  972. if (4 == type)
  973. {
  974. pName = 'sPage=';
  975. rString = escape(ts);
  976. return pName + rString;
  977. }
  978. if (5 == type)
  979. {
  980. pName = 'r=';
  981. rString = escape(ts);
  982. return pName + rString;
  983. }
  984. if (6 == type)
  985. {
  986. pName = 'MSID=';
  987. rString = escape(ts);
  988. return pName + rString;
  989. }
  990. if (7 == type)
  991. {
  992. pName = 'source=';
  993. rString = ts.toLowerCase();
  994. if(rString.indexOf("microsoft.com") != -1)
  995. {
  996. rString = rString.substring(0,rString.indexOf("microsoft.com"));
  997. if('' == rString)
  998. {
  999. rString = "www";
  1000. }
  1001. else
  1002. {
  1003. rString = rString.substring(0,rString.length -1);
  1004. }
  1005. }
  1006. return pName + rString;
  1007. }
  1008. if (8 == type)
  1009. {
  1010. pName = 'TYPE=';
  1011. rString = escape(ts);
  1012. return pName + rString;
  1013. }
  1014. rString = '';
  1015. if(null != rArray)
  1016. {
  1017. if(0 == type)
  1018. {
  1019. for( j=0; j < rArray.length - 1; j++)
  1020. {
  1021. rString += rArray[j] + '_';
  1022. }
  1023. }
  1024. else
  1025. {
  1026. for( j=0; j < rArray.length ; j++)
  1027. {
  1028. rString += rArray[j] + '_';
  1029. }
  1030. }
  1031. }
  1032. rString = rString.substring(0, rString.length - 1);
  1033. return pName + rString;
  1034. }
  1035. function buildIMG(pArr)
  1036. {
  1037. var TG = '<LAYER visibility="hide"><div style="display:none;"><IMG src="' + location.protocol + '//c.microsoft.com/trans_pixel.asp?';
  1038. for(var i=0; i<pArr.length; i++)
  1039. {
  1040. if(0 == i)
  1041. {
  1042. TG += pArr[i];
  1043. }
  1044. else
  1045. {
  1046. TG += '&' + pArr[i];
  1047. }
  1048. }
  1049. TG +='" height="0" width="0" hspace="0" vspace="0" Border="0"></div></layer>';
  1050. if (!RTL){
  1051. document.writeln(TG);
  1052. return;
  1053. }else if (RTL){
  1054. document.write(TG);
  1055. }
  1056. }
  1057. function setToolbarLocale(toolbarLocale)
  1058. {
  1059. document.writeln("<" + "script language='JavaScript' src='global-" + toolbarLocale + ".js' type='text/javascript'></" + "script>");
  1060. //document.writeln("<" + "script language='JavaScript' src='../loc/global-" + toolbarLocale + ".js' type='text/javascript'></" + "script>");
  1061. return;
  1062. }
  1063. function scrollbaroptions(){
  1064. scrollcount ++;
  1065. if ( scrollcount < 3 )
  1066. {
  1067. scFlag = true;
  1068. }else{
  1069. scrollcount = 0;
  1070. scFlag = false;
  1071. }
  1072. }