Source code of Windows XP (NT5)
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.

1972 lines
56 KiB

  1. <html id=ieSearch>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <meta name="GENERATOR" content="HippieTim">
  5. <meta name="GENERATOR" content="PMShawn">
  6. <title>Internet Explorer Search</title>
  7. </head>
  8. <style>
  9. .AdSpace
  10. {
  11. }
  12. .dlgBtn
  13. {
  14. cursor: default;
  15. border-width: 1px;
  16. border-style: solid;
  17. color: ButtonText;
  18. }
  19. .searchTable
  20. {
  21. padding-top: 5px;
  22. }
  23. .rightButton
  24. {
  25. text-align: right;
  26. }
  27. .userData {behavior:url(#_IE_)}
  28. .indentRadio
  29. {
  30. margin-top:3px;
  31. line-height:16pt;
  32. margin-left:4px;
  33. margin-bottom:3px;
  34. }
  35. .searchPanel
  36. {
  37. width: 100%;
  38. position: relative;
  39. top: 0px;
  40. left: 0px;
  41. border: 1px solid buttonshadow;
  42. margin: 0px;
  43. padding: 9px;
  44. }
  45. select
  46. {
  47. width:100%;
  48. }
  49. .inputs
  50. {
  51. width:100%;
  52. }
  53. body,p,td
  54. {
  55. font-size: 8pt;
  56. }
  57. .selectedTitle
  58. {
  59. font-weight: bold;
  60. }
  61. </style>
  62. <script defer>
  63. // Globals
  64. var g_srchPanel;
  65. var g_displayPanel;
  66. var g_prevSearchStore = "IESA_PreviousSearchesI";
  67. var g_catConfig = "IESA_CatConfigI";
  68. var g_pnlConfig = "IESA_PnlConfigI";
  69. var g_bEnableShellSearch;
  70. var g_catObjMap;
  71. var g_SRCID_SWebSearch = "{94FD6891-92CD-11d1-A1C6-00C04FD75D13}";
  72. var g_SRCID_SFileSearch = "{3AEBD6B1-975B-11d1-A1C9-00C04FD75D13}";
  73. var g_SRCID_SFindComputer = "{996E1EB1-B524-11d1-9120-00A0C98BA67D}";
  74. var g_SRCID_SFindPrinter = "{D515F311-B78B-11d1-9123-00A0C98BA67D}";
  75. var ENG_IN_PANE = 0x00000001;
  76. var PNL_SHELL = 0x00000001;
  77. var PNL_DISABLED = 0x00000002;
  78. var PNL_POSITIONED = 0x00000004;
  79. var shOC;
  80. function MyReplace(s, tok, val)
  81. {
  82. var n = s.indexOf(tok);
  83. if (n > -1)
  84. {
  85. var toklen = tok.length;
  86. do
  87. {
  88. s = s.substring(0, n) + val + s.substring(n + toklen, 2048);
  89. n = s.indexOf(tok);
  90. }
  91. while (n > -1);
  92. }
  93. return s;
  94. }
  95. function CEngineBucket(panelID)
  96. {
  97. this.m_panelID = panelID; // Lets us know about our container
  98. this.m_blocks = new Array(); // Array of search engine blocks
  99. }
  100. function CEngineBucket_UnPersistOrder()
  101. {
  102. xmlObj.load(g_pnlConfig + this.m_panelID)
  103. var doc = xmlObj.XMLDocument;
  104. var docNode = doc.documentElement;
  105. var n = docNode.childNodes.length;
  106. var blockName;
  107. for (blockName in this.m_blocks)
  108. {
  109. var block = eval("this.m_blocks['" + blockName + "']");
  110. block.UnPersistBlock(n, docNode);
  111. }
  112. }
  113. function CEngineBucket_NewEngineBlock(blockName)
  114. {
  115. this.m_blocks[blockName] = new CEngineBlock(blockName);
  116. return this.m_blocks[blockName];
  117. }
  118. function CEngineBucket_GetEngineBlock(blockName)
  119. {
  120. return this.m_blocks[blockName];
  121. }
  122. function CEngineBucket_Prototype()
  123. {
  124. CEngineBucket.prototype.UnPersistOrder = CEngineBucket_UnPersistOrder;
  125. CEngineBucket.prototype.NewEngineBlock = CEngineBucket_NewEngineBlock;
  126. CEngineBucket.prototype.GetEngineBlock = CEngineBucket_GetEngineBlock;
  127. }
  128. function CEngineBlock(blockName)
  129. {
  130. this.m_blockName = blockName;
  131. this.m_engs = new Array();
  132. this.m_order = new Array();
  133. this.m_prefCount = 4;
  134. }
  135. function CEngineBlock_UnPersistBlock(nNodes, docNode)
  136. {
  137. var i;
  138. var bSettingsExist = false;
  139. for (i = 0; i < nNodes; i++)
  140. {
  141. var blockNode = docNode.childNodes.item(i);
  142. if (XML_GetAttribute(blockNode, "NAME") == this.m_blockName)
  143. {
  144. var nEngines = blockNode.childNodes.length;
  145. var j;
  146. for (j = 0; j < nEngines; j++)
  147. {
  148. bSettingsExist = true;
  149. var engineId = XML_GetAttribute(blockNode.childNodes.item(j), "ID");
  150. if (null != this.m_engs[engineId])
  151. {
  152. var nOrder = this.m_order.length;
  153. this.m_order[nOrder] = engineId;
  154. }
  155. }
  156. break;
  157. }
  158. }
  159. // Ensure each block has at least one engine.
  160. // If no settings have been persisted, turn 'em all on.
  161. if (this.m_order.length < 1)
  162. {
  163. i = 0;
  164. for (eng in this.m_engs)
  165. {
  166. this.m_order[i] = eng + "";
  167. i++;
  168. if (bSettingsExist)
  169. {
  170. break;
  171. }
  172. }
  173. }
  174. }
  175. function CEngineBlock_NewEngine(engineId, dispName, flags, query)
  176. {
  177. this.m_engs[engineId] = new CEngine(engineId, dispName, flags, query);
  178. return this.m_engs[engineId];
  179. }
  180. function CEngineBlock_GetEngine(index)
  181. {
  182. return this.m_engs[this.m_order[index]];
  183. }
  184. function CEngineBlock_GetEngineCount()
  185. {
  186. return this.m_order.length;
  187. }
  188. function CEngineBlock_Prototype()
  189. {
  190. CEngineBlock.prototype.UnPersistBlock = CEngineBlock_UnPersistBlock;
  191. CEngineBlock.prototype.NewEngine = CEngineBlock_NewEngine;
  192. CEngineBlock.prototype.GetEngine = CEngineBlock_GetEngine;
  193. CEngineBlock.prototype.GetEngineCount = CEngineBlock_GetEngineCount;
  194. }
  195. function CEngine(engineId, dispName, flags, query)
  196. {
  197. this.m_engineId = engineId;
  198. this.m_dispName = dispName;
  199. this.m_flags = flags;
  200. this.m_query = query;
  201. }
  202. function CEngine_ProcessQueryFields(names, values)
  203. {
  204. var url = this.m_query;
  205. var n = names.length;
  206. for (i = 0; i < n; i++)
  207. {
  208. url = MyReplace(url, "**" + names[i] + "**", values[i]);
  209. }
  210. return url;
  211. }
  212. function CEngine_Prototype()
  213. {
  214. CEngine.prototype.ProcessQueryFields = CEngine_ProcessQueryFields;
  215. }
  216. // CPanel "class"
  217. function CPanel(pnl)
  218. {
  219. this.m_panelID = pnl.panelID;
  220. this.m_flds = null;
  221. this.m_fldNames = null;
  222. this.m_fldValues = null;
  223. this.m_engBucket = null;
  224. this.m_curBlock = "default";
  225. this.m_bNavInPlace = true;
  226. var flags = eval(pnl.flags);
  227. this.m_flags = (null != flags) ? flags : 0;
  228. var pnlInitProc = eval(pnl.InitProc);
  229. if (null != pnlInitProc)
  230. {
  231. this.InitProc = pnlInitProc;
  232. }
  233. }
  234. function CPanel_Show(bShow)
  235. {
  236. var opt = GetOption(this.m_panelID);
  237. var pnl = GetPanel(this.m_panelID);
  238. if (bShow)
  239. {
  240. opt.className = "selectedTitle";
  241. pnl.style.display = "";
  242. this.OnShow();
  243. }
  244. else
  245. {
  246. opt.className = "";
  247. pnl.style.display = "none";
  248. }
  249. }
  250. function CPanel_ExtractFields()
  251. {
  252. if (null == this.m_flds)
  253. {
  254. var srchflds = GetPanel(this.m_panelID).srchflds;
  255. var i;
  256. if (null != srchflds)
  257. {
  258. var ctrls = srchflds.split(",");
  259. this.m_flds = new Array();
  260. for (i = 0; i < ctrls.length; i++)
  261. {
  262. this.m_flds[i] = eval("form" + GetPanel(this.m_panelID).panelID + "." + ctrls[i]);
  263. }
  264. }
  265. }
  266. }
  267. function CPanel_CanSearch()
  268. {
  269. var L_NeedSearchText_ErrorMessage = "Please specify something to search for!";
  270. var result;
  271. var n = this.m_flds.length;
  272. var i;
  273. for (i = 0; i < n; i++)
  274. {
  275. if (this.m_flds[i].value.length > 0)
  276. {
  277. break;
  278. }
  279. }
  280. if (i < n)
  281. {
  282. result = true;
  283. }
  284. else
  285. {
  286. alert(L_NeedSearchText_ErrorMessage);
  287. for (i = 0; i < n; i++)
  288. {
  289. if (itemIsVisible(this.m_flds[i]))
  290. {
  291. this.m_flds[i].focus();
  292. break;
  293. }
  294. }
  295. result = false;
  296. }
  297. return result;
  298. }
  299. function CPanel_CreateEngineBucket()
  300. {
  301. if (null == this.m_engBucket)
  302. {
  303. this.m_engBucket = new CEngineBucket(this.m_panelID);
  304. return true;
  305. }
  306. return false;
  307. }
  308. function CPanel_InitProc()
  309. {
  310. this.ExtractFields();
  311. }
  312. function CPanel_OnShow()
  313. {
  314. this.InitProc();
  315. this.SetAd();
  316. }
  317. function CPanel_ClearFields()
  318. {
  319. var flds = this.m_flds;
  320. if (null != flds)
  321. {
  322. var n = flds.length;
  323. var i;
  324. for (i = 0; i < n; i++)
  325. {
  326. flds.value = "";
  327. }
  328. }
  329. }
  330. function CPanel_PersistSearch()
  331. {
  332. xmlObj.load(g_prevSearchStore);
  333. var doc = xmlObj.XMLDocument;
  334. var docNode = doc.documentElement;
  335. var node = doc.createNode(1, "PREVIOUSSEARCH", "");
  336. XML_SetAttribute(doc, node, "PANELID", this.m_panelID);
  337. XML_SetAttribute(doc, node, "BLOCK", this.m_curBlock);
  338. var nvnode;
  339. var i;
  340. var n = this.m_flds.length;
  341. for (i = 0; i < n; i++)
  342. {
  343. nvnode = doc.createNode(1, "SEARCHFIELD", "");
  344. XML_SetAttribute(doc, nvnode, "NAME", this.m_names[i]);
  345. XML_SetAttribute(doc, nvnode, "VALUE", this.m_values[i]);
  346. node.insertBefore(nvnode, null);
  347. }
  348. docNode.insertBefore(node, docNode.firstChild);
  349. n = docNode.childNodes.length;
  350. for (i = 10; i < n; i++)
  351. {
  352. docNode.removeChild(docNode.childNodes.item(i));
  353. }
  354. xmlObj.save(g_prevSearchStore);
  355. }
  356. function CPanel_SetNameValuePairs(names, values)
  357. {
  358. this.m_names = names;
  359. this.m_values = values;
  360. }
  361. function CPanel_SetBlock(block)
  362. {
  363. if (null != this.m_engBucket.GetEngineBlock(block))
  364. {
  365. this.m_curBlock = block;
  366. }
  367. }
  368. function CPanel_RunEngineSearch(engIndex)
  369. {
  370. g_srchPanel = GetPanel(this.m_panelID);
  371. var block = this.m_engBucket.GetEngineBlock(this.m_curBlock);
  372. var eng = block.GetEngine(engIndex);
  373. var url = eng.ProcessQueryFields(this.m_names, this.m_values);
  374. if (eng.m_flags & ENG_IN_PANE)
  375. {
  376. paneAssistant.style.display = "none";
  377. paneResults.style.display = "";
  378. iframeResults.location.href = url;
  379. document.body.style.overflow = "hidden";
  380. }
  381. else
  382. {
  383. window.open(url, "_main");
  384. }
  385. }
  386. function CPanel_SetupNextMenu()
  387. {
  388. if (null != saOC)
  389. {
  390. var block = this.m_engBucket.GetEngineBlock(this.m_curBlock);
  391. var n = block.GetEngineCount();
  392. if (n > 1)
  393. {
  394. var i;
  395. for (i = 0; i < n; i++)
  396. {
  397. var eng = block.GetEngine(i);
  398. saOC.AddNextMenuItem(eng.m_dispName, i);
  399. }
  400. }
  401. }
  402. }
  403. function CPanel_RunWebSearch()
  404. {
  405. if (this.CanSearch())
  406. {
  407. this.m_names = new Array();
  408. this.m_values = new Array();
  409. var n = this.m_flds.length;
  410. var i;
  411. for (i = 0; i < n; i++)
  412. {
  413. this.m_names[i] = this.m_flds[i].name;
  414. this.m_values[i] = this.m_flds[i].value;
  415. }
  416. this.PersistSearch();
  417. this.SetupNextMenu();
  418. this.RunEngineSearch(0);
  419. }
  420. }
  421. function CPanel_OnEnter()
  422. {
  423. this.RunWebSearch();
  424. }
  425. function CPanel_GetNextEngine()
  426. {
  427. var max = this.m_engBucket.GetEngineBlock(this.m_curBlock).GetEngineCount();
  428. curEngine += 1;
  429. if (curEngine >= max)
  430. {
  431. curEngine = 0;
  432. }
  433. else if (curEngine < 0)
  434. {
  435. curEngine = max - 1;
  436. }
  437. return curEngine;
  438. }
  439. function CPanel_SetAd()
  440. {
  441. var L_BroughtToYou_Text = "Brought to you by ";
  442. var idAd = document.all["ad" + this.m_panelID];
  443. if (idAd != null)
  444. {
  445. if (null != this.m_engBucket)
  446. {
  447. var block = this.m_engBucket.GetEngineBlock(this.m_curBlock);
  448. idAd.innerHTML = L_BroughtToYou_Text + block.GetEngine(0).m_dispName;
  449. }
  450. }
  451. }
  452. function CPanel_SetDefFocus()
  453. {
  454. if ((this.m_flds != null) && (this.m_flds.length > 0))
  455. {
  456. this.m_flds[0].focus();
  457. }
  458. }
  459. function CPanel_InitializeDefaults()
  460. {
  461. if (!(this.m_flags & PNL_SHELL))
  462. {
  463. this.InitProc();
  464. if (null != this.m_engBucket)
  465. {
  466. var blockName;
  467. for (blockName in this.m_engBucket.m_blocks)
  468. {
  469. var block = this.m_engBucket.GetEngineBlock(blockName);
  470. var nEngs = block.GetEngineCount();
  471. var prefCount = block.m_prefCount < nEngs ? block.m_prefCount : nEngs;
  472. var i;
  473. var engineName;
  474. i = 0;
  475. for (engineName in block.m_engs)
  476. {
  477. block.m_order[i] = engineName;
  478. i++;
  479. }
  480. for (i = 0; i < nEngs; i++)
  481. {
  482. var rand;
  483. if (i < prefCount)
  484. {
  485. rand = Math.floor(prefCount * Math.random());
  486. }
  487. else
  488. {
  489. rand = Math.floor((nEngs - prefCount) * Math.random()) + prefCount;
  490. }
  491. var ordSave = block.m_order[i];
  492. block.m_order[i] = block.m_order[rand];
  493. block.m_order[rand] = ordSave;
  494. }
  495. }
  496. }
  497. }
  498. }
  499. function CPanel_Prototype()
  500. {
  501. // NOTE: All of these methods can be overridden easily.
  502. // For instance, the InitProc method must be overridden
  503. // (it is also the best place to hook in overrides).
  504. CPanel.prototype.CanSearch = CPanel_CanSearch;
  505. CPanel.prototype.ClearFields = CPanel_ClearFields;
  506. CPanel.prototype.CreateEngineBucket = CPanel_CreateEngineBucket;
  507. CPanel.prototype.ExtractFields = CPanel_ExtractFields;
  508. CPanel.prototype.GetNextEngine = CPanel_GetNextEngine;
  509. CPanel.prototype.InitializeDefaults = CPanel_InitializeDefaults;
  510. CPanel.prototype.InitProc = CPanel_InitProc; // intended to be "virtual"
  511. CPanel.prototype.OnEnter = CPanel_OnEnter;
  512. CPanel.prototype.OnShow = CPanel_OnShow;
  513. CPanel.prototype.PersistSearch = CPanel_PersistSearch;
  514. CPanel.prototype.RunEngineSearch = CPanel_RunEngineSearch
  515. CPanel.prototype.RunWebSearch = CPanel_RunWebSearch;
  516. CPanel.prototype.SetAd = CPanel_SetAd;
  517. CPanel.prototype.SetBlock = CPanel_SetBlock;
  518. CPanel.prototype.SetDefFocus = CPanel_SetDefFocus;
  519. CPanel.prototype.SetNameValuePairs = CPanel_SetNameValuePairs;
  520. CPanel.prototype.SetupNextMenu = CPanel_SetupNextMenu;
  521. CPanel.prototype.Show = CPanel_Show;
  522. }
  523. function GetPanelObj(panelID)
  524. {
  525. var res = g_catObjMap[panelID];
  526. if (res == null)
  527. {
  528. ODS("null return in GetPanelObj!");
  529. }
  530. return res;
  531. }
  532. function GetPanel(panelID)
  533. {
  534. return ObjFromPanelID(panel, panelID);
  535. }
  536. function GetOption(panelID)
  537. {
  538. return ObjFromPanelID(option, panelID);
  539. }
  540. function GetRadioButton(panelID)
  541. {
  542. return ObjFromPanelID(rbSearch, panelID);
  543. }
  544. function PersistSettings()
  545. {
  546. var i;
  547. var n;
  548. xmlObj.load(g_catConfig);
  549. doc = xmlObj.XMLDocument;
  550. docNode = doc.documentElement;
  551. XML_EmptyDocNode(docNode);
  552. var defPanelOrder = new Array("Web", "Pers", "Co", "Files", "Prev", "Map", "Enc", "News", "Printer", "Computer");
  553. n = defPanelOrder.length;
  554. for (i = 0; i < n; i++)
  555. {
  556. var pnl = ObjFromPanelID(panel, defPanelOrder[i]);
  557. if (null != pnl)
  558. {
  559. var catNode = doc.createNode(1, "CATEGORY", "");
  560. XML_SetAttribute(doc, catNode, "PANELID", defPanelOrder[i]);
  561. docNode.insertBefore(catNode, docNode.childNodes[0]);
  562. }
  563. }
  564. xmlObj.save(g_catConfig);
  565. n = panel.length;
  566. for (i = 0; i < n; i++)
  567. {
  568. var pnlObj = GetPanelObj(panel[i].panelID);
  569. if (!(pnlObj.m_flags & PNL_SHELL))
  570. {
  571. if (null != pnlObj.m_engBucket)
  572. {
  573. xmlObj.load(g_pnlConfig + panel[i].panelID);
  574. doc = xmlObj.XMLDocument;
  575. docNode = doc.documentElement;
  576. XML_EmptyDocNode(docNode);
  577. for (blockName in pnlObj.m_engBucket.m_blocks)
  578. {
  579. var block = pnlObj.m_engBucket.GetEngineBlock(blockName);
  580. var nEngines = block.GetEngineCount();
  581. var blockNode = doc.createNode(1, "BLOCK", "");
  582. var j;
  583. XML_SetAttribute(doc, blockNode, "NAME", blockName);
  584. for (j = 0; j < nEngines; j++)
  585. {
  586. var engNode = doc.createNode(1, "ENGINE", "");
  587. XML_SetAttribute(doc, engNode, "ID", block.GetEngine(j).m_engineId);
  588. blockNode.insertBefore(engNode, blockNode.childNodes[0]);
  589. }
  590. docNode.insertBefore(blockNode, docNode.childNodes[0]);
  591. }
  592. xmlObj.save(g_pnlConfig + panel[i].panelID);
  593. }
  594. }
  595. }
  596. }
  597. function EnableOptions(obj, bEnable)
  598. {
  599. var kids = obj.children;
  600. var n = kids.length;
  601. var i;
  602. for (i = 0; i < n; i++)
  603. {
  604. var kid = kids[i];
  605. if (kid.children.length > 0)
  606. {
  607. EnableOptions(kid, bEnable); //recurse
  608. }
  609. if ((kid.tagName == "INPUT") && (kid.type == "radio"))
  610. {
  611. kid.disabled = !bEnable;
  612. }
  613. }
  614. }
  615. function ShowPanel(panelID, optCount)
  616. {
  617. InitializePanels();
  618. var pnlObj = GetPanelObj(panelID);
  619. // Don't try to work with a null and don't try to add a disabled or already positioned option
  620. if ((null != pnlObj) && (!(pnlObj.m_flags & (PNL_DISABLED | PNL_POSITIONED))))
  621. {
  622. var spanHost;
  623. if (optCount < 5)
  624. {
  625. spanHost = spanTopFive;
  626. }
  627. else
  628. {
  629. if (showMeMore.style.display != "")
  630. {
  631. showMeMore.style.display = "";
  632. }
  633. spanHost = spanTheRest;
  634. }
  635. spanHost.insertBefore(GetOption(panelID));
  636. pnlObj.m_flags |= PNL_POSITIONED;
  637. optCount++;
  638. }
  639. return optCount;
  640. }
  641. function ObjFromPanelID(col, panelID)
  642. {
  643. var n = col.length;
  644. var i;
  645. for (i = 0; i < n; i++)
  646. {
  647. if (col[i].panelID == panelID)
  648. return col[i];
  649. }
  650. ODS(col[i].id + " " + panelID + " not found!");
  651. return null;
  652. }
  653. function InitializePanels()
  654. {
  655. if (g_catObjMap == null)
  656. {
  657. var i;
  658. var nPanels;
  659. g_catObjMap = new Array;
  660. // * Assign each panel basic data
  661. // * Tell each radio button about it's corresponding panel about each other
  662. nPanels = panel.length;
  663. for (i = 0; i < nPanels; i++)
  664. {
  665. g_catObjMap[panel[i].panelID] = new CPanel(panel[i]);
  666. }
  667. }
  668. }
  669. function win_OnLoad()
  670. {
  671. var i;
  672. var n;
  673. window.onerror = win_OnError;
  674. // Build class prototypes
  675. CPanel_Prototype();
  676. CEngineBucket_Prototype();
  677. CEngineBlock_Prototype();
  678. CEngine_Prototype();
  679. var optCount = 0;
  680. // Check if shell support is enabled
  681. g_bEnableShellSearch = (null != saOC) ? saOC.ShellFeaturesEnabled : false;
  682. if (g_bEnableShellSearch)
  683. {
  684. shOC = new ActiveXObject("Shell.Application");
  685. if (null == shOC)
  686. {
  687. // RUH-ROH! Couldn't instantiate the shell OC, better to disable the feature
  688. // than to get script errors.
  689. // REVIEW: Should we display a "friendly" error message?
  690. g_bEnableShellSearch = false;
  691. }
  692. }
  693. if (g_bEnableShellSearch)
  694. {
  695. var searches = saOC.Searches;
  696. if ((!saOC.InWebFolder) && (null != searches))
  697. {
  698. var searchCount = searches.Count;
  699. if (searchCount < 1)
  700. {
  701. var defSearch = searches.Default;
  702. var topPanelID = "";
  703. var panelMap = new Array(g_SRCID_SFileSearch, "Files",
  704. g_SRCID_SFindComputer, "Computer",
  705. g_SRCID_SFindPrinter, "Printer");
  706. for (i = 0; i < panelMap.length; i += 2)
  707. {
  708. if (defSearch.toLowerCase() == panelMap[i].toLowerCase())
  709. {
  710. topPanelID = panelMap[i + 1];
  711. break;
  712. }
  713. }
  714. if (topPanelID != "")
  715. {
  716. optCount = ShowPanel(topPanelID, optCount);
  717. }
  718. }
  719. else
  720. {
  721. for (i = 0; i < searcheCount; i++)
  722. {
  723. var search = searches.Item(i);
  724. // TODO: Need to generate search blocks and call ShowPanel()
  725. }
  726. }
  727. }
  728. InitializePanels();
  729. }
  730. else
  731. {
  732. InitializePanels();
  733. for (i = 0; i < panel.length; i++)
  734. {
  735. var pnlObj = GetPanelObj(panel[i].panelID);
  736. if (pnlObj.m_flags & PNL_SHELL)
  737. {
  738. pnlObj.m_flags |= PNL_DISABLED;
  739. }
  740. }
  741. }
  742. xmlObj.load(g_catConfig);
  743. // First time initialization.
  744. if (xmlObj.XMLDocument.documentElement.childNodes.length < 1)
  745. {
  746. n = panel.length;
  747. for (i = 0; i < n; i++)
  748. {
  749. GetPanelObj(panel[i].panelID).InitializeDefaults();
  750. }
  751. PersistSettings();
  752. // Reload, since we have no idea what's currently loaded.
  753. xmlObj.load(g_catConfig);
  754. }
  755. var doc = xmlObj.XMLDocument;
  756. var docNode = doc.documentElement;
  757. n = docNode.childNodes.length;
  758. for (i = 0; i < n; i++)
  759. {
  760. optCount = ShowPanel(XML_GetAttribute(docNode.childNodes.item(i), "PANELID"), optCount);
  761. }
  762. EnableOptions(spanTopFive, true);
  763. spanLoading.style.display = "none";
  764. spanOptions.style.display = "";
  765. var defPanelID = spanTopFive.children[0].panelID;
  766. GetRadioButton(defPanelID).click();
  767. GetPanelObj(defPanelID).SetDefFocus();
  768. //document.onkeypress = doc_OnKeyPress;
  769. }
  770. function customize()
  771. {
  772. window.open("customize.htm", "_main");
  773. }
  774. function doc_OnKeyPress()
  775. {
  776. if ((event.keyCode == 13) && (event.srcElement.tagName == "INPUT") && (event.srcElement.type == "button"))
  777. {
  778. OnEnter();
  779. }
  780. }
  781. function win_OnError(message, url, line)
  782. {
  783. // This is displayed when a script error occurs
  784. var L_ScriptErrMsg_ErrorMessage = "An error has occured on this page.";
  785. var L_ScriptErrLine_Text = "Line: ";
  786. var L_ScriptErrURL_Text = "URL: ";
  787. var str = L_ScriptErrMsg_ErrorMessage + "\n\n"
  788. + L_ScriptErrLine_Text + line + "\n"
  789. + L_ScriptErrURL_Text + url + "\n\n"
  790. + message;
  791. ODS(str);
  792. return true;
  793. }
  794. function XML_EmptyDocNode(docNode)
  795. {
  796. var n = docNode.childNodes.length;
  797. var i;
  798. for (i = 0; i < n; i++)
  799. {
  800. docNode.removeChild(docNode.childNodes.item(0))
  801. }
  802. }
  803. function XML_SetAttribute(doc, node, name, value)
  804. {
  805. var attr = doc.createNode(2, name, "");
  806. attr.nodeValue = value;
  807. node.attributes.setNamedItem(attr);
  808. }
  809. function XML_GetAttribute(node, name)
  810. {
  811. var attr = node.attributes.getNamedItem(name);
  812. if (null != attr)
  813. {
  814. return attr.nodeValue;
  815. }
  816. else
  817. {
  818. return "";
  819. }
  820. }
  821. function OnEnter()
  822. {
  823. // Check for null in case anxious user hits enter before we've inited.
  824. if (null != g_displayPanel)
  825. {
  826. GetPanelObj(g_displayPanel.panelID).OnEnter();
  827. }
  828. }
  829. function NewSearch()
  830. {
  831. paneAssistant.style.display = "";
  832. paneResults.style.display = "none";
  833. iframeResults.location.href = "about:blank";
  834. document.body.style.overflow = "auto";
  835. }
  836. function opt_OnClick(panelID)
  837. {
  838. if (null != g_displayPanel)
  839. {
  840. GetPanelObj(g_displayPanel.panelID).Show(false);
  841. }
  842. // Check for null in case a user clicks on an option
  843. // before onLoad has fired.
  844. var pnlObj = GetPanelObj(panelID);
  845. if (null != pnlObj)
  846. {
  847. g_displayPanel = GetPanel(panelID);
  848. pnlObj.Show(true);
  849. }
  850. }
  851. function itemIsVisible(item)
  852. {
  853. var curItem = item;
  854. while (curItem.style.display != "none")
  855. {
  856. curItem = curItem.parentElement;
  857. if (null == curItem)
  858. {
  859. return true;
  860. }
  861. }
  862. return false;
  863. }
  864. function showMore()
  865. {
  866. EnableOptions(spanTheRest, true);
  867. showMeMore.style.display = "none";
  868. spanTheRest.style.display = "";
  869. }
  870. function spewChildren(elem)
  871. {
  872. var s = elem.name + " contains\n";
  873. var i;
  874. var n = elem.children.length;
  875. for (i = 0; i < n; i++)
  876. {
  877. s += "name="+ elem.children[i].name + "tag="+elem.children[i].tagName +"\n";
  878. }
  879. ODS(s);
  880. }
  881. function spewCollection(coll)
  882. {
  883. var s = coll.name + " "
  884. for (x in coll)
  885. {
  886. s += x + " ";
  887. }
  888. ODS(s);
  889. }
  890. var g_Dbg = "";
  891. function Debug()
  892. {
  893. var s = prompt('Debugger:', g_Dbg);
  894. if ((s != "") && (s != "undefined") && (s != null))
  895. {
  896. g_Dbg = s;
  897. ODS(eval(g_Dbg));
  898. }
  899. }
  900. function ODS(s)
  901. {
  902. alert(s);
  903. }
  904. </script>
  905. <script defer for=saOC event="OnNextMenuSelect(idItem)">
  906. GetPanelObj(g_srchPanel.panelID).RunEngineSearch(idItem);
  907. </script>
  908. <body bgcolor=window text=windowtext scroll=no style="margin:0px;overflow:auto" onload="return win_OnLoad()">
  909. <basefont id=idBaseFont face="MS Shell Dlg">
  910. <!-- Search Assistant OC -->
  911. <span style="display:none">
  912. <object id=saOC CLASSID='clsid:B45FF030-4447-11D2-85DE-00C04FA35C89' HEIGHT=0 width=0></object>
  913. <input type=hidden id=xmlObj style="behavior:url(#_IE_)" class=userData>
  914. </span>
  915. <!-- Search results pane -->
  916. <div id=paneResults style="display:none;margin:0px">
  917. <iframe id="iframeResults" width="100%" height="100%" style="position:relative;top:0;left:0;margin:0px" src="about:blank">
  918. </iframe>
  919. </div>
  920. <!-- Options and search specific panels pane -->
  921. <div id=paneAssistant style="padding-left:9px;padding-right:9px;padding-top:6px;width:100%">
  922. <div id=id0000>
  923. <span>
  924. <span id=spanLoading>
  925. Loading Search Settings...
  926. </span>
  927. <span id=spanOptions style="display:none">
  928. <nobr id=idChooseCategory>Choose a category for your search:</nobr>
  929. <ul class="indentRadio">
  930. <span id=spanTopFive>
  931. </span>
  932. <div id=showMeMore style="display:none;text-align:'right'">
  933. <a href="javascript:showMore();" title="Show more search categories">more...</a>
  934. </div>
  935. <span id=spanTheRest style="display:none">
  936. </span>
  937. <span id=spanTheWell style="display:none">
  938. <!-- Web searches -->
  939. <span id=option panelID=Web lbl=lWebPage>
  940. <nobr>
  941. <input panelID=Web type=radio name=rbSearch disabled=true id=optWeb accesskey=w onclick="opt_OnClick(this.panelID)">
  942. <label id=lWebPage for=optWeb>Find a <u>W</u>eb page</label>
  943. </nobr>
  944. <br>
  945. </span>
  946. <span id=option panelID=Pers lbl=lPersonal>
  947. <nobr>
  948. <input panelID=Pers type=radio name=rbSearch disabled=true id=optPers accesskey=a onclick="opt_OnClick(this.panelID)">
  949. <label id=lPersonal for=optPers>Find a Person's <u>A</u>ddress</label>
  950. </nobr>
  951. <br>
  952. </span>
  953. <span id=option panelID=Co lbl=lCompany>
  954. <nobr>
  955. <input panelID=Co type=radio name=rbSearch disabled=true id=optCo accesskey=c onclick="opt_OnClick(this.panelID)">
  956. <label id=lCompany for=optCo>Find a <u>C</u>ompany/organization</label>
  957. </nobr>
  958. <br>
  959. </span>
  960. <span id=option panelID=Enc lbl=lEncyclopedia>
  961. <nobr>
  962. <input panelID=Enc type=radio name=rbSearch disabled=true id=optEnc accesskey=e onclick="opt_OnClick(this.panelID)">
  963. <label id=lEncyclopedia for=optEnc>Find in <u>E</u>ncyclopedia</label>
  964. </nobr>
  965. <br>
  966. </span>
  967. <span id=option panelID=Map lbl=lMap>
  968. <nobr>
  969. <input panelID=Map type=radio name=rbSearch disabled=true id=optMap accesskey=m onclick="opt_OnClick(this.panelID)">
  970. <label id=lMap for=optMap>Find a <u>M</u>ap</label>
  971. </nobr>
  972. <br>
  973. </span>
  974. <span id=option panelID=News lbl=lNews>
  975. <nobr>
  976. <input panelID=News type=radio name=rbSearch disabled=true id=optNews accesskey=n onclick="opt_OnClick(this.panelID)">
  977. <label id=lNews for=optNews>Find in <u>N</u>ewsgroups</label>
  978. </nobr>
  979. <br>
  980. </span>
  981. <span id=option panelID=Prev>
  982. <nobr>
  983. <input panelID=Prev type=radio name=rbSearch disabled=true id=optPrev accesskey=p onclick="opt_OnClick(this.panelID)">
  984. <label id=lPrevious for=optPrev><U>P</U>revious Searches</label>
  985. </nobr>
  986. <br>
  987. </span>
  988. <!-- Shell searches -->
  989. <span id=option panelID=Files lbl=lFiles>
  990. <nobr>
  991. <input panelID=Files type=radio name=rbSearch disabled=true id=optFiles accesskey=z onclick="opt_OnClick(this.panelID)">
  992. <label id=lFiles for=optFiles>Find Files and Folders</label>
  993. </nobr>
  994. <br>
  995. </span>
  996. <span id=option panelID=Printer lbl=lPrinter>
  997. <nobr>
  998. <input panelID=Printer type=radio name=rbSearch disabled=true id=optPrinter accesskey=z onclick="opt_OnClick(this.panelID)">
  999. <label id=lPrinter for=optPrinter>Find a Printer</label>
  1000. </nobr>
  1001. <br>
  1002. </span>
  1003. <span id=option panelID=Computer lbl=lComputer>
  1004. <nobr>
  1005. <input panelID=Computer type=radio name=rbSearch disabled=true id=optComputer accesskey=z onclick="opt_OnClick(this.panelID)">
  1006. <label id=lComputer for=optComputer>Find a Computer</label>
  1007. </nobr>
  1008. <br>
  1009. </span>
  1010. <span id=option panelID=Custom lbl=lCustom>
  1011. <nobr>
  1012. <input panelID=Custom type=radio name=rbSearch disabled=true id=optCustom onclick="opt_OnClick(this.panelID)">
  1013. <label id=lCustom for=optCustom>TBD</label>
  1014. </nobr>
  1015. <br>
  1016. </span>
  1017. </span>
  1018. </ul>
  1019. </span>
  1020. </span>
  1021. </div>
  1022. <!-- specific search option panels -->
  1023. <!-- Web searches -->
  1024. <!-- Standard Web Query -->
  1025. <script defer>
  1026. // "virtual" CPanel.InitProc
  1027. function WebInitProc()
  1028. {
  1029. if (this.CreateEngineBucket())
  1030. {
  1031. var block = this.m_engBucket.NewEngineBlock("default");
  1032. block.m_prefCount = 5;
  1033. block.NewEngine("altavista","AltaVista", ENG_IN_PANE, "http://www.altavista.com/cgi-bin/query?pg=n200&kl=XX&q=**SearchText**");
  1034. block.NewEngine("infoseek", "InfoSeek", ENG_IN_PANE, "http://www.infoseek.com/Titles?qt=**SearchText**&col=WW%2Ccat_RES&sv=M6&lk=noframes&nh=10&ud9=IE5");
  1035. block.NewEngine("hotbot", "HotBot", ENG_IN_PANE, "http://www.hotbot.com/msiesearchpanel/msResult.html?MT=**SearchText**&DV=0&RG=all&_v=2&OPs=MDRTP");
  1036. block.NewEngine("lycos", "Lycos", ENG_IN_PANE, "http://www.lycos.com/cgi-bin/pursuit?mtemp=msie&results=ie4&etemp=error_msie&query=**SearchText**&matchmode=and");
  1037. block.NewEngine("msn", "MSN Web Search", ENG_IN_PANE, "http://search.msn.com/spbasic.htm?MT=**SearchText**");
  1038. block.NewEngine("excite", "Excite", ENG_IN_PANE, "http://search.excite.com/search.gw?trace=1&look=ie40&search=**SearchText**");
  1039. block.NewEngine("aolnetfind", "AOL NetFind", ENG_IN_PANE, "http://netfind.aol.com/search.gw?c=web&lk=aolienew_us&search=**SearchText**");
  1040. block.NewEngine("yahoo", "Yahoo!", ENG_IN_PANE, "http://search.yahoo.com/search?o=1&m=i&a=fd&p=**SearchText**");
  1041. block.NewEngine("euroseek", "Euroseek", ENG_IN_PANE, "http://www.euroseek.net/query?iflang=uk&style=msie&query=**SearchText**&domain=world&lang=world");
  1042. this.m_engBucket.UnPersistOrder();
  1043. this.ExtractFields();
  1044. }
  1045. }
  1046. </script>
  1047. <div class=searchPanel id=panel style="display:none" panelID=Web
  1048. srchflds=txtWebSearch InitProc=WebInitProc>
  1049. <form id=formWeb onsubmit="OnEnter();return false;">
  1050. Find a web page containing:<br>
  1051. <input class=inputs type=text name=SearchText id=txtWebSearch><br>
  1052. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1053. <tr>
  1054. <td>
  1055. <div class=AdSpace id=adWeb></div>
  1056. </td>
  1057. <td class=rightButton>
  1058. <input type=submit id=btnWebSearch value=Search title="Start Searching">
  1059. </td>
  1060. </tr>
  1061. </table>
  1062. </form>
  1063. </div>
  1064. <!-- Search for personal e-mail/snail mail addresses -->
  1065. <script defer>
  1066. // "virtual" CPanel.InitProc
  1067. function PersInitProc()
  1068. {
  1069. if (this.CreateEngineBucket())
  1070. {
  1071. block = this.m_engBucket.NewEngineBlock("email");
  1072. block.NewEngine("infospace", "InfoSpace", ENG_IN_PANE, "http://in-110.infospace.com/_1_211777544__info.iebar/Email?leftbar=1&QN=**LastName**&QF=**FirstName**&QC=**City**&QS=**State**&QO=");
  1073. block.NewEngine("bigfoot", "Bigfoot", ENG_IN_PANE, "http://search.bigfoot.com/search?FormName=SearchBar&locale=en&action=e&SearchName=**FirstName**%20**LastName**");
  1074. block = this.m_engBucket.NewEngineBlock("smail");
  1075. block.NewEngine("infospace", "InfoSpace", ENG_IN_PANE, "http://in-128.infospace.com/_1_66025228__info.iebar/kevdb-g2?KDB=res-us&OTMPL=%2Fres%2Fr1.html&QTAPPEND=QN%2CQF&QFM=N&QK=5&QN=**LastName**&QF=**FirstName**&QC=**City**&QS=**State**");
  1076. block.NewEngine("bigfoot", "Bigfoot", ENG_IN_PANE, "http://search.bigfoot.com/search?FormName=SearchBar&locale=en&Action=W&SearchName=**FirstName**%20**LastName**");
  1077. this.m_curBlock = "smail";
  1078. this.m_engBucket.UnPersistOrder();
  1079. this.ExtractFields();
  1080. }
  1081. }
  1082. function PersType_OnChange(val)
  1083. {
  1084. var pnlObj = GetPanelObj("Pers");
  1085. pnlObj.m_curBlock = val;
  1086. pnlObj.SetAd();
  1087. }
  1088. </script>
  1089. <div class=searchPanel id=panel style="display:none" panelID=Pers
  1090. srchflds="txtPersFName,txtPersLName,txtPersCity,txtPersState" InitProc=PersInitProc>
  1091. <form id=formPers onsubmit="OnEnter();return false;">
  1092. <span id=idPersSearchFor>Search For:</span><br>
  1093. <select id=persSubType onchange=PersType_OnChange(this.value)>
  1094. <option id=idOptSmail value="smail" selected>mailing address</option>
  1095. <option id=idOptEmail value="email">e-mail address</option>
  1096. </select><br>
  1097. <id id=idPersFirstName>First Name:</id><br>
  1098. <input class=inputs name=FirstName id=txtPersFName><br>
  1099. <id id=idPersLastName>Last Name:</id><br>
  1100. <input class=inputs name=LastName id=txtPersLName>
  1101. <table cellspacing=0 cellpadding=0 width=100%>
  1102. <tr>
  1103. <td id=idPersCity>City:</td>
  1104. <td width=7 id=id0002>&nbsp;</td>
  1105. <td width=25 id=idPersState>State/Province:</td>
  1106. </tr>
  1107. <tr>
  1108. <td><input class=inputs name=City id=txtPersCity></td>
  1109. <td></td>
  1110. <td><input class=inputs size=2 maxlength=2 name=State id=txtPersState></td>
  1111. </tr>
  1112. </table>
  1113. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1114. <tr>
  1115. <td>
  1116. <div class=AdSpace id=adPers></div>
  1117. </td>
  1118. <td class=rightButton>
  1119. <input type=submit id=btnSearchPers value=Search title="Start Searching">
  1120. </td>
  1121. </tr>
  1122. </table>
  1123. </form>
  1124. </div>
  1125. <!-- Search for companies -->
  1126. <script defer>
  1127. // "virtual" CPanel.InitProc
  1128. function CoInitProc()
  1129. {
  1130. if (this.CreateEngineBucket())
  1131. {
  1132. block = this.m_engBucket.NewEngineBlock("default");
  1133. block.NewEngine("infoseek", "InfoSeek Company", 0, "http://www.infoseek.com/Titles?qt=**SearchText**&col=HV%2Ckt_A%2Cak_corpdir&sv=IS&lk=noframes&nh=10&ud9=IE5");
  1134. this.m_engBucket.UnPersistOrder();
  1135. this.ExtractFields();
  1136. }
  1137. }
  1138. </script>
  1139. <div class=searchPanel id=panel style="display:none" panelID=Co
  1140. srchflds=txtCoSearch InitProc=CoInitProc>
  1141. <form id=formCo onsubmit="OnEnter();return false;">
  1142. <id id=idCoCompany>Find company information:</id><br>
  1143. <input class=inputs name=SearchText id=txtCoSearch>
  1144. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1145. <tr>
  1146. <td>
  1147. <div class=AdSpace id=adCo></div>
  1148. </td>
  1149. <td class=rightButton>
  1150. <input type=submit id="btnSearchCo" value=Search title="Start Searching">
  1151. </td>
  1152. </tr>
  1153. </table>
  1154. </form>
  1155. </div>
  1156. <!-- Search encyclopedias -->
  1157. <script defer>
  1158. // "virtual" CPanel.InitProc
  1159. function EncInitProc()
  1160. {
  1161. if (this.CreateEngineBucket())
  1162. {
  1163. block = this.m_engBucket.NewEngineBlock("default");
  1164. block.NewEngine("encarta", "Encarta", ENG_IN_PANE, "http://find.msn.com/encarta/iesearchresults.asp?ix=concise1&mh=&so=ir_title&pp=1&o1=eq&q1=**SearchText**&c1=ir_title&x=11&y=12");
  1165. this.m_engBucket.UnPersistOrder();
  1166. this.ExtractFields();
  1167. }
  1168. }
  1169. </script>
  1170. <div class=searchPanel id=panel style="display:none" panelID=Enc
  1171. srchflds=txtEncSearch InitProc=EncInitProc>
  1172. <form id=formEnc onsubmit="OnEnter();return false;">
  1173. <id id=EncEncylopediaFind>Find encyclopedia articles on:</id><br>
  1174. <input class=inputs name=SearchText id=txtEncSearch>
  1175. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1176. <tr>
  1177. <td>
  1178. <div class=AdSpace id=adEnc></div>
  1179. </td>
  1180. <td class=rightButton>
  1181. <input type=submit id=btnSearchEnc value=Search title="Start Searching">
  1182. </td>
  1183. </tr>
  1184. </table>
  1185. </form>
  1186. </div>
  1187. <!-- Search Maps -->
  1188. <script defer>
  1189. // "virtual" CPanel.InitProc
  1190. function MapInitProc()
  1191. {
  1192. if (this.CreateEngineBucket())
  1193. {
  1194. block = this.m_engBucket.NewEngineBlock("address");
  1195. block.NewEngine("expedia", "Expedia", 0, "http://www.expediamaps.com/results.asp?Street=**StreetAddress**&City=**City**&State=**State**&Zip=**ZipCode**");
  1196. block = this.m_engBucket.NewEngineBlock("company");
  1197. block.NewEngine("expedia", "Expedia", 0, "http://www.expediamaps.com/results.asp?FindBy=N&Name=**CompanyName**&City=**City**&State=**State**&Zip=**ZipCode**");
  1198. block = this.m_engBucket.NewEngineBlock("place");
  1199. block.NewEngine("expedia", "Expedia", 0, "http://www.expediamaps.com/results.asp?Place=**PlaceName**");
  1200. this.m_engBucket.UnPersistOrder();
  1201. this.ExtractFields();
  1202. this.m_curBlock = "address";
  1203. }
  1204. }
  1205. function MapType_OnChange(val)
  1206. {
  1207. var pnlObj = GetPanelObj("Map");
  1208. pnlObj.m_curBlock = val;
  1209. pnlObj.SetAd();
  1210. switch (val)
  1211. {
  1212. case "address":
  1213. spanMapAddress.style.display = "";
  1214. spanMapCompany.style.display = "none";
  1215. spanMapPlace.style.display = "none";
  1216. break;
  1217. case "company":
  1218. spanMapAddress.style.display = "";
  1219. spanMapCompany.style.display = "";
  1220. spanMapPlace.style.display = "none";
  1221. break;
  1222. case "place":
  1223. spanMapAddress.style.display = "none";
  1224. spanMapCompany.style.display = "none";
  1225. spanMapPlace.style.display = "";
  1226. break;
  1227. }
  1228. }
  1229. </script>
  1230. <div class=searchPanel id=panel style="display:none" panelID=Map
  1231. srchflds="txtMapCompany,txtMapAddress,txtMapCity,txtMapState,txtMapZip,txtMapPlace" InitProc=MapInitProc>
  1232. <form id=formMap onsubmit="OnEnter();return false;">
  1233. <id id=idMapSearchFor>Search For:</id><br>
  1234. <select id=mapSubType onchange="MapType_OnChange(this.value)">
  1235. <option value="address" id=idOptMapAddress selected>Address</option>
  1236. <option value="company" id=idOptMapCompany>Company</option>
  1237. <option value="place" id=idOptMapPlace>Place or landmark</option>
  1238. </select><br>
  1239. <span id=spanMapCompany style="display:none">
  1240. <id id=idMapCompany>This Company Name:</id><br>
  1241. <input class=inputs name=CompanyName id=txtMapCompany><br>
  1242. </span>
  1243. <span id=spanMapAddress>
  1244. <id id=idMapAddress>This Address:</id><br>
  1245. <input class=inputs name=StreetAddress id=txtMapAddress><br>
  1246. <id id=idMapCity>City:</id><br>
  1247. <input class=inputs name=City id=txtMapCity><br>
  1248. <span>
  1249. <table cellspacing=0 cellpadding=0 width=100% id="maptable">
  1250. <tr>
  1251. <td id=idMapState>State/Province:</td>
  1252. <td width=7 id=id0003>&nbsp;</td>
  1253. <td width=50 id=idMapZip>Zip/Postal Code:</td>
  1254. </tr>
  1255. <tr>
  1256. <td><input class=inputs id=txtMapState name=State></td>
  1257. <td></td>
  1258. <td><input class=inputs size=7 maxlength=11 name=ZipCode id=txtMapZip></td>
  1259. </tr>
  1260. </table>
  1261. </span>
  1262. </span>
  1263. <span id=spanMapPlace style="display:none">
  1264. <id id=idMapPlace>This place or landmark:</id><br>
  1265. <input class=inputs name=PlaceName id=txtMapPlace><br>
  1266. </span>
  1267. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1268. <tr>
  1269. <td>
  1270. <div class=AdSpace id=adMap></div>
  1271. </td>
  1272. <td class=rightButton>
  1273. <input type=submit id=btnSearchMap value=Search title="Start Searching">
  1274. </td>
  1275. </tr>
  1276. </table>
  1277. </form>
  1278. </div>
  1279. <!-- Newsgroup search -->
  1280. <script defer>
  1281. // "virtual" CPanel.InitProc
  1282. function NewsInitProc()
  1283. {
  1284. if (this.CreateEngineBucket())
  1285. {
  1286. var block = this.m_engBucket.NewEngineBlock("default");
  1287. block.NewEngine("dejanews","Dejanews", ENG_IN_PANE, "http://www.dejanews.com/=mssb/dnquery.xp?defaultOp=AND&svcclass=dncurrent&maxhits=10&format=terse2&ST=QS&site=mssb&QRY=**SearchText**");
  1288. this.m_engBucket.UnPersistOrder();
  1289. this.ExtractFields();
  1290. }
  1291. }
  1292. </script>
  1293. <div class=searchPanel id=panel style="display:none" panelID=News
  1294. srchflds=txtNewsSearch InitProc=NewsInitProc>
  1295. <form id=formNews onsubmit="OnEnter();return false;">
  1296. <id id=idNewsFind>Find a Newsgroup containing:</id><br>
  1297. <input style="width:100%" type=text name=SearchText id=txtNewsSearch class=inputs><br>
  1298. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1299. <tr>
  1300. <td>
  1301. <div class=AdSpace id=adNews></div>
  1302. </td>
  1303. <td class=rightButton>
  1304. <input type=submit id=btnNewsSearch value=Search title="Start Searching">
  1305. </td>
  1306. </tr>
  1307. </table>
  1308. </form>
  1309. </div>
  1310. <!-- Run previous searches -->
  1311. <script defer>
  1312. // "virtual" CPanel.InitProc
  1313. function PrevInitProc()
  1314. {
  1315. this.OnEnter = ClearPreviousSearches;
  1316. xmlObj.load(g_prevSearchStore);
  1317. var html = "";
  1318. var doc = xmlObj.XMLDocument;
  1319. var docNode = doc.documentElement;
  1320. var nPrevSearches = docNode.childNodes.length;
  1321. var i, j;
  1322. if (nPrevSearches > 0)
  1323. {
  1324. for (i = 0; i < nPrevSearches; i++)
  1325. {
  1326. var searchNode = docNode.childNodes.item(i);
  1327. if (searchNode.nodeName == "PREVIOUSSEARCH")
  1328. {
  1329. var nFields = searchNode.childNodes.length;
  1330. var names = "";
  1331. var values = "";
  1332. var nameValuePairs = "";
  1333. var namesAdded = 0;
  1334. var valsAdded = 0;
  1335. for (j = 0; j < nFields; j++)
  1336. {
  1337. var nvnode = searchNode.childNodes.item(j);
  1338. if (nvnode.nodeName == "SEARCHFIELD")
  1339. {
  1340. var name = XML_GetAttribute(nvnode, "NAME");
  1341. var value = XML_GetAttribute(nvnode, "VALUE")
  1342. if (name != "")
  1343. {
  1344. if (namesAdded > 0)
  1345. {
  1346. names += ",";
  1347. }
  1348. namesAdded++;
  1349. names += name;
  1350. if (value != "")
  1351. {
  1352. if (valsAdded > 0)
  1353. {
  1354. values += ",";
  1355. }
  1356. valsAdded++;
  1357. values += value;
  1358. value = "\"" + escape(value) + "\"";
  1359. }
  1360. else
  1361. {
  1362. value = "\"\"";
  1363. }
  1364. nameValuePairs += " " + name + "=" + value;
  1365. }
  1366. }
  1367. }
  1368. var panelID = XML_GetAttribute(searchNode, "PANELID");
  1369. var block = XML_GetAttribute(searchNode, "BLOCK");
  1370. var opt = GetOption(panelID);
  1371. if ((null != opt) && (valsAdded > 0))
  1372. {
  1373. var lbl = eval(opt.lbl);
  1374. if (lbl != null)
  1375. {
  1376. var toolTip = eval(lbl).innerText;
  1377. var thisId = "prevSearch" + i;
  1378. var itemHTML;
  1379. itemHTML = "<li class=indent id=" + thisId + " " + "panelID=" + panelID + " block=" + block;
  1380. itemHTML += " names=" + names + nameValuePairs + "><a href='javascript:RunPreviousSearch(" + thisId + ")' title=\"" + toolTip + "\">" + values + "</a><br>"
  1381. html += itemHTML;
  1382. }
  1383. }
  1384. }
  1385. }
  1386. }
  1387. if (html != "")
  1388. {
  1389. btnClearPrevSearches.disabled = false;
  1390. }
  1391. else
  1392. {
  1393. btnClearPrevSearches.disabled = true;
  1394. html = GetEmptyPrevSearchText();
  1395. }
  1396. spanSearchPrev.innerHTML = html;
  1397. }
  1398. function GetEmptyPrevSearchText()
  1399. {
  1400. var L_EmptyPrevSearch_Text = "There are no saved searches";
  1401. return "<span style='font-weight:bold;'>" + L_EmptyPrevSearch_Text + "</span>"
  1402. }
  1403. function RunPreviousSearch(item)
  1404. {
  1405. var pnlObj = GetPanelObj(item.panelID);
  1406. if (null != pnlObj)
  1407. {
  1408. var names = item.names.split(",");
  1409. var values = new Array();
  1410. var i;
  1411. var n = names.length;
  1412. for (i = 0; i < n; i++)
  1413. {
  1414. var val = eval("item." + names[i]);
  1415. values[i] = val != "" ? unescape(val) : "";
  1416. }
  1417. pnlObj.InitProc();
  1418. pnlObj.SetNameValuePairs(names, values);
  1419. pnlObj.SetBlock(item.block);
  1420. pnlObj.SetupNextMenu();
  1421. pnlObj.RunEngineSearch(0);
  1422. }
  1423. }
  1424. function ClearPreviousSearches()
  1425. {
  1426. xmlObj.load(g_prevSearchStore);
  1427. var docNode = xmlObj.XMLDocument.documentElement;
  1428. var n = docNode.childNodes.length;
  1429. for (i = 0; i < n; i++)
  1430. {
  1431. docNode.removeChild(docNode.childNodes.item(0));
  1432. }
  1433. xmlObj.save(g_prevSearchStore);
  1434. btnClearPrevSearches.disabled = true;
  1435. spanSearchPrev.innerHTML = GetEmptyPrevSearchText();
  1436. }
  1437. </script>
  1438. <div class=searchPanel id=panel style="display:none" InitProc=PrevInitProc panelID=Prev>
  1439. <id id=idPrevSearches>You've run the following searches:</id><br>
  1440. <br>
  1441. <ul>
  1442. <span ID=spanSearchPrev>
  1443. </span>
  1444. </ul>
  1445. <table width=100% cellspacing=0 cellpadding=0 class=searchTable>
  1446. <tr>
  1447. <td class=rightButton>
  1448. <input type=button id=idBtnClearSearches onclick=OnEnter() value="Clear" title="Clear previous searches" name=btnClearPrevSearches></span>
  1449. </td>
  1450. </tr>
  1451. </table>
  1452. </div>
  1453. <!-- Shell searches -->
  1454. <object id=DocFindOC height=0 width=0 classid="clsid:B005E690-678D-11d1-B758-00A0C90564FE"></object>
  1455. <object id=ShellOC height=0 width=0 classid="clsid:13709620-C279-11CE-A49E-444553540000"></object>
  1456. <script defer>
  1457. // Shell search helpers
  1458. var g_fShellSearchInProgress = false;
  1459. var g_btnHandler = null;
  1460. </script>
  1461. <script language="javascript" for="DocFindOC" event="SearchStart">
  1462. g_fShellSearchInProgress = true;
  1463. g_btnHandler();
  1464. </script>
  1465. <script language="javascript" for="DocFindOC" event="SearchAbort">
  1466. g_fShellSearchInProgress = false;
  1467. g_btnHandler();
  1468. </script>
  1469. <script language="javascript" for="DocFindOC" event="SearchComplete">
  1470. g_fShellSearchInProgress = false;
  1471. g_btnHandler();
  1472. </script>
  1473. <!-- Files and Folders -->
  1474. <script defer>
  1475. function FilesInitProc()
  1476. {
  1477. this.OnEnter = FindFilesAndFolders;
  1478. }
  1479. function FilesBtnHandler()
  1480. {
  1481. if (g_fShellSearchInProgress)
  1482. {
  1483. formFiles.btnFilesStartSearch.disabled = true;
  1484. }
  1485. else
  1486. {
  1487. formFiles.btnFilesStartSearch.disabled = false;
  1488. }
  1489. formFiles.btnFilesStopSearch.disabled = !formFiles.btnFilesStartSearch.disabled;
  1490. }
  1491. function FindFilesAndFolders()
  1492. {
  1493. g_btnHandler = FilesBtnHandler;
  1494. if (!g_fShellSearchInProgress)
  1495. {
  1496. var searchFor = formFiles.txtFilesSearch.value;
  1497. var lookIn = formFiles.txtFilesLookIn.String;
  1498. if (searchFor != "")
  1499. {
  1500. DocFindOC.SearchFor(0);
  1501. DocFindOC.AddConstraint("SearchFor", searchFor);
  1502. DocFindOC.AddConstraint("LookIn", lookIn);
  1503. DocFindOC.Execute();
  1504. }
  1505. }
  1506. else
  1507. {
  1508. DocFindOC.Execute();
  1509. }
  1510. }
  1511. function FilesAdvanced()
  1512. {
  1513. // show files and folders desk band:
  1514. var bShow = true ;
  1515. shOC.ShowBrowserBar("{C4EE31F3-4768-11D2-BE5C-00A0C9A83DA1}", bShow ) ;
  1516. }
  1517. </script>
  1518. <div class=searchPanel id=panel style="display:none" panelID=Files flags="PNL_SHELL"
  1519. srchflds="txtFilesSearch,txtFilesLookIn" InitProc=FilesInitProc>
  1520. <form id=formFiles onsubmit="FindFilesAndFolders();return false;">
  1521. <id id=idFilesSearch>Search For Files or Folders:</id><br>
  1522. <input class=text name=SearchText size=26 id=txtFilesSearch><br>
  1523. <id id=idFilesLookIn>Look In:</id><br>
  1524. <object classid="clsid:71D90AE1-A4BF-11d1-923E-006097DF5BD4" WIDTH="180px" HEIGHT="25px" id=txtFilesLookIn style="position:relative; left:-1pt">
  1525. <param name="AutoComplete In File System" value="1">
  1526. <param name="Enable Edit" value="1">
  1527. <param name="Persist String" value="Last Search Folder">
  1528. </object><br>
  1529. <input type=submit id=btnFilesStartSearch value=Search title="Start Searching">
  1530. <input type=submit id=btnFilesStopSearch value=Stop title="Begin a new search" disabled=true>
  1531. <br>
  1532. <id id=idFilesAdvanced>You can do a more <a href="javascript:FilesAdvanced()">detailed search</a> by file contents, date, type, or size.</id>
  1533. </form>
  1534. </div>
  1535. <!-- Printers -->
  1536. <script defer>
  1537. function PrinterInitProc()
  1538. {
  1539. this.OnEnter = FindPrinter;
  1540. }
  1541. function FindPrinter()
  1542. {
  1543. ShellOC.FindPrinter(formPrinter.txtPrinterName.value, formPrinter.txtPrinterLoc.value, formPrinter.txtPrinterModel.value);
  1544. }
  1545. </script>
  1546. <div class=searchPanel id=panel style="display:none" panelID=Printer flags="PNL_SHELL"
  1547. srchflds="txtPrinterName,txtPrinterLoc,txtPrinterModel" InitProc=PrinterInitProc>
  1548. <form id=formPrinter onsubmit="FindPrinter();return false;">
  1549. <id id=idPrinterName>Name:</id><br>
  1550. <input type=text name=PrinterName id=txtPrinterName class=inputs><br>
  1551. <id id=idPrinterLocation>Location:</id><br>
  1552. <input type=text name=PrinterLoc id=txtPrinterLoc class=inputs><br>
  1553. <id id=idPrinterModel>Model:</id><br>
  1554. <input type=text name=PrinterModel id=txtPrinterModel class=inputs><br>
  1555. <input type=submit id=btnPrinterStartSearch value=Search title="Start Searching">
  1556. </form>
  1557. </div>
  1558. <!-- Computers -->
  1559. <script defer>
  1560. function ComputerInitProc()
  1561. {
  1562. this.OnEnter = FindComputer;
  1563. }
  1564. function ComputerBtnHandler()
  1565. {
  1566. if (g_fShellSearchInProgress)
  1567. {
  1568. formComputer.btnComputerStartSearch.disabled = true;
  1569. }
  1570. else
  1571. {
  1572. formComputer.btnComputerStartSearch.disabled = false;
  1573. }
  1574. formComputer.btnComputerStopSearch.disabled = !formComputer.btnComputerStartSearch.disabled;
  1575. }
  1576. function FindComputer()
  1577. {
  1578. g_btnHandler = ComputerBtnHandler;
  1579. if (!g_fShellSearchInProgress)
  1580. {
  1581. var computerName = formComputer.txtComputerName.value;
  1582. if (computerName != "")
  1583. {
  1584. DocFindOC.SearchFor(1);
  1585. DocFindOC.AddConstraint("SearchFor", computerName);
  1586. DocFindOC.Execute();
  1587. }
  1588. }
  1589. else
  1590. {
  1591. DocFindOC.Execute();
  1592. }
  1593. }
  1594. </script>
  1595. <div class=searchPanel id=panel style="display:none" panelID=Computer flags="PNL_SHELL"
  1596. srchflds="txtComputerName" InitProc=FindComputer>
  1597. <form id=formComputer onsubmit="FindComputer();return false;">
  1598. <id id=idComputerSearch>Search for:</id><br>
  1599. <input type=text name=ComputerName id=txtComputerName class=inputs><br>
  1600. <input type=submit id=btnComputerStartSearch value=Search title="Start Searching">
  1601. <input type=submit id=btnComputerStopSearch value=Stop title="Begin a new search" disabled=true>
  1602. </form>
  1603. </div>
  1604. <!-- Custom Folder -->
  1605. <script defer>
  1606. </script>
  1607. <div class=searchPanel id=panel style="display:none" panelID=Custom flags="PNL_SHELL">
  1608. <form id=formCustom onsubmit="return false;">
  1609. <id id=idCustomSearch>Custom search goes here!</id>
  1610. <iframe id="iframeCustom" src="about:blank"></iframe>
  1611. </form>
  1612. </div>
  1613. </div>
  1614. </basefont>
  1615. </body>
  1616. </html>