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.

399 lines
9.9 KiB

  1. var shadows = new Array();
  2. var menu;
  3. var timerId = 0;
  4. var timerDelId = 0;
  5. //used for the change_display(head) function
  6. var sImgExpandedArrow = "";
  7. var sImgDefaultArrow = "";
  8. function deletePopup() {
  9. if (menu) {
  10. menu.style.display = 'none';
  11. var selects = document.all.tags("SELECT");
  12. if (selects!=null) {
  13. for (var i=0; i<selects.length; i++) {
  14. selects[i].style.visibility = 'visible';
  15. }
  16. }
  17. }
  18. }
  19. function doMenuz(el, popup) {
  20. timerId = 0;
  21. if (menu) {
  22. deletePopup();
  23. }
  24. var selects = document.all.tags("SELECT");
  25. if (selects!=null) {
  26. for (var i=0; i<selects.length; i++)
  27. {
  28. selects[i].style.visibility = 'hidden';
  29. }
  30. }
  31. menu = popup;
  32. menu.style.posTop = absTop(el);
  33. menu.style.posLeft = 177;
  34. menu.style.display = '';
  35. menu.style.zIndex = 4;
  36. menu.onchange = adjustTop(el, popup)
  37. }
  38. function adjustTop(){
  39. if ((menu.style.posTop+menu.clientHeight) >= document.body.clientHeight) //below bottom
  40. {
  41. menu.style.posTop = (menu.style.posTop-(menu.clientHeight)+18);
  42. }
  43. menu.onchange = adjustBottom()
  44. }
  45. function adjustBottom() {
  46. if (menu.style.posTop < document.body.scrollTop) //above top
  47. {
  48. menu.style.posTop = document.body.scrollTop;
  49. }
  50. }
  51. function removePopup() {
  52. cancelPopup();
  53. deletePopup();
  54. }
  55. function absTop(el) { //finds the top
  56. var n = el.offsetTop;
  57. while (el.parentElement) {
  58. el = el.parentElement;
  59. n += el.offsetTop;
  60. }
  61. return n;
  62. }
  63. function popup(el) {
  64. cancelPopup();
  65. timerId = window.setTimeout('doMenuz(' + el.id + ', ' + el.submenu + ')', 200);
  66. }
  67. function cancelPopup() {
  68. if (timerId != 0) {
  69. window.clearTimeout(timerId);
  70. timerId = 0;
  71. }
  72. }
  73. function delayRemove() {
  74. timerDelId = window.setTimeout('deletePopup()', 200);
  75. }
  76. function cancelDelay() {
  77. if (timerDelId != 0) {
  78. window.clearTimeout(timerDelId);
  79. timerDelId = 0;
  80. }
  81. }
  82. function rollon(a) {
  83. a.style.backgroundColor='#CCCCCC';
  84. a.style.border = '#999999 solid 1px';
  85. }
  86. function rolloff(a) {
  87. if (a.className == 'menuBarSel') {
  88. a.style.backgroundColor='#FFFFFF'
  89. }
  90. else {
  91. a.style.backgroundColor='#f1f1f1';
  92. a.style.border = '#f1f1f1 solid 1px';
  93. }
  94. }
  95. // added by atilab, works with the 'In This Article' component
  96. function change_display(head) {
  97. var oSrcEle = window.event.srcElement
  98. sImg666 = oSrcEle.src
  99. if (sImgExpandedArrow == ""){
  100. sImgExpandedArrow = "/products/shared/images/arrow_expand.gif";
  101. }
  102. if (sImgDefaultArrow == ""){
  103. sImgDefaultArrow = "/products/shared/images/arrow_default.gif";
  104. }
  105. if (document.all.item(head).style.display == "")
  106. {
  107. document.all.item(head).style.display = "none";
  108. oSrcEle.src = sImgExpandedArrow;
  109. oSrcEle.alt = "expand menu";
  110. }
  111. else
  112. {
  113. document.all.item(head).style.display= "";
  114. oSrcEle.src = sImgDefaultArrow;
  115. oSrcEle.alt = "collapse menu";
  116. }
  117. }
  118. function chngColour(sID)
  119. {
  120. var oMainBorder = document.all.item("main" + sID);
  121. var oHeaderBorder = document.all.item("header" + sID);
  122. var oArticle = document.all.item("article" + sID);
  123. var oArrowCol = document.all.item("arrowCol" + sID);
  124. if (oMainBorder.className == 'componentBorder')
  125. {
  126. oMainBorder.className = 'componentBorderSel';
  127. oHeaderBorder.className = 'componentBorderSel';
  128. oArticle.className = 'componentHeaderSel';
  129. oArrowCol.className = 'componentHeaderSel';
  130. }
  131. else
  132. {
  133. oMainBorder.className = 'componentBorder';
  134. oHeaderBorder.className = 'componentBorder';
  135. oArticle.className = 'componentHeader';
  136. oArrowCol.className = 'componentHeader';
  137. }
  138. }
  139. function noPrint()
  140. {
  141. var noprint = document.all.item("donotprint");
  142. if (noprint != null)
  143. if (backicon.style.display != "")
  144. {
  145. if (noprint.length != null)
  146. {
  147. for (var i=0; i<noprint.length; i++)
  148. {
  149. noprint(i).style.display = "none";
  150. }
  151. toggleImgDisplay("/flyout_arrow.gif");//hides flyout arrows
  152. printicon.style.display = "none";
  153. backicon.style.display = "";
  154. document.body.scrollTop = 0;
  155. }
  156. }
  157. else
  158. {
  159. if (noprint.length != null)
  160. {
  161. for (var i=0; i<noprint.length; i++)
  162. {
  163. noprint(i).style.display = "";
  164. }
  165. toggleImgDisplay("/flyout_arrow.gif");//displays flyout arrows
  166. printicon.style.display = "";
  167. backicon.style.display = "none";
  168. document.body.scrollTop = 0;
  169. }
  170. }
  171. }
  172. function toggleImgDisplay(sImgName)
  173. {
  174. var oImages = document.images;
  175. if (oImages != null)
  176. {
  177. var iImgLength = oImages.length;
  178. for (var i=0; i<iImgLength; i++)
  179. {
  180. if (oImages[i].src.indexOf(sImgName)!=-1)
  181. {
  182. if (oImages[i].style.display=="none")
  183. {
  184. oImages[i].style.display="";
  185. }
  186. else
  187. {
  188. oImages[i].style.display="none";
  189. }
  190. }
  191. }
  192. }
  193. }
  194. function togglefaq()
  195. {
  196. if (toggle.checked == true){
  197. expandfaq();
  198. }
  199. else{
  200. contractfaq();
  201. }
  202. }
  203. function expandfaq()
  204. {
  205. var faqitem = document.all.item("faqitem");
  206. if (faqitem != null){
  207. if (faqitem.length != null){
  208. for (i=0; i<faqitem.length; i++){
  209. faqitem(i).style.display = "inline";
  210. }
  211. }
  212. }
  213. }
  214. function contractfaq()
  215. {
  216. var faqitem = document.all.item("faqitem");
  217. var faq = document.all.item("faq");
  218. if (faq != null){
  219. for (i=0; i<faq.length; i++){
  220. faq(i).style.color = "#666666";
  221. }
  222. }
  223. if (faqitem != null){
  224. if (faqitem.length != null){
  225. for (i=0; i<faqitem.length; i++){
  226. faqitem(i).style.display = "none";
  227. }
  228. }
  229. }
  230. }
  231. function getPar(o)
  232. {
  233. var ele = new Object();
  234. ele = findDIV(o)
  235. if (ele!=null)
  236. {
  237. var oA = ele.children.item(1);
  238. if (oA.style.display == "inline")
  239. {
  240. oA.style.display = "none";
  241. o.style.color = "#666666";
  242. }
  243. else
  244. {
  245. oA.style.display = "inline";
  246. }
  247. }
  248. }
  249. function findDIV(x)
  250. {
  251. var oDiv = document.all.tags("DIV");
  252. var iDiv;
  253. if (oDiv != null)
  254. {
  255. iDiv = oDiv.length;
  256. for (var i=0; i<iDiv; i++)
  257. {
  258. if(oDiv[i].contains(x))
  259. {
  260. return oDiv[i];
  261. }
  262. }
  263. }
  264. }
  265. function overState(obj)
  266. {
  267. obj.currentColor = obj.style.color;
  268. obj.style.color = "#0033FF";
  269. obj.style.cursor = "hand";
  270. }
  271. function outState(obj)
  272. {
  273. if ("#0033ff" == obj.style.color)
  274. {
  275. obj.style.color = obj.currentColor;
  276. }
  277. }
  278. function fnSaveInput(oElement, oBehaviourVar)
  279. {
  280. var tExpireTime = new Date();
  281. tExpireTime.setUTCFullYear(2059,12,31);
  282. document.all.d1.expires = tExpireTime.toUTCString();
  283. document.all.d1.setAttribute(oBehaviourVar,oElement.value);
  284. try
  285. {
  286. document.all.d1.save("oXMLBranch");
  287. }
  288. catch(e)
  289. {
  290. return e;
  291. }
  292. }
  293. function fnLoadInput(oElement, oBehaviourVar)
  294. {
  295. try
  296. {
  297. document.all.d1.load("oXMLBranch")
  298. }
  299. catch(e)
  300. {
  301. return e;
  302. }
  303. try
  304. {
  305. var s = document.all.d1.getAttribute(oBehaviourVar);
  306. var i = 0;
  307. if (s)
  308. {
  309. for (children in oElement)
  310. {
  311. if (oElement.options(i).value == s)
  312. {
  313. oElement.options(i).selected = true;
  314. return;
  315. }
  316. i++;
  317. }
  318. }
  319. }
  320. catch(e)
  321. {
  322. return e;
  323. }
  324. }
  325. function popItUp(page)
  326. {
  327. if (page != "")
  328. {
  329. popUpWin = window.open(page,"PopUp","toolbar=no,location=0,directories=0,status=no,menubar=no,scrollbars,resizable=no,width=660,height=390");
  330. popUpWin.focus();
  331. return false;
  332. }
  333. }
  334. function preloadImages()
  335. {
  336. if (document.images) {
  337. var imgFiles = preloadImages.arguments;
  338. var preloadArray = new Array();
  339. for (var i=0; i<imgFiles.length; i++) {
  340. preloadArray[i] = new Image;
  341. preloadArray[i].src = imgFiles[i];
  342. }
  343. }
  344. }
  345. function swapImage()
  346. {
  347. var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.swapImgData;
  348. for (i=0; i < (swapImage.arguments.length-2); i+=3) {
  349. objStr = swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
  350. if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
  351. (objStr.indexOf('document.all[') ==0 && document.all ==null))
  352. objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
  353. obj = eval(objStr);
  354. if (obj != null) {
  355. swapArray[j++] = obj;
  356. swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
  357. obj.src = swapImage.arguments[i+2];
  358. }
  359. }
  360. document.swapImgData = swapArray;
  361. }
  362. function swapImgRestore()
  363. {
  364. if (document.swapImgData != null)
  365. for (var i=0; i<(document.swapImgData.length-1); i+=2)
  366. document.swapImgData[i].src = document.swapImgData[i+1];
  367. }