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.

1218 lines
52 KiB

  1. <!--
  2. Copyright (c) 2000 Microsoft Corporation
  3. -->
  4. <HTML XMLNS:helpcenter>
  5. <!--
  6. Styles used by this web page and the saved web page. Some of these styles are already defined in
  7. PCHEALTH, but they are included here so the saved web page can inherite these styles.
  8. -->
  9. <STYLE id=idStyles>
  10. .sys-font-body
  11. {
  12. font : messagebox;
  13. }
  14. .sys-color-body
  15. {
  16. color : #000000;
  17. }
  18. .sys-color-body-alert
  19. {
  20. color : #FF0000;
  21. }
  22. .sys-color-body-ok
  23. {
  24. color : #009900;
  25. }
  26. .sys-toppane-header-color
  27. {
  28. color : #FFFFFF;
  29. }
  30. .Text-Caption
  31. {
  32. color : blue;
  33. font-family : Tahoma;
  34. font-size : 8pt;
  35. align-text : left
  36. }
  37. .Text-Comment
  38. {
  39. color : blue;
  40. font-family : Tahoma;
  41. font-size : 8pt;
  42. align-text : left
  43. }
  44. .Text-Data
  45. {
  46. color : black;
  47. font-family : Tahoma;
  48. font-size : 7pt;
  49. align-text : left
  50. }
  51. .Text-Loading
  52. {
  53. color : green;
  54. font-family : Tahoma;
  55. font-size : 8pt;
  56. align-text : center;
  57. font-weight : bold;
  58. }
  59. .Text-OptionDescription
  60. {
  61. color : green;
  62. font-family : Tahoma;
  63. font-size : 8pt;
  64. align-text : center;
  65. font-style : italic;
  66. margin-left : 50 px
  67. }
  68. .AlignCenter
  69. {
  70. text-align:"center"
  71. }
  72. .AlignRight
  73. {
  74. text-align:"right"
  75. }
  76. .AlignLeft
  77. {
  78. text-align:"Left"
  79. }
  80. .Text-ErrorMsg
  81. {
  82. color : green;
  83. font-family : Tahoma;
  84. font-size : 12pt;
  85. }
  86. </STYLE>
  87. <!--
  88. Include PCHEALTH's style sheets, so we can have the same look
  89. -->
  90. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  91. <LINK ID=Stylesheet_Ref1 href="hcp://system/css/Behaviors.css" rel=STYLESHEET type=text/css>
  92. <LINK ID=Stylesheet_Ref2 href="hcp://system/css/Layout.css" rel=STYLESHEET type=text/css>
  93. <LINK ID=Stylesheet_Ref href="hcp://system/css/Shared.css" rel=STYLESHEET type=text/css>
  94. <STYLE>
  95. BODY
  96. {
  97. margin : 16px;
  98. margin-top : 11px;
  99. }
  100. .layout-description
  101. {
  102. margin-top : 3px;
  103. }
  104. .layout-arrow
  105. {
  106. position : relative;
  107. top : 7px;
  108. margin-right : 4px;
  109. width : 20px;
  110. height : 20px;
  111. }
  112. .LearnMore
  113. {
  114. margin-top: 1em
  115. }
  116. </STYLE>
  117. <BODY onbeforeunload="OnClose()" class="sys-rhp-color" >
  118. <TITLE id=idTitelTxt>Network Diagnostics</TITLE>
  119. <script id=shared_vbs language=VBS>
  120. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  121. '' Shared VBS code. Both this page and the saved file uses these functions
  122. '' to navigate through the tree
  123. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  124. ' This flag indicates if the results tree should be displayed in text mode (i.e. + and - signs)
  125. ' or in non text mode (with the + and - images). The text mode is used by the saved file
  126. ' so it can be an independent htm file (does not rely on the +/- images)
  127. g_bTextMode = TRUE
  128. ' +/- images used by the results tree
  129. g_ImagePath = "..\images\expando\"
  130. g_CollapseMouseRest = g_ImagePath & "expanded.gif"
  131. g_ExpandMouseRest = g_ImagePath & "collapsed.gif"
  132. g_EmptyMouseRest = g_ImagePath & "endnode.gif"
  133. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  134. '' Toggle -
  135. '' Description - Expand and collapse a branch in the results tree
  136. '' Arguments - idButton - id of the + / - sign (Text or non text depending on the mode)
  137. '' divSub - id of the branch to expand or collapse
  138. '' Return - void
  139. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  140. function toggle(idButton, divSub)
  141. select case idButton.value
  142. case 0
  143. ' Was expanded, now will be collapsed
  144. divSub.style.display = "none"
  145. idButton.value = 1
  146. idButton.innerHTML = GetTreeButtonImage(idButton.value,0)
  147. case 1
  148. ' Was collapsed, now will be expanded
  149. divSub.style.display = ""
  150. idButton.value = 0
  151. idButton.innerHTML = GetTreeButtonImage(idButton.value,0)
  152. case 2
  153. ' Does not change. It is a leaf, has nothing to expand of collapse
  154. idButton.value = 2
  155. idButton.innerHTML = GetTreeButtonImage(idButton.value,0)
  156. end select
  157. window.event.cancelBubble = true
  158. end function
  159. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  160. '' Toggle -
  161. '' Description - Gets HTML code for the +/- sign.
  162. '' Arguments - bButtonState - State of the button (expanded, collapsed, none)
  163. '' Return - HTML code with the corresponding +/-
  164. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  165. function GetTreeButtonImage(bButtonState, bMouseState)
  166. if g_bTextMode then
  167. ' Get the Text mode +/-
  168. select case bButtonState
  169. case 0
  170. strImg = "<SPAN style='font-family:Courier'> - </SPAN>"
  171. case 1
  172. strImg = "<SPAN style='font-family:Courier'> + </SPAN>"
  173. case else
  174. strImg = "<SPAN style='font-family:Courier'> &nbsp </SPAN>"
  175. end select
  176. GetTreeButtonImage = strImg
  177. else
  178. ' Get the non text mode +/-
  179. select case bButtonState
  180. case 0
  181. strImg = g_CollapseMouseRest
  182. case 1
  183. strImg = g_ExpandMouseRest
  184. case else
  185. strImg = g_EmptyMouseRest
  186. end select
  187. GetTreeButtonImage = "<img src='" & strImg & "'> "
  188. end if
  189. end function
  190. </script>
  191. <!--
  192. Display the Network Diagnostics Title and a description of what this page does
  193. -->
  194. <DIV id=idTitelTxt class="sys-font-heading3 sys-rhp-color-title">
  195. Network Diagnostics
  196. </DIV>
  197. <BR>
  198. <DIV id=idDescription class="sys-font-body sys-color-body">
  199. Network Diagnostics scans your system to gather information about your hardware, software, and network connections.
  200. <DIV class="LearnMore">
  201. <A TABINDEX=0 class="sys-font-body sys-link-normal" href="" onclick="ShowLearnMore('dglogshelp.htm');return false;" onkeypress="ShowLearnMore('dglogshelp.htm');return false;">
  202. <ID id=idLeanAboutText>Tell me about Network Diagnostics</ID>
  203. </A>
  204. </DIV>
  205. </DIV>
  206. <!--
  207. Load the Network Diagnostics ActiveX Object (DGLOGS.DLL). This ActiveX object collects all of the computer
  208. information, performs all the tests and hands the data back to this web page in an XML format
  209. -->
  210. <OBJECT id=Dglogs classid=clsid:76FF3452-E474-4032-BED5-BBE4E96B6D2F></OBJECT>
  211. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  212. <!--
  213. Display the Start scan and set options buttons
  214. -->
  215. <DIV class="layout-description">
  216. <A id=idScan class="sys-link-normal sys-font-body sys-color-body" href="" onclick="OnStart();return false;" onkeypress="OnStart();return false;">
  217. <helpcenter:bitmap class="layout-arrow" SRCNORMAL="hcp://system/images/16x16/arrow_green_normal_shadow.bmp"></helpcenter:bitmap>
  218. <ID id=idScanTxt> Scan your system </ID>
  219. </A>
  220. </DIV>
  221. <DIV class="layout-description">
  222. <A id=idSetOptions class="sys-link-normal sys-font-body sys-color-body" href="" onclick="OnSetOptions();return false;" onkeypress="OnSetOptions();return false;">
  223. <helpcenter:bitmap class="layout-arrow" SRCNORMAL="hcp://system/images/16x16/arrow_blue_normal_shadow.bmp"></helpcenter:bitmap>
  224. <ID id=idSetOptionTxt>Set scanning options</ID>
  225. </A>
  226. </DIV>
  227. <!--
  228. Displays the progress bar. Above the progress bar is the completion percentage. Below the progres bar
  229. is the message informing the user of what the program is currently doing.
  230. -->
  231. <DIV id=idProgress style='display:none AlignCenter'>
  232. <CENTER>
  233. <table width=50% height=60%>
  234. <tr><td class=AlignCenter>
  235. <DIV id=idLoadPercent class='text-loading'></DIV>
  236. <DIV id=idProgressBar></DIV>
  237. <DIV id=idLoadMsg class='text-loading'></DIV>
  238. <P>
  239. <INPUT class='sys-font-body AlignCenter' type="button" value="Cancel" id=idAbort onclick="OnAbort()">
  240. </td></tr>
  241. </table>
  242. </CENTER>
  243. </DIV>
  244. <!--
  245. Displays the options page.
  246. -->
  247. <DIV id=idOptions style='display:none'>
  248. <table width=100%>
  249. <tr><td class=AlignRight>
  250. <SPAN id=idBackButton><INPUT class=sys-font-body type="button" value="Back to Results Page" id=idBack onclick="OnBack()"></SPAN>
  251. </td></tr>
  252. <tr>
  253. <td class=AlignLeft bgcolor=darkblue>
  254. <DIV class="sys-font-body-bold sys-toppane-header-color">
  255. <ID id=idOptionsText> Options </ID>
  256. </DIV>
  257. </td>
  258. </tr>
  259. </table>
  260. <DIV id=idOptionSet class="sys-font-heading4 sys-rhp-color-title"> Actions </DIV>
  261. <SPAN id=idPingDescText title="Ping tries to contact a remote computer on the network. Successfully contacting the computer does not imply that the required network service is running." >
  262. <INPUT id=idPing CHECKED type=checkbox name=Ping>
  263. <SPAN class="sys-font-body sys-color-body">
  264. Ping
  265. </SPAN>
  266. </SPAN><BR>
  267. <SPAN id=idConnectDescTxt title="Connect checks whether a remote computer appears to be supporting a networking service. If the remote computer does appear to be supporting a networking service, it does not guarantee that the network service is operating correctly but does imply that it is running." >
  268. <INPUT id=idConnect CHECKED type=checkbox name=Connect>
  269. <SPAN class="sys-font-body sys-color-body">
  270. Connect
  271. </SPAN>
  272. </SPAN><BR>
  273. <SPAN id=idShowDescText title="Show gathers basic computer information for certain categories.">
  274. <INPUT id=idShow CHECKED type=checkbox name=Show>
  275. <SPAN class="sys-font-body sys-color-body">
  276. Show
  277. </SPAN>
  278. </SPAN><BR>
  279. <SPAN id=idVerboseDescText title="Verbose gathers advanced computer information for certain categories.">
  280. <INPUT id=idVerbose type=checkbox name=Verbose>
  281. <SPAN class="sys-font-body sys-color-body">
  282. Verbose
  283. </SPAN>
  284. </SPAN><BR>
  285. <SPAN id=idSaveDesktopDescText title="Save the file to the desktop.">
  286. <INPUT id=idSaveToDeskTop CHECKED type=checkbox name=SaveToDeskTop >
  287. <SPAN class="sys-font-body sys-color-body">
  288. Save to Desktop
  289. </SPAN>
  290. </SPAN><BR>
  291. <DIV class="sys-font-heading4 sys-rhp-color-title"><ID id=idCategoriesText>Categories</ID></DIV>
  292. <SPAN id=idMailDescTxt title="Displays the inbound and outbound mail server host name, port number, and mail type. The Actions that apply are Ping and Connect.">
  293. <INPUT id=idMail CHECKED type=checkbox name=Mail>
  294. <SPAN class="sys-font-body sys-color-body">
  295. Mail Service
  296. </SPAN>
  297. </SPAN><BR>
  298. <SPAN id=idNewsDescText title="Displays the default Outlook Express news server name and port number. The Actions that apply are Ping and Connect.">
  299. <INPUT id=idNews CHECKED type=checkbox name=News>
  300. <SPAN class="sys-font-body sys-color-body">
  301. News Service
  302. </SPAN>
  303. </SPAN><BR>
  304. <SPAN id=idProxyDescText title="Displays Internet Explorer's server name, port number, and whether the proxy is enabled. The Actions that apply are Ping and Connect.">
  305. <INPUT id=idProxy CHECKED type=checkbox name=IEProxy>
  306. <SPAN class="sys-font-body sys-color-body">
  307. Internet Proxy Server
  308. </SPAN>
  309. </SPAN><BR>
  310. <SPAN id=idComputerDescText title="Displays information about your local computer. The Actions that apply are Show and Verbose.">
  311. <INPUT id=idComputer CHECKED type=checkbox name=Computer>
  312. <SPAN class="sys-font-body sys-color-body">
  313. Computer Information
  314. </SPAN>
  315. </SPAN><BR>
  316. <SPAN id=idOSDescText title="Displays information about your operating system. The Actions that apply are Show and Verbose.">
  317. <INPUT id=idOS CHECKED type=checkbox name=OS>
  318. <SPAN class="sys-font-body sys-color-body">
  319. Operating System
  320. </SPAN>
  321. </SPAN><BR>
  322. <SPAN id=idVersionDescText title="Displays your Windows version information. The Actions that apply are Show and Verbose.">
  323. <INPUT id=idVersion CHECKED type=checkbox name=Version>
  324. <SPAN class="sys-font-body sys-color-body">
  325. Windows Version
  326. </SPAN>
  327. </SPAN><BR>
  328. <SPAN id=idModemsDescText title="Displays all modems. The Actions that apply are Show and Verbose.">
  329. <INPUT id=idModem CHECKED type=checkbox name=Modem>
  330. <SPAN class="sys-font-body sys-color-body">
  331. Modems
  332. </SPAN>
  333. </SPAN><BR>
  334. <SPAN id=idClientsDescText title="Displays all of your network clients. The Actions that apply are Show and Verbose.">
  335. <INPUT id=idClient CHECKED type=checkbox name=Client>
  336. <SPAN class="sys-font-body sys-color-body">
  337. Network Clients
  338. </SPAN>
  339. </SPAN><BR>
  340. <SPAN id=idAdapterDescText title="Displays all active and inactive adapters on your network. The Actions that apply are Ping, Show, and Verbose.">
  341. <INPUT id=idAdapter CHECKED type=checkbox name=Adapter>
  342. <SPAN class="sys-font-body sys-color-body">
  343. Network Adapters
  344. </SPAN>
  345. </SPAN><BR>
  346. <SPAN id=idDomainDescText title="Displays the Domain Name Servers for each network adapter. The Action that applies is Ping.">
  347. <INPUT id=idDns type=checkbox name=DNS>
  348. <SPAN class="sys-font-body sys-color-body">
  349. Domain Name System (DNS)
  350. </SPAN>
  351. </SPAN><BR>
  352. <SPAN id=idDHCPDescText title="Displays the DHCP servers for each network adapter. The Action that applies is Ping.">
  353. <INPUT id=idDhcp type=checkbox name=DHCP>
  354. <SPAN class="sys-font-body sys-color-body">
  355. Dynamic Host Configuration Protocol (DHCP)
  356. </SPAN>
  357. </SPAN><BR>
  358. <SPAN id=idGatewayDescText title="Displays the default gateway server for each network adapter. The Action that applies is Ping.">
  359. <INPUT id=idGateway type=checkbox name=Gateway>
  360. <SPAN class="sys-font-body sys-color-body">
  361. Default Gateways
  362. </SPAN>
  363. </SPAN><BR>
  364. <SPAN id=idIPDescText title="Displays the Internet Protocol Address for each network adapter. The Action that applies is Ping.">
  365. <INPUT id=idIP type=checkbox name=IP>
  366. <SPAN class="sys-font-body sys-color-body">
  367. Internet Protocol Address
  368. </SPAN>
  369. </SPAN><BR>
  370. <SPAN id=idWINSDescText title="Displays the primary and secondary WINS servers for each network adapter. The Action that applies is Ping.">
  371. <INPUT id=idWins type=checkbox name=Wins>
  372. <SPAN class="sys-font-body sys-color-body">
  373. Windows Internet Naming Service (WINS)
  374. </SPAN>
  375. </SPAN><BR>
  376. </DIV>
  377. <DIV id=idResults style="display:none">
  378. <table width=100%>
  379. <TR>
  380. <TD class=AlignRight>
  381. <span id=idShowSavedFile>
  382. <A id=idShowSavedFiles href="" target="_blank" class="sys-link-normal sys-font-body sys-color-body">
  383. <ID id=idShowSavedFileText>Show Saved Files</ID>
  384. </A>
  385. </span>
  386. <INPUT class=sys-font-body type="button" value='Save to file...' id=idSaveToFile onclick='OnSaveToFile()'>
  387. </TD>
  388. </TR>
  389. <tr><td>
  390. <DIV id=idData style="COLOR: black" ></DIV>
  391. <DIV id=idDataTxt style="display:none"></DIV>
  392. </td></tr>
  393. </table>
  394. </DIV>
  395. <!--
  396. Blank ID. Do not delete. Branches that are empty refrence this id. They need an id to refernce.
  397. -->
  398. <DIV id=idBlank></DIV>
  399. <SCRIPT Language=javascript>
  400. /* Make the dialog variable global and initialize it to null so you can test for its existence before calling showModelessDialog. e.g. when it exists it is not null. However, it must be set back to null when the dialog closes (see below). This ensures that only one instance of the Tell me dialog can exist at one time... */
  401. var g_oLearnMoreDlg = null;
  402. var sDlgFeatures = "help:no;status:no;resizable:no;dialogWidth:385px;dialogHeight:440px"
  403. function ShowLearnMore( sTopicURL )
  404. {
  405. if( null == g_oLearnMoreDlg )
  406. {
  407. //pass in a reference to this window so that script in the dialog can communicate with this page...
  408. g_oLearnMoreDlg = window.showModelessDialog( sTopicURL, window, sDlgFeatures );
  409. }
  410. }
  411. </SCRIPT>
  412. <SCRIPT LANGUAGE=VBS>
  413. ' The begining and end of the saved web page
  414. SavedFile_Head = "<BODY><HTML><SCRIPT Language=javascript></"
  415. SavedFile_Head = SavedFile_Head + "SCRIPT><DIV id=idBlank style='display:none'></DIV>"
  416. SavedFile_Tail = "</BODY></HTML>"
  417. ' Text that is displayed by the web page. Done so it can be localized.
  418. L_NetDiagSave_FileName = "Netdiag "
  419. L_NetDiagPath_FolderName = "\pchealth\helpctr\system\netdiag"
  420. L_Canceling_Text = "Canceling, please wait ..."
  421. L_DgnetLoadError_Text = "Unable to load ActiveX Control Dgnet.dll"
  422. L_Fail_Text = "FAILED"
  423. L_Pass_Text = "PASSED"
  424. L_FileSaved_Text = "File Saved:"
  425. L_DgnetOtherInstance_Text = "Another instance of this program is already running."
  426. L_FormatingResults_Text = "Formatting Results"
  427. L_NoFileSaved_Text = "File not saved. Select the save to desktop option, to save the file to the desktop."
  428. L_SaveToDesktop_Text = "To your desktop: "
  429. L_AndTo_Text = "and to "
  430. L_InvalidOptionSelection_Text = "Please ensure that at least one of the following options is checked: Ping, Connect, Show"
  431. L_NoData_Text = "No data to display"
  432. ' Constant values
  433. const FLAG_VERBOSE_LOW = 1
  434. const FLAG_VERBOSE_MEDIUM = 2
  435. const FLAG_VERBOSE_HIGH = 4
  436. const FLAG_CMD_PING = 8
  437. const FLAG_CMD_SHOW = 16
  438. const FLAG_CMD_CONNECT = 32
  439. ' Global variables
  440. g_bRunning = FALSE ' Indicates that the program is collecting data
  441. g_bTextMode = FALSE ' Indicates that the results tree should be displayed with images rather than +/- text
  442. g_FormatingData = FALSE ' Indicates that e program has finished collecting data and is now formating the results tree with the data
  443. g_strLastCategory = ""
  444. g_iIDCount = 0
  445. g_fso = NULL
  446. g_xmlDoc = NULL
  447. g_WshShell = NULL
  448. ' Initialize the web page
  449. call Initialize()
  450. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  451. '' Initialize
  452. '' Description - Initialize the wbe page. Load the settings, Set the PCHEALTH link, create
  453. '' the filesystem and XML objects
  454. '' Arguments - void
  455. '' Return - void
  456. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  457. function Initialize
  458. if pchealth.UserSettings.IsAdmin then
  459. ' Get the PCHEALTH path and the Show Saved files link
  460. Set g_fso = CreateObject("Scripting.FileSystemObject")
  461. fname = g_fso.GetSpecialFolder(WindowsFolder) & L_NetDiagPath_FolderName
  462. idShowSavedFile.style.display = ""
  463. idShowSavedFiles.href = fname
  464. idSaveDesktopDescText.style.display = ""
  465. else
  466. idShowSavedFile.style.display = "none"
  467. idSaveDesktopDescText.style.display = "none"
  468. idSaveToDeskTop.Checked = TRUE
  469. end if
  470. ' Create the wshell object so we can get the desktop dir
  471. set g_WshShell = CreateObject("WScript.Shell")
  472. ' Create the XML parser object
  473. Set g_xmlDoc = CreateObject("microsoft.xmldom")
  474. g_xmlDoc.async = False
  475. ' Display the into page. i.e. nothing
  476. call SetDisplay(0)
  477. end function
  478. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  479. '' OnShowSavedFiles
  480. '' Description - Opens a new window to display the saved files
  481. '' Arguments - void
  482. '' Return - void
  483. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  484. function OnShowSavedFiles
  485. document.links
  486. end function
  487. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  488. '' OnBack
  489. '' Description - Switches from the options page to the result page
  490. '' Arguments - void
  491. '' Return - void
  492. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  493. function OnBack()
  494. if idData.innerHTML <> "" and not g_FormatingData then
  495. ' Only switch to the results view if the data has already been collected
  496. SetDisplay(3)
  497. end if
  498. end function
  499. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  500. '' OnBack
  501. '' Description - Switches to the specified view
  502. '' 0 - Intro page (blank page)
  503. '' 1 - Options page
  504. '' 2 - Progress bar page
  505. '' 3 - Results page
  506. '' Arguments - iType - Page to switch to
  507. '' Return - void
  508. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  509. function SetDisplay(iType)
  510. select case iType
  511. case 0 ' Intro
  512. idOptions.style.display = "none"
  513. idProgress.style.display = "none"
  514. idResults.style.display = "none"
  515. idScan.style.display = ""
  516. idSetOptions.style.display = ""
  517. case 1 'Options Display
  518. idOptions.style.display = ""
  519. idProgress.style.display = "none"
  520. idResults.style.display = "none"
  521. idScan.style.display = ""
  522. idSetOptions.style.display = "none"
  523. case 2 ' Progress display
  524. idOptions.style.display = "none"
  525. idProgress.style.display = ""
  526. idResults.style.display = "none"
  527. idScan.style.display = "none"
  528. idSetOptions.style.display = "none"
  529. case 3 ' Data display
  530. idOptions.style.display = "none"
  531. idProgress.style.display = "none"
  532. idResults.style.display = ""
  533. idScan.style.display = ""
  534. idSetOptions.style.display = ""
  535. end select
  536. end function
  537. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  538. '' OnBack
  539. '' Description - Stops the dglogs query, and goes back to the results page
  540. '' Arguments - void
  541. '' Return - void
  542. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  543. function OnClose()
  544. if g_bRunning = TRUE then
  545. idLoadMsg.innerHTML = L_Canceling_Text
  546. Dglogs.StopQuery
  547. g_bRunning = false
  548. SetDisplay(0)
  549. end if
  550. end function
  551. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  552. '' OnAbort
  553. '' Description - If the web page is collecting data and the Cancel button
  554. '' is pressed, this function stops the query and tries to restore the old
  555. '' results. If the web page was formatting the results and the users press
  556. '' the cancel button, the old results can not be restored.
  557. '' Arguments - void
  558. '' Return - void
  559. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  560. function OnAbort()
  561. call OnClose
  562. if idData.innerHTML <> "" and not g_FormatingData then
  563. ' We are able to restore the old results
  564. SetDisplay(3)
  565. end if
  566. end function
  567. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  568. '' GetSettings
  569. '' Description - Gets the options/settings that are checked
  570. '' Arguments - void
  571. '' Return - strCategory - list of the categories that are checked
  572. '' bFlag - the actions that are checked
  573. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  574. function GetSettings(byref strCategory, byref bFlag)
  575. bFlag = 0
  576. strCategory = ""
  577. set Options = idOptions.all.tags("INPUT")
  578. for each id in Options
  579. if id.checked then
  580. select case id.name
  581. case "Verbose"
  582. bFlag = bFlag OR FLAG_VERBOSE_HIGH
  583. case "Ping"
  584. bFlag = bFlag OR FLAG_CMD_PING
  585. case "Connect"
  586. bFlag = bFlag OR FLAG_CMD_CONNECT
  587. case "Show"
  588. bFlag = bFlag OR FLAG_CMD_SHOW
  589. case else
  590. ' Get the selected categories
  591. strCategory = strCategory + id.name + ";"
  592. end select
  593. end if
  594. next
  595. end function
  596. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  597. '' OnSetOptions
  598. '' Description - Displays the options page. If the user already collected data, the options
  599. '' page displays a button that enables the user to get back to the results page
  600. '' Arguments - void
  601. '' Return - void
  602. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  603. function OnSetOptions
  604. if idData.innerHTML = "" then
  605. ' No data has been collected yet, do not display the back button
  606. idBackButton.style.display = "none"
  607. else
  608. ' The user collected data, display the back button
  609. idBackButton.style.display = ""
  610. end if
  611. ' Display the options page
  612. SetDisplay(1)
  613. end function
  614. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  615. '' CStr2
  616. '' Description - Makes sure that a number is at least two digits i.e. 1 => 01
  617. '' Arguments - num = number to check
  618. '' Return - two digit number
  619. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  620. public function CStr2(num)
  621. s = CStr(num)
  622. if num < 10 then
  623. CStr2 = "0" + s
  624. else
  625. CStr2 = s
  626. end if
  627. end function
  628. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  629. '' SaveFile
  630. '' Description - Creates the saved file.
  631. '' Arguments - Object indicating where to save the file too
  632. '' Return - void
  633. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  634. function CreateFile(FileName)
  635. Dim Fso
  636. Dim File
  637. set fso = createobject("scripting.filesystemobject")
  638. set File = fso.createTextfile(Filename,true,true)
  639. File.WriteLine(SavedFile_Head)
  640. File.WriteLine(shared_vbs.outerHTML)
  641. File.WriteLine(idStyles.outerHTML)
  642. File.WriteLine(idDataTxt.innerHtml)
  643. File.WriteLine(SavedFile_Tail)
  644. File.Close
  645. end function
  646. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  647. '' OnSaveToFile
  648. '' Description - Saves the results to a file. The +/- images are converted into
  649. '' +/- text signs so the saved file does not depend on these images.
  650. '' its a pain to find them
  651. '' Arguments - void
  652. '' Return - void
  653. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  654. function OnSaveToFile
  655. On Error Resume Next
  656. Dim MyFile
  657. Dim currentDate
  658. Dim MyFile2
  659. bFileSaved = false
  660. ' Convert the results into a texted based tree by changing the +/- images to text +/-
  661. ' The text tree is stored in idDataTxt so we do not alter the original results
  662. MakeTextTree()
  663. ' Create the filename (based on the date)
  664. currentDate = now()
  665. sDate = CStr2(day(currentDate)) + CStr2(month(currentDate)) + CStr2(year(currentDate)) + " " + CStr2(hour(currentDate)) + CStr2(minute(currentDate)) + CStr2(second(currentDate))
  666. fname = L_NetDiagSave_FileName + sDate + ".htm"
  667. ' strSavedTo tells the user where we saved the file
  668. strSavedTo = L_FileSaved_Text
  669. if idSaveToDeskTop.checked OR not pchealth.UserSettings.IsAdmin then
  670. ' Save the file to the desktop. (the user selected this option)
  671. strDesktop = g_WshShell.SpecialFolders("Desktop")
  672. CreateFile(strDesktop & "\" & fname)
  673. strSavedTo = strSavedTo & vbNewLine & L_SaveToDesktop_Text & fname
  674. bFileSaved = true
  675. end if
  676. if pchealth.UserSettings.IsAdmin then
  677. 'Save the file in the PC health dir
  678. strWindowDir = g_fso.GetSpecialFolder(WindowsFolder)
  679. fname = strWindowDir & L_NetDiagPath_FolderName & "\" & fname
  680. CreateFile(fname)
  681. if bFileSaved then
  682. strSavedTo = strSavedTo & vbNewLine & L_AndTo_Text & fname
  683. else
  684. strSavedTo = strSavedTo & vbNewLine & fname
  685. end if
  686. bFileSaved = true
  687. end if
  688. if bFileSaved = false then
  689. strSavedTo = L_NoFileSaved_Text
  690. end if
  691. ' Clear the temp saved results so the ids do not conflict with each other
  692. idDataTxt.innerHTML = ""
  693. 'Let the user know that there information has been saved
  694. MsgBox strSavedTo
  695. end function
  696. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  697. '' OnStart
  698. '' Description - Querys dgnet.dll (dglogs) for the specified data (the categories the user
  699. '' selected)
  700. '' Arguments - void
  701. '' Return - void
  702. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  703. function OnStart
  704. if idShow.Checked = false and idPing.Checked = false and idConnect.Checked = false then
  705. MsgBox L_InvalidOptionSelection_Text
  706. OnSetOptions
  707. exit function
  708. end if
  709. if Dglogs is nothing then
  710. ' The dglogs object failed to be created
  711. Msgbox L_DgnetLoadError_Text
  712. else
  713. g_bRunning = TRUE
  714. ' Initialize the progress bar and set to the progress bar view
  715. call DrawProgressBar(idProgressBar,0,"")
  716. SetDisplay(2)
  717. ' Get the settings/options
  718. call GetSettings(strCategory,bFlag)
  719. ' Last category indicates which category was last displayed. Categories begin Internet Service, Network Adapters and
  720. ' Modems etc. g_iIDCount is the IDs
  721. g_strLastCategory = ""
  722. g_iIDCount = 0
  723. strRetVal = Dglogs.ExecQuery(strCategory, bFlag)
  724. if strRetVal = L_Fail_Text then
  725. Msgbox L_DgnetOtherInstance_Text
  726. g_bRunning = FALSE
  727. SetDisplay(3)
  728. end if
  729. end if
  730. end function
  731. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  732. '' Dglogs_ProgressReport
  733. '' Description - Increments the progress bar and displays the messages dgnet.dll is
  734. '' reporting.
  735. '' Arguments - strMsg - The message reported by dgnet.dll
  736. '' n - the percentage completed.
  737. '' Return - void
  738. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  739. function Dglogs_ProgressReport(strMsg,n)
  740. if n = -1 then
  741. ' Dgnet.dll is done. strMsg is the XML text containing the results
  742. ' g_FormatingData means that we are converting the data from XML to HTML
  743. ' we can not go back to the old results (i.e. cancel)
  744. g_FormatingData = TRUE
  745. ' Convert the XML text to HTML text
  746. call ConvertXMLToHtml(strMsg)
  747. ' Done formating data, display it
  748. g_FormatingData = FALSE
  749. SetDisplay(3)
  750. else
  751. ' Display the progress
  752. if n = 100 then
  753. ' The last % is for formatting the data
  754. call DrawProgressBar(idProgressBar,99,L_FormatingResults_Text)
  755. else
  756. ' display the status report
  757. call DrawProgressBar(idProgressBar,n,strMsg)
  758. end if
  759. end if
  760. end function
  761. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  762. '' DrawProgressBar
  763. '' Description - Increments the progress bar and displays the messages dgnet.dll is
  764. '' reporting. The progress bar is a table with 2 columns.
  765. '' Arguments - strMsg - The message reported by dgnet.dll
  766. '' n - the percentage completed.
  767. '' Return - void
  768. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  769. function DrawProgressBar(idTag, bCount, strMsg)
  770. if bCount <> -1 then
  771. idLoadPercent.innerHTML = bCount & "%"
  772. idLoadMsg.innerHTML = strMsg
  773. idTag.innerHtml = "<TABLE width=100% height='25' border=0>" & _
  774. "<TD width='" & bCount & "%' bgcolor=blue align=center></TD>" & _
  775. "<TD width='" & (100 - bCount) & "%'></TD>" & _
  776. "</TABLE>"
  777. end if
  778. window.status = strMsg
  779. end function
  780. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  781. '' GetTreeButton
  782. '' Description - Get the +/- sign for the tree
  783. '' Arguments - strID - Button ID
  784. '' bType - Button state (expanded, collapsed, empty)
  785. '' Return - HTML code for the button
  786. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  787. function GetTreeButton(strID, bType)
  788. GetTreeButton = "<SPAN value=" & bType & " id=tag" & strID & ">" & GetTreeButtonImage(bType,0) & "</SPAN>"
  789. end function
  790. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  791. '' MakeTextTree
  792. '' Description - Convert the +/- images into +/- text. The idDataTxt stores the text tree
  793. '' Arguments - void
  794. '' Return - void
  795. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  796. function MakeTextTree()
  797. g_bTextMode = TRUE
  798. ' Copy the tree
  799. idDataTxt.innerhtml = idData.innerhtml
  800. ' Get all the branches
  801. set Branches=idDataTxt.all.tags("SPAN")
  802. for each idBranch in Branches
  803. if "tag" = Left(idBranch.id,len("tag")) then
  804. ' Found a brach, convert it into a text +/-
  805. idBranch.innerHTML = GetTreeButtonImage(idBranch.value,0)
  806. end if
  807. next
  808. g_bTextMode = FALSE
  809. end function
  810. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  811. '' GetNextID
  812. '' Description - Each branch needs a unique ID. This creates the id
  813. '' Arguments - void
  814. '' Return - unique ID
  815. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  816. function GetNextID()
  817. GetNextID = g_iIDCount
  818. g_iIDCount = g_iIDCount + 1
  819. end function
  820. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  821. '' ConvertXMLToHtml
  822. '' Description - Convert the XML text to HTML text
  823. '' Arguments - str - XML text
  824. '' Return - HTML Text
  825. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  826. function ConvertXMLToHtml(str)
  827. g_xmlDoc.loadXML(str)
  828. 'strText = "<table width=100% border=0 valign='top'>"
  829. strText = ""
  830. ' Extract the containers form the XML string
  831. Set ContainerList = g_xmlDoc.selectNodes("/Netdiag/Container")
  832. for each Container in ContainerList
  833. strText = strText + FormatContainer(Container)
  834. next
  835. if strText = "" then
  836. strText = "<table width=100%><tr><TD class='Text-ErrorMsg AlignCenter'><p>" & L_NoData_Text & "</P></td></tr></table>"
  837. idSaveToFile.disabled = TRUE
  838. else
  839. strText = "<table width=100% border=0 valign='top'>" & strText & "</table>"
  840. idSaveToFile.disabled = FALSE
  841. end if
  842. idData.innerHTML = strText
  843. end function
  844. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  845. '' GetStatusClass
  846. '' Description - Gets the style of the status
  847. '' Arguments - strStatus - Status Text
  848. '' Return - Status Style
  849. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  850. function GetStatusClass(strStatus)
  851. select case strStatus
  852. case L_Pass_Text
  853. GetStatusClass = "sys-color-body-ok sys-font-body"
  854. case L_Fail_Text
  855. GetStatusClass = "sys-color-body-alert sys-font-body"
  856. case else
  857. GetStatusClass = "sys-color-body sys-font-body"
  858. end select
  859. end function
  860. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  861. '' CreateBranch
  862. '' Description - Creates a branch in the tree. With +/-
  863. '' Arguments - bBranchIsEmpty - Indicates if the branch contains any data
  864. '' strStyle - Text Format
  865. '' strText - Branch text
  866. '' strLeaf - Contents of branch
  867. '' Return - Branch
  868. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  869. function CreateBranch(bBranchIsEmpty, strStyle, strText, byref strLeaf)
  870. iID = GetNextID()
  871. strDivButtonId = "TreeButton" & iID
  872. if bBranchIsEmpty then
  873. ' Branch is empty, empty bitmap blank ID
  874. iImageType = 2
  875. strDivBranchId = "idBlank"
  876. else
  877. ' Branch is not empty, + image and create a new ID
  878. iImageType = 1
  879. strDivBranchId = "TreeBranch" & iID
  880. end if
  881. ' Create the branch
  882. CreateBranch = "<DIV " & strStyle & ">" & _
  883. "<SPAN " & _
  884. "onclick='toggle(tag" & strDivButtonId & "," & strDivBranchId & ");' " & _
  885. "onkeypress='toggle(tag" & strDivButtonId & "," & strDivBranchId & ");'>" & _
  886. GetTreeButton(strDivButtonId,iImageType) & _
  887. strText & "</SPAN>"
  888. ' Create the leaf
  889. strLeaf = "<DIV id=" & strDivBranchId & " style='MARGIN-LEFT: 50px; display:none'>"
  890. end function
  891. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  892. '' FormatContainer
  893. '' Description - Extract the container information and format it.
  894. '' Arguments - Container - Contains the name (i.e. IE Proxy, OE Mail, OE News etc)
  895. '' Caption summary property of the caption (i.e. IE Proxy server name)
  896. '' Category the group it belongs to (i.e. Internet Settings, Adapter and Network etc)
  897. '' Status of the tests
  898. '' Return - HTML formated container
  899. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  900. function FormatContainer(Container)
  901. ' Extarct the values from the container
  902. strHeader = Container.attributes.getNamedItem("Name").nodeValue
  903. strCaption = Container.attributes.getNamedItem("Caption").nodeValue
  904. strCategory = Container.attributes.getNamedItem("Category").nodeValue
  905. Set Stat = Container.selectSingleNode("Status")
  906. strStatus = Stat.attributes.getNamedItem("Value").nodeValue
  907. Set ClassObjectEnumList = Container.selectNodes("ClassObjectEnum")
  908. if strCategory <> g_strLastCategory then
  909. ' We found a new category, create a new heading
  910. FormatContainer = "<tr>" & _
  911. "<td align=left bgcolor=darkblue colspan=3>" & _
  912. "<DIV class='sys-font-body-bold sys-toppane-header-color'>" & strCategory & "</DIV>" &_
  913. "</td></tr>"
  914. ' Memorize the last category we created
  915. g_strLastCategory = strCategory
  916. end if
  917. if ClassObjectEnumList.length > 0 then
  918. ' Container is empty
  919. iImageType = FALSE
  920. else
  921. ' Container is not empty
  922. iImageType = TRUE
  923. end if
  924. ' Create the Container HTML text
  925. strHeader = "<SPAN TABINDEX=0>" & strHeader & "</SPAN>"
  926. FormatContainer = FormatContainer & _
  927. "<tr>" & _
  928. "<td width=30%>" & CreateBranch(iImageType,"class='sys-font-body sys-color-body'",strHeader,strLeaf) & _
  929. "</td>" & _
  930. "<td width=50%><DIV class='Text-Caption'>" & strCaption & "</DIV></td>" & _
  931. "<td width=20%><DIV class='" & GetStatusClass(strStatus) & "'>" & strStatus & "</DIV></td>" & _
  932. "</tr>"
  933. if ClassObjectEnumList.length > 0 then
  934. ' Extract the container properties
  935. FormatContainer = FormatContainer & _
  936. "<tr><td colspan=3 width=100%>" & strLeaf
  937. Set ClassObjectEnumList = Container.selectNodes("ClassObjectEnum")
  938. for each ClassObjectEnum in ClassObjectEnumList
  939. FormatContainer = FormatContainer + FormatClassObjectEnum(ClassObjectEnum)
  940. next
  941. FormatContainer = FormatContainer + "</DIV>"
  942. end if
  943. end function
  944. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  945. '' FormatStatusText
  946. '' Description - Format the status. If the status is not empty put () around it
  947. '' Arguments - strStatus - Status
  948. '' Return - HTML formated status
  949. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  950. function FormatStatusText(strStatus)
  951. if strStatus <> "" then
  952. strStatusTxt = "(" & strStatus & ")"
  953. else
  954. strStatusTxt = strStatus
  955. end if
  956. FormatStatusText = "<SPAN class='" & GetStatusClass(strStatus) & "'> " & strStatusTxt & "</SPAN>"
  957. end function
  958. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  959. '' FormatClassObjectEnum
  960. '' Description - Extract the instances from the container
  961. '' Not all containers have instances.
  962. '' Arguments - ClassObjectEnum - Contains name of the instance and status
  963. '' Return - HTML formated instance
  964. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  965. function FormatClassObjectEnum(ClassObjectEnum)
  966. ' Extarct the instance name and status
  967. strCaption = ClassObjectEnum.attributes.getNamedItem("Name").nodeValue
  968. Set Stat = ClassObjectEnum.selectSingleNode("Status")
  969. StrStatus = Stat.attributes.getNamedItem("Value").nodeValue
  970. if strCaption <> "" then
  971. ' Create an instance branch
  972. strCaption = "<SPAN class='sys-font-body sys-color-body'>" & strCaption & "</SPAN>"
  973. strText = "<SPAN TABINDEX=0>" & strCaption & FormatStatusText(strStatus) & "</SPAN>"
  974. FormatClassObjectEnum = CreateBranch(FALSE,"",strText,strLeaf)
  975. FormatClassObjectEnum = FormatClassObjectEnum & strLeaf
  976. end if
  977. ' Extact the properties from the instance
  978. Set PropertyList = ClassObjectEnum.selectNodes("Property")
  979. for each Prop in PropertyList
  980. FormatClassObjectEnum = FormatClassObjectEnum & FormatProperty(Prop)
  981. next
  982. if strCaption <> "" then
  983. ' Close the instance branch if it was opened.
  984. FormatClassObjectEnum = FormatClassObjectEnum & "</DIV></DIV>"
  985. end if
  986. end function
  987. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  988. '' FormatProperty
  989. '' Description - Fromat the property
  990. '' Arguments - Prop - Property
  991. '' Return - HTML formated property
  992. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  993. function FormatProperty(Prop)
  994. ' Extract the values
  995. strFieldName = Prop.attributes.getNamedItem("Name").nodeValue
  996. Set PropStatus = Prop.selectSingleNode("Status")
  997. strStatus = PropStatus.attributes.getNamedItem("Value").nodeValue
  998. Set ValueList = Prop.selectNodes("PropertyValue")
  999. if ValueList.length > 1 then
  1000. ' Property has an arrary of values
  1001. strFieldName = "<SPAN TABINDEX=0 class='sys-font-body sys-color-body'>" & strFieldName & "</SPAN>"
  1002. strText = strFieldName & FormatStatusText(strStatus)
  1003. FormatProperty = CreateBranch(FALSE,"",strText,strLeaf)
  1004. FormatProperty = FormatProperty & strLeaf
  1005. ' Extract the values
  1006. for each Value in ValueList
  1007. call GetPropertyValue(Value,strValue,strData,strComment,strStatus)
  1008. FormatProperty = FormatProperty & FormatProp("",strValue,strComment,strStatus,strData)
  1009. next
  1010. FormatProperty = FormatProperty & "</DIV></DIV>"
  1011. elseif ValueList.length <> 0 then
  1012. ' Property only has one value, extract it
  1013. Set Value = ValueList.Item(0)
  1014. call GetPropertyValue(Value,strValue,strData,strComment,strStatus)
  1015. FormatProperty = FormatProperty & FormatProp(strFieldName,strValue,strComment,strStatus,strData)
  1016. end if
  1017. end function
  1018. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1019. '' FormatProp
  1020. '' Description - Format the value
  1021. '' Arguments - strFieldName - Name of the property
  1022. '' strValue - Value of the property
  1023. '' strComment - value comment
  1024. '' strStatus - Status
  1025. '' strData - Data associated with value
  1026. '' Return - HTML formated property and value
  1027. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1028. function FormatProp(strFieldName, strValue, strComment, strStatus, strData)
  1029. ' Format field name
  1030. if strFieldName<>"" then
  1031. if strValue <> "" then
  1032. ' If there is a value add =
  1033. strFieldName = strFieldName & " = "
  1034. end if
  1035. strFieldName = "<SPAN class='sys-font-body sys-color-body'>" & strFieldName & " </SPAN>"
  1036. end if
  1037. ' Format the value, comment, status and data
  1038. strValue = "<SPAN class='sys-font-body sys-color-body'>" & strValue & "</SPAN>"
  1039. if strComment <>""then
  1040. strComment = "<SPAN class='Text-Comment'>(" & strComment & ")</SPAN>"
  1041. end if
  1042. if strData<>"" then
  1043. strData = "<SPAN class='Text-Data'>" & strData & "</SPAN>"
  1044. end if
  1045. strText = "<SPAN TABINDEX=0>" & strFieldName & strValue & strComment & FormatStatusText(strStatus) & "</SPAN>"
  1046. if strData<>"" then
  1047. ' No data
  1048. iImageType = FALSE
  1049. else
  1050. ' Has data
  1051. iImageType = TRUE
  1052. end if
  1053. FormatProp = CreateBranch(iImageType,"",strText,strLeaf)
  1054. if strData<>"" then
  1055. ' Close the data
  1056. FormatProp = FormatProp & strLeaf & strData & "</DIV>"
  1057. end if
  1058. FormatProp = FormatProp & "</DIV>"
  1059. end function
  1060. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1061. '' FormatProp
  1062. '' Description - Extract the property values
  1063. '' Arguments - strFieldName - Name of the property
  1064. '' strValue - Value of the property
  1065. '' strComment - value comment
  1066. '' strStatus - Status
  1067. '' strData - Data associated with value
  1068. '' Return - HTML formated property and value
  1069. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1070. function GetPropertyValue(Value, byref strValue, byref strData, byref strComment, byref strStatus)
  1071. strValue = Value.attributes.getNamedItem("Value").nodeValue
  1072. strData = Value.attributes.getNamedItem("Data").nodeValue
  1073. strComment = Value.attributes.getNamedItem("Comment").nodeValue
  1074. strStatus = Value.text
  1075. strData = Replace(strData,"|","<BR>")
  1076. end function
  1077. </SCRIPT>
  1078. </BODY>
  1079. </HTML>