home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / Chip_2001-05_cd2.bin / ChipCD / browsery / msie6_beta / iew2k_3.cab / shdoclc.dll / HTML / PREVIEW.DLG < prev    next >
Encoding:
Text File  |  2000-11-13  |  40.6 KB  |  1,672 lines

  1. <HTML XMLNS:IE>
  2. <HEAD>
  3. <?IMPORT namespace="ie" implementation="#default">
  4. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  5. <TITLE>Print Preview</TITLE>
  6. <STYLE>
  7. .divPage
  8. {
  9. position: absolute;
  10. top: -20000px;
  11. border-left: 1 solid black;
  12. border-top: 1 solid black;
  13. border-right: 4 solid black;
  14. border-bottom: 4 solid black;
  15. }
  16. .page
  17. {
  18. background: white;
  19. width: 8.5in;
  20. height: 11in;
  21. margin: 0px;
  22. overflow: hidden;
  23. }
  24. .mRect
  25. {
  26. position: absolute;
  27. margin: 1in;
  28. width: 6.5in;
  29. height: 9in;
  30. border: none;
  31. overflow : hidden;
  32. }
  33. .divHead
  34. {
  35. position: absolute;
  36. overflow: hidden;
  37. top: 0in;
  38. left: 0in;
  39. width: 8.5in;
  40. }
  41. .divFoot
  42. {
  43. position: absolute;
  44. overflow: hidden;
  45. bottom: 0in;
  46. left: 0in;
  47. width: 8.5in;
  48. }
  49. BODY { overflow: hidden; padding: 0; margin: 0; background: threedface; }
  50. TABLE { margin: 0px; padding: 0px; background: threedface; }
  51. .THeader { border: none; background: white; color: black; }
  52. .TFooter { border: none; background: white; color: black; }
  53. TD { padding: 0; margin: 0; border: none; }
  54. TD.UIPane { width: 20px; border: none; font-family: 'ms sans serif'; font-size: 8pt; }
  55. TD.UISeparator { width: 1px; border-left: 2px threedhighlight ridge; }
  56. BUTTON { border: 1px solid threedface; background: threedface; font-family: 'ms sans serif'; font-size: 8pt; color: buttontext;}
  57. </STYLE>
  58. <SCRIPT DEFER>
  59. var g_aDocTree = new Object();
  60. var g_nDispPage = -1;
  61. var g_nZoomFactor = 0;
  62. var g_cLeftToPrint = 0;
  63. var g_fRTL;
  64. var g_fPreview;
  65. var g_nMarginTop = 0;
  66. var g_nMarginBottom = 0;
  67. var g_nMarginLeft = 0;
  68. var g_nMarginRight = 0;
  69. var g_nPageWidth = 0;
  70. var g_nPageHeight = 0;
  71. var g_nUnprintTop = 0;
  72. var g_nUnprintBottom = 0;
  73. var g_strHeader = "";
  74. var g_strFooter = "";
  75. var g_fTableOfLinks = false;
  76. var g_cPagesDisplayed = 0;
  77. var g_cxDisplaySlots = 1;
  78. var g_cyDisplaySlots = 1;
  79. var g_imgUnderMouse = null;
  80. var g_nFramesetLayout = 0;
  81. var g_strActiveFrame = null;
  82. var g_nTotalPages = 0;
  83. var g_nDocsToCalc = 0;
  84. var g_nFramesLeft = 0;
  85. function GetRuleFromSelector(strSelector)
  86. {
  87. var i;
  88. var oRule;
  89. var oSS = document.styleSheets[0];
  90. for (i=0;;i++)
  91. {
  92. oRule = oSS.rules[i];
  93. if (oRule == null)
  94. break;
  95. if (oRule.selectorText == strSelector)
  96. break;
  97. }
  98. return oRule;
  99. }
  100. function UnprintableURL(strLink)
  101. {
  102. var fUnprintable = false;
  103. var cIndex;
  104. cIndex = strLink.indexOf(":");
  105. switch (cIndex)
  106. {
  107. case 4:
  108. if (strLink.substr(0, cIndex) == "news")
  109. fUnprintable = true;
  110. break;
  111. case 5:
  112. if (strLink.substr(0, cIndex) == "snews")
  113. fUnprintable = true;
  114. break;
  115. case 6:
  116. if ( strLink.substr(0, cIndex) == "telnet"
  117. || strLink.substr(0, cIndex) == "mailto")
  118. fUnprintable = true;
  119. break;
  120. case 8:
  121. if (strLink.substr(0,cIndex) == "vbscript")
  122. fUnprintable = true;
  123. break;
  124. case 10:
  125. if (strLink.substr(0,cIndex) == "javascript")
  126. fUnprintable = true;
  127. break;
  128. }
  129. return fUnprintable;
  130. }
  131. function OnKeyPress()
  132. {
  133. if (event.keyCode == 27)
  134. {
  135. Close();
  136. }
  137. }
  138. function OnKeyDown()
  139. {
  140. if (event.altKey)
  141. {
  142. switch (event.keyCode)
  143. {
  144. case 37:
  145. ChangeDispPage(g_nDispPage-1);
  146. break;
  147. case 39:
  148. ChangeDispPage(g_nDispPage+1);
  149. break;
  150. case 107:
  151. case 187:
  152. HandleZoom(-1);
  153. break;
  154. case 109:
  155. case 189:
  156. HandleZoom(1);
  157. break;
  158. case 35:
  159. HandleLastPage();
  160. break;
  161. case 36:
  162. HandleFirstPage();
  163. break;
  164. }
  165. }
  166. }
  167. function ShowHelp()
  168. {
  169. window.showHelp("iexplore.chm::/print_preview.htm");
  170. }
  171. function AttachDialogEvents()
  172. {
  173. butPrint.onclick = HandlePrintClick;
  174. butPageSetup.onclick = HandlePageSetup;
  175. butFirstPage.onclick = HandleFirstPage;
  176. butBackPage.onclick = HandleBackPage;
  177. butNextPage.onclick = HandleForwardPage;
  178. butLastPage.onclick = HandleLastPage;
  179. butZoomIn.onclick = HandleZoomInButton;
  180. butZoomOut.onclick = HandleZoomOutButton;
  181. butClose.onclick = Close;
  182. butHelp.onclick = ShowHelp;
  183. document.onhelp = ShowHelp;
  184. butPrint.onmousedown = buttonDown;
  185. butPageSetup.onmousedown = buttonDown;
  186. butFirstPage.onmousedown = buttonDown;
  187. butBackPage.onmousedown = buttonDown;
  188. butNextPage.onmousedown = buttonDown;
  189. butLastPage.onmousedown = buttonDown;
  190. butZoomIn.onmousedown = buttonDown;
  191. butZoomOut.onmousedown = buttonDown;
  192. butClose.onmousedown = buttonDown;
  193. butHelp.onmousedown = buttonDown;
  194. printCtl.onmouseover = buttonOver;
  195. printCtl.onmouseout = buttonOut;
  196. begin.onmouseover = buttonOver;
  197. begin.onmouseout = buttonOut;
  198. prev.onmouseover = buttonOver;
  199. prev.onmouseout = buttonOut;
  200. next.onmouseover = buttonOver;
  201. next.onmouseout = buttonOut;
  202. end.onmouseover = buttonOver;
  203. end.onmouseout = buttonOut;
  204. zoomIn.onmouseover = buttonOver;
  205. zoomIn.onmouseout = buttonOut;
  206. zoomOut.onmouseover = buttonOver;
  207. zoomOut.onmouseout = buttonOut;
  208. butPrint.onmouseover = new Function("buttonRaise(this);");
  209. butPrint.onmouseout = new Function("buttonLower(this);");
  210. butClose.onmouseover = new Function("buttonRaise(this);");
  211. butClose.onmouseout = new Function("buttonLower(this);");
  212. butHelp.onmouseover = new Function("buttonRaise(this);");
  213. butHelp.onmouseout = new Function("buttonLower(this);");
  214. inputPageNum.onkeypress = HandleInputKeyPress;
  215. inputPageNum.onchange = HandlePageSelect;
  216. selectZoom.onchange = HandleZoomSelect;
  217. selectFrameset.onchange = HandleFramesetSelect;
  218. window.onresize = OnResizeBody;
  219. window.onerror = HandleError;
  220. window.onfocus = new Function("MasterContainer.focus()");
  221. document.body.onkeypress = OnKeyPress;
  222. document.body.onkeydown = OnKeyDown;
  223. }
  224. function OnLoadBody()
  225. {
  226. g_fRTL = (document.body.currentStyle.direction.toLowerCase() == "rtl");
  227. g_fPreview = dialogArguments.__IE_PrintType == "Preview";
  228. if (UnprintableURL(dialogArguments.__IE_ContentDocumentUrl))
  229. {
  230. var L_Invalid_Text = "Unable to print URL. Please navigate directly to this page and select Print.";
  231. alert(L_Invalid_Text);
  232. window.close();
  233. }
  234. var str;
  235. str = begin.src;
  236. begin.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
  237. str = end.src;
  238. end.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
  239. str = next.src;
  240. next.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
  241. str = prev.src;
  242. prev.base = str.slice(str.lastIndexOf("/")+1,str.indexOf("_"));
  243. ChangeZoom(75);
  244. if (dialogArguments.__IE_HeaderString)
  245. Printer.header = dialogArguments.__IE_HeaderString
  246. if (dialogArguments.__IE_FooterString)
  247. Printer.footer = dialogArguments.__IE_FooterString
  248. EnsureDocuments();
  249. window.document.body.style.cursor="wait";
  250. CreateDocument("document", "C", true);
  251. HandleFirstPage();
  252. g_nFramesLeft = 1;
  253. OnBuildAllFrames("C");
  254. if (g_fPreview)
  255. {
  256. AttachDialogEvents();
  257. OverflowContainer.style.top = idDivToolbar.offsetHeight;
  258. OverflowContainer.style.height = document.body.clientHeight - idDivToolbar.offsetHeight;
  259. }
  260. else
  261. {
  262. PrintNow(dialogArguments.__IE_PrintType == "Prompt");
  263. }
  264. }
  265. function BuildAllFramesComplete()
  266. {
  267. ;
  268. window.document.body.style.cursor="auto";
  269. UpdateFramesetSelect();
  270. }
  271. function CalcDocsComplete()
  272. {
  273. ;
  274. if (g_nFramesetLayout == 2)
  275. {
  276. ChangeFramesetLayout(g_nFramesetLayout, true)
  277. }
  278. }
  279. function OnResizeBody()
  280. {
  281. OverflowContainer.style.height = Math.max(0, document.body.clientHeight - idDivToolbar.offsetHeight);
  282. HandleDynamicZoom();
  283. PositionPages(g_nDispPage);
  284. }
  285. function HandleError(message, url, line)
  286. {
  287. var L_Internal_ErrorMessage = "There was an internal error, and Internet Explorer is unable to print this document.";
  288. alert(L_Internal_ErrorMessage);
  289. window.close();
  290. return true;
  291. }
  292. function OnRectComplete( strDoc )
  293. {
  294. if (!g_aDocTree[strDoc])
  295. {
  296. HandleError("Document " + strDoc + " does not exist.", document.URL, "OnRectComplete");
  297. return;
  298. }
  299. window.setTimeout("OnRectCompleteNext('" + strDoc + "', " + event.contentOverflow + ",'" + event.srcElement.id + "');", 25);
  300. }
  301. function OnRectCompleteNext( strDoc, fOverflow, strElement)
  302. {
  303. g_aDocTree[strDoc].RectComplete(fOverflow, strElement);
  304. }
  305. function enableButton(btn, img)
  306. {
  307. btn.disabled = false;
  308. if (g_imgUnderMouse == img)
  309. {
  310. img.src = img.base + "_hilite.gif";
  311. buttonRaise(btn);
  312. }
  313. else
  314. {
  315. img.src = img.base + ".gif";
  316. buttonLower(btn);
  317. }
  318. }
  319. function disableButton(btn, img)
  320. {
  321. btn.disabled = true;
  322. buttonLower(btn);
  323. if (img != null)
  324. {
  325. img.src = img.base + "_inactive.gif";
  326. }
  327. }
  328. function updateNavButtons()
  329. {
  330. if (g_nDispPage == 1)
  331. {
  332. disableButton(butFirstPage, begin);
  333. disableButton(butBackPage, prev);
  334. }
  335. else
  336. {
  337. enableButton(butFirstPage, begin);
  338. enableButton(butBackPage, prev);
  339. }
  340. if (TotalDisplayPages() - g_nDispPage < g_cxDisplaySlots * g_cyDisplaySlots)
  341. {
  342. disableButton(butNextPage, next);
  343. disableButton(butLastPage, end);
  344. }
  345. else
  346. {
  347. enableButton(butNextPage, next);
  348. enableButton(butLastPage, end);
  349. }
  350. }
  351. function updateZoomButtons()
  352. {
  353. var fZoomOutDisabled = false;
  354. var fZoomInDisabled = false;
  355. var oOptions = selectZoom.options;
  356. if (g_nZoomFactor >= parseInt(oOptions[0].value))
  357. {
  358. disableButton(butZoomIn, null);
  359. zoomIn.src = "zoom_inactive.gif";
  360. fZoomInDisabled = true;
  361. }
  362. else if (g_nZoomFactor <= parseInt(oOptions[oOptions.length-1-3].value))
  363. {
  364. disableButton(butZoomOut, null);
  365. zoomOut.src = "zoom_inactive.gif";
  366. fZoomOutDisabled = true;
  367. }
  368. if (!fZoomOutDisabled)
  369. {
  370. enableButton(butZoomOut, zoomOut);
  371. }
  372. if (!fZoomInDisabled)
  373. {
  374. enableButton(butZoomIn, zoomIn);
  375. }
  376. }
  377. function UpdateFramesetSelect()
  378. {
  379. if ( g_aDocTree["C"]._fFrameset )
  380. {
  381. if (!g_strActiveFrame)
  382. {
  383. selectFrameset.options.remove(1);
  384. }
  385. separatorFrameset.style.display = "inline";
  386. cellFrameset.style.display = "inline";
  387. }
  388. }
  389. function getPageWidth()
  390. {
  391. return g_aDocTree["C"].Page(1).offsetWidth;
  392. }
  393. function getPageHeight()
  394. {
  395. return g_aDocTree["C"].Page(1).offsetHeight;
  396. }
  397. function UndisplayPages()
  398. {
  399. while (g_cPagesDisplayed > 0)
  400. {
  401. var oPage = DisplayPage(g_nDispPage + g_cPagesDisplayed - 1);
  402. if (oPage != null)
  403. {
  404. oPage.style.top = "-20000px";
  405. if (g_fRTL)
  406. oPage.style.right = "10px";
  407. else
  408. oPage.style.left = "10px";
  409. }
  410. g_cPagesDisplayed--;
  411. }
  412. }
  413. function PositionPages(nDispPage)
  414. {
  415. var strDispDoc = DisplayDocument(nDispPage);
  416. if ( g_aDocTree != null
  417. && g_aDocTree[strDispDoc] != null
  418. && g_aDocTree[strDispDoc].Pages() > 0)
  419. {
  420. UndisplayPages();
  421. var xPageWidth = getPageWidth();
  422. var yPageHeight = getPageHeight();
  423. var nMaxPage = TotalDisplayPages();
  424. g_cxDisplaySlots = Math.max(1, Math.floor((OverflowContainer.offsetWidth*100)/(g_nZoomFactor*(xPageWidth+10))));
  425. g_cyDisplaySlots = Math.max(1, Math.floor((OverflowContainer.offsetHeight*100)/(g_nZoomFactor*(yPageHeight+10))));
  426. var nMaxPageRequest = Math.max(nMaxPage - g_cxDisplaySlots * g_cyDisplaySlots + 1, 1);
  427. if ( nDispPage < 1 )
  428. nDispPage = 1;
  429. else if (nDispPage > nMaxPageRequest)
  430. nDispPage = nMaxPageRequest;
  431. g_nDispPage = nDispPage;
  432. document.all.spanPageTotal.innerText = nMaxPage;
  433. document.all.inputPageNum.value = g_nDispPage;
  434. updateNavButtons();
  435. var xDisplaySlot = 1;
  436. var yDisplaySlot = 1;
  437. var iPage = g_nDispPage;
  438. g_cPagesDisplayed = 0;
  439. while (iPage <= nMaxPage && yDisplaySlot <= g_cyDisplaySlots)
  440. {
  441. var xPos = xDisplaySlot*10 + (xDisplaySlot-1)*xPageWidth;
  442. var yPos = yDisplaySlot*10 + (yDisplaySlot-1)*yPageHeight;
  443. var oPage = DisplayPage(iPage);
  444. if (g_fRTL)
  445. oPage.style.right = xPos;
  446. else
  447. oPage.style.left = xPos;
  448. oPage.style.top = yPos;
  449. iPage++;
  450. if (++xDisplaySlot > g_cxDisplaySlots)
  451. {
  452. xDisplaySlot = 1;
  453. yDisplaySlot++;
  454. }
  455. g_cPagesDisplayed++;
  456. }
  457. }
  458. }
  459. function ChangeDispPage(nDispPageNew)
  460. {
  461. if (isNaN(nDispPageNew))
  462. {
  463. inputPageNum.value = g_nDispPage;
  464. }
  465. else
  466. {
  467. if (nDispPageNew < 1)
  468. nDispPageNew = 1;
  469. else if (nDispPageNew > TotalDisplayPages())
  470. nDispPageNew = TotalDisplayPages();
  471. OverflowContainer.scrollTop = 0;
  472. PositionPages(nDispPageNew);
  473. }
  474. return g_nDispPage;
  475. }
  476. function DisplayDocument(nWhichPage)
  477. {
  478. switch (g_nFramesetLayout)
  479. {
  480. case 0:
  481. return "C";
  482. break;
  483. case 1:
  484. return g_strActiveFrame;
  485. break;
  486. case 2:
  487. var i;
  488. if (!nWhichPage)
  489. return null;
  490. ;
  491. for (i in g_aDocTree)
  492. {
  493. if ( nWhichPage >= g_aDocTree[i]._nStartingPage
  494. && nWhichPage < (g_aDocTree[i]._nStartingPage + g_aDocTree[i].Pages()))
  495. return i;
  496. }
  497. default:
  498. HandleError("Display document cannot be found!", document.URL, "DisplayDocument");
  499. }
  500. }
  501. function TotalDisplayPages()
  502. {
  503. if (g_nFramesetLayout == 2)
  504. return g_nTotalPages;
  505. return g_aDocTree[DisplayDocument()].Pages();
  506. }
  507. function DisplayPage(nWhichPage)
  508. {
  509. ;
  510. if (g_nFramesetLayout != 2)
  511. return g_aDocTree[DisplayDocument(nWhichPage)].Page(nWhichPage);
  512. return g_aDocTree[DisplayDocument(nWhichPage)].Page(nWhichPage - g_aDocTree[DisplayDocument(nWhichPage)]._nStartingPage + 1);
  513. }
  514. function ChangeZoom(nNewVal)
  515. {
  516. if (nNewVal < 10)
  517. nNewVal = 10;
  518. else if (nNewVal > 1000)
  519. nNewVal = 1000;
  520. else if (isNaN(nNewVal))
  521. nNewVal = g_nZoomFactor;
  522. if (nNewVal != g_nZoomFactor)
  523. {
  524. MasterContainer.style.zoom = nNewVal + "%";
  525. g_nZoomFactor = nNewVal;
  526. updateZoomButtons();
  527. PositionPages(g_nDispPage);
  528. }
  529. return g_nZoomFactor;
  530. }
  531. function BuildTableOfLinks( docSource )
  532. {
  533. var aLinks = docSource.links;
  534. var nLinks = aLinks.length;
  535. if (nLinks > 0)
  536. {
  537. var fDuplicate;
  538. var i;
  539. var j;
  540. var newHTM;
  541. var docLinkTable = document.createElement("BODY");
  542. var L_LINKSHEADER1_Text = "Shortcut Text";
  543. var L_LINKSHEADER2_Text = "Internet Address";
  544. newHTM = "<CENTER><TABLE BORDER=1>";
  545. newHTM += "<THEAD style=\"display:table-header-group\"><TR><TH>"
  546. + L_LINKSHEADER1_Text
  547. + "</TH><TH>" + L_LINKSHEADER2_Text + "</TH></TR></THEAD><TBODY>";
  548. for (i = 0; i < nLinks; i++)
  549. {
  550. fDuplicate = false;
  551. for (j = 0; (!fDuplicate) && (j < i); j++)
  552. {
  553. if (aLinks[i].href == aLinks[j].href)
  554. fDuplicate = true;
  555. }
  556. if (!fDuplicate)
  557. newHTM += ("<TR><TD>" + aLinks[i].innerText + "</TD><TD>" + aLinks[i].href + "</TD></TR>");
  558. }
  559. newHTM += "</TBODY></TABLE></CENTER>";
  560. docLinkTable.innerHTML = newHTM;
  561. return docLinkTable.document;
  562. }
  563. return null;
  564. }
  565. function CreateDocument( docURL, strDocID, fUseStreamHeader )
  566. {
  567. if (g_aDocTree[strDocID])
  568. return;
  569. g_aDocTree[strDocID] = new CPrintDoc( strDocID, docURL );
  570. g_aDocTree[strDocID].InitDocument( fUseStreamHeader );
  571. }
  572. function ChangeFramesetLayout( nNewLayout, fForce )
  573. {
  574. if ( g_nFramesetLayout == nNewLayout
  575. && !fForce)
  576. return;
  577. UndisplayPages();
  578. g_nFramesetLayout = nNewLayout;
  579. switch ( nNewLayout )
  580. {
  581. case 0:
  582. case 1:
  583. break;
  584. case 2:
  585. g_nTotalPages = 0;
  586. for (i in g_aDocTree)
  587. {
  588. if ( g_aDocTree[i]._fFrameset
  589. || i == "S")
  590. g_aDocTree[i]._nStartingPage = 0;
  591. else
  592. {
  593. g_aDocTree[i]._nStartingPage = g_nTotalPages + 1;
  594. g_nTotalPages += g_aDocTree[i].Pages();
  595. }
  596. }
  597. break;
  598. default:
  599. HandleError("Impossible frameset layout type: " + nNewLayout, document.URL, "ChangeFramesetLayout");
  600. }
  601. ChangeDispPage(1);
  602. }
  603. function EnsureDocuments()
  604. {
  605. var i;
  606. var tmp;
  607. var top = Printer.marginTop / 100;
  608. var bottom = Printer.marginBottom / 100;
  609. var left = Printer.marginLeft / 100;
  610. var right = Printer.marginRight / 100;
  611. var pageWidth = Printer.pageWidth / 100;
  612. var pageHeight = Printer.pageHeight / 100;
  613. var linktable = Printer.tableOfLinks;
  614. var upTop = Printer.unprintableTop / 100;
  615. var upBottom = Printer.unprintableBottom / 100;
  616. var header = Printer.header;
  617. var footer = Printer.footer;
  618. if (header)
  619. {
  620. tmp = upTop + (27 / 100);
  621. if (tmp > top)
  622. top = tmp;
  623. }
  624. if (footer)
  625. {
  626. tmp = upBottom + (27 / 100);
  627. if (tmp > bottom)
  628. bottom = tmp;
  629. }
  630. if (upTop != g_nUnprintTop)
  631. {
  632. g_nUnprintTop = upTop;
  633. oRule = GetRuleFromSelector(".divHead");
  634. if (oRule == null)
  635. {
  636. HandleError("'.divHead' rule does not exist!", document.URL, "CPrintDoc::EnsureDocuments");
  637. }
  638. oRule.style.top = upTop + "in";
  639. }
  640. if (upBottom != g_nUnprintBottom)
  641. {
  642. g_nUnprintBottom= upBottom;
  643. oRule = GetRuleFromSelector(".divFoot");
  644. if (oRule == null)
  645. {
  646. HandleError("'.divFoot' rule does not exist!", document.URL, "CPrintDoc::EnsureDocuments");
  647. }
  648. oRule.style.bottom = upBottom + "in";
  649. }
  650. if ( top != g_nMarginTop
  651. || bottom != g_nMarginBottom
  652. || left != g_nMarginLeft
  653. || right != g_nMarginRight
  654. || pageWidth != g_nPageWidth
  655. || pageHeight != g_nPageHeight
  656. || header != g_strHeader
  657. || footer != g_strFooter )
  658. {
  659. var conWidth = pageWidth - left - right;
  660. var conHeight = pageHeight - top - bottom;
  661. var oStyleSheet = document.styleSheets[0];
  662. var oRule;
  663. if (conWidth < 0)
  664. conWidth = 0;
  665. if (conHeight < 0)
  666. conHeight = 0;
  667. UndisplayPages();
  668. g_nTotalPages = 0;
  669. g_nDocsToCalc = 0;
  670. for (i in g_aDocTree)
  671. {
  672. g_nDocsToCalc++;
  673. g_aDocTree[i].ResetDocument();
  674. }
  675. g_nMarginTop = top;
  676. g_nMarginBottom = bottom;
  677. g_nMarginLeft = left;
  678. g_nMarginRight = right;
  679. g_nPageWidth = pageWidth;
  680. g_nPageHeight = pageHeight;
  681. g_fTableofLinks = linktable;
  682. g_strHeader = header;
  683. g_strFooter = footer;
  684. HeadFoot.textHead = g_strHeader;
  685. HeadFoot.textFoot = g_strFooter;
  686. oRule = GetRuleFromSelector(".page");
  687. if (oRule == null)
  688. {
  689. HandleError("'.page' rule does not exist!", document.URL, "CPrintDoc::EnsureDocuments");
  690. }
  691. oRule.style.width = pageWidth + "in";
  692. oRule.style.height = pageHeight + "in";
  693. oRule = GetRuleFromSelector(".mRect");
  694. if (oRule == null)
  695. {
  696. HandleError("'.mRect' rule does not exist!", document.URL, "CPrintDoc::EnsureDocuments");
  697. }
  698. oRule.style.marginLeft = left + "in";
  699. oRule.style.marginRight = right + "in";
  700. oRule.style.marginTop = top + "in";
  701. oRule.style.marginBottom = bottom + "in";
  702. oRule.style.width = conWidth + "in";
  703. oRule.style.height = conHeight + "in";
  704. oRule = GetRuleFromSelector(".divHead");
  705. if (oRule == null)
  706. {
  707. HandleError("'.divHead' rule does not exist!", document.URL, "CPrintDoc::EnsureDocuments");
  708. }
  709. oRule.style.left = left + "in";
  710. oRule.style.width = conWidth + "in";
  711. oRule = GetRuleFromSelector(".divFoot");
  712. if (oRule == null)
  713. {
  714. HandleError("'.divHead' rule does not exist!", document.URL, "CPrintDoc::EnsureDocuments");
  715. }
  716. oRule.style.left = left + "in";
  717. oRule.style.width = conWidth + "in";
  718. for (i in g_aDocTree)
  719. {
  720. g_aDocTree[i].InitDocument((g_aDocTree[i]._anMerge[1] == 1));
  721. }
  722. if (g_nFramesetLayout == 2)
  723. ChangeFramesetLayout(g_nFramesetLayout, true);
  724. PositionPages(g_nDispPage);
  725. }
  726. else if (linktable != g_fTableOfLinks)
  727. {
  728. g_fTableOfLinks = linktable;
  729. for (i in g_aDocTree)
  730. {
  731. g_aDocTree[i].ResetTableOfLinks();
  732. }
  733. }
  734. }
  735. function buttonRaise( elem )
  736. {
  737. elem.style.borderStyle = "outset";
  738. elem.style.borderColor = "threedhighlight";
  739. }
  740. function buttonLower( elem )
  741. {
  742. elem.style.borderStyle = "solid";
  743. elem.style.borderColor = "threedface";
  744. }
  745. function buttonDepress(elem)
  746. {
  747. elem.style.borderStyle = "inset";
  748. elem.style.borderColor = "threedshadow";
  749. }
  750. function buttonOver()
  751. {
  752. var imgSrc = event.srcElement;
  753. g_imgUnderMouse = imgSrc;
  754. if (imgSrc == begin ||
  755. imgSrc == prev ||
  756. imgSrc == next ||
  757. imgSrc == end)
  758. {
  759. updateNavButtons();
  760. }
  761. else if (imgSrc == zoomIn ||
  762. imgSrc == zoomOut)
  763. {
  764. updateZoomButtons();
  765. }
  766. else
  767. {
  768. imgSrc.src= "" + imgSrc.id + "_hilite.gif";
  769. buttonRaise( imgSrc.parentNode );
  770. }
  771. }
  772. function buttonOut()
  773. {
  774. var imgSrc = event.srcElement;
  775. g_imgUnderMouse = null;
  776. if (imgSrc == begin ||
  777. imgSrc == prev ||
  778. imgSrc == next ||
  779. imgSrc == end)
  780. {
  781. updateNavButtons();
  782. }
  783. else if (imgSrc == zoomIn ||
  784. imgSrc == zoomOut)
  785. {
  786. updateZoomButtons();
  787. }
  788. else
  789. {
  790. imgSrc.src= "" + imgSrc.id + ".gif";
  791. buttonLower( imgSrc.parentNode );
  792. }
  793. }
  794. function buttonDown()
  795. {
  796. buttonDepress(event.srcElement);
  797. }
  798. function HandlePageSelect()
  799. {
  800. event.srcElement.value = ChangeDispPage(parseInt(inputPageNum.value));
  801. MasterContainer.focus();
  802. }
  803. function HandlePageSetup()
  804. {
  805. if (Printer.showPageSetupDialog())
  806. EnsureDocuments();
  807. }
  808. function HandleForwardPage()
  809. {
  810. ChangeDispPage(g_nDispPage + 1);
  811. MasterContainer.focus();
  812. }
  813. function HandleBackPage()
  814. {
  815. ChangeDispPage(g_nDispPage - 1);
  816. MasterContainer.focus();
  817. }
  818. function HandleFirstPage()
  819. {
  820. ChangeDispPage(1);
  821. MasterContainer.focus();
  822. }
  823. function HandleLastPage()
  824. {
  825. ChangeDispPage(TotalDisplayPages());
  826. MasterContainer.focus();
  827. }
  828. function NumericFromSpecialZoom(fnBounder)
  829. {
  830. var iMaxNumericZoom = selectZoom.options.length-1-3;
  831. var iBelow = -1;
  832. var nBelow = 0;
  833. var iAbove = iMaxNumericZoom + 1;
  834. var i;
  835. for (i = 0; i <= iMaxNumericZoom; i++)
  836. {
  837. var nThisIndex = parseInt(selectZoom.options[i].value);
  838. if (nThisIndex >= g_nZoomFactor)
  839. {
  840. iBelow = i;
  841. nBelow = nThisIndex;
  842. }
  843. else
  844. {
  845. break;
  846. }
  847. }
  848. if (nBelow > g_nZoomFactor)
  849. {
  850. iAbove = iBelow + 1;
  851. }
  852. else
  853. {
  854. iAbove = iBelow;
  855. }
  856. return fnBounder(iBelow, iAbove);
  857. }
  858. function HandleZoom(nZoomIndexDelta)
  859. {
  860. var iCurrZoom = selectZoom.selectedIndex;
  861. var iMaxNumericZoom = selectZoom.options.length-1-3;
  862. if (iCurrZoom > iMaxNumericZoom)
  863. {
  864. var fnRemapBounder = null;
  865. if (nZoomIndexDelta == 1)
  866. {
  867. fnRemapBounder = Math.min;
  868. }
  869. else
  870. {
  871. fnRemapBounder = Math.max;
  872. }
  873. iCurrZoom = NumericFromSpecialZoom(fnRemapBounder);
  874. }
  875. selectZoom.selectedIndex = Math.min(Math.max(0, iCurrZoom + nZoomIndexDelta), iMaxNumericZoom);
  876. ChangeZoom(parseInt(selectZoom.options[selectZoom.selectedIndex].value));
  877. }
  878. function HandleDynamicZoom()
  879. {
  880. var nZoomType = parseInt(selectZoom.options[selectZoom.selectedIndex].value);
  881. if (nZoomType < 0)
  882. {
  883. var nZoomFactor = 100;
  884. var xPageWidth = getPageWidth();
  885. switch (nZoomType)
  886. {
  887. case -1:
  888. nZoomFactor = Math.floor(((OverflowContainer.offsetWidth - 20) * 100) / xPageWidth);
  889. break;
  890. case -2:
  891. var xZoom = Math.floor(((OverflowContainer.offsetWidth - 20) * 100) / xPageWidth);
  892. var yZoom = Math.floor(((OverflowContainer.offsetHeight - 20) * 100) / getPageHeight());
  893. nZoomFactor = Math.min(xZoom, yZoom);
  894. break;
  895. case -3:
  896. nZoomFactor = Math.floor(((OverflowContainer.offsetWidth - 30) * 100) / (2 * xPageWidth));
  897. break;
  898. default:
  899. nZoomFactor = 100;
  900. break;
  901. }
  902. ChangeZoom(nZoomFactor);
  903. }
  904. }
  905. function HandleZoomSelect()
  906. {
  907. var nZoomFactor = parseInt(selectZoom.options[selectZoom.selectedIndex].value);
  908. if (nZoomFactor < 0)
  909. {
  910. HandleDynamicZoom();
  911. }
  912. else
  913. {
  914. ChangeZoom(nZoomFactor);
  915. }
  916. }
  917. function HandleFramesetSelect()
  918. {
  919. ChangeFramesetLayout(parseInt(selectFrameset.options[selectFrameset.selectedIndex].value), false);
  920. }
  921. function HandleZoomInButton()
  922. {
  923. HandleZoom(-1);
  924. MasterContainer.focus();
  925. }
  926. function HandleZoomOutButton()
  927. {
  928. HandleZoom(1);
  929. MasterContainer.focus();
  930. }
  931. function HandleInputKeyPress()
  932. {
  933. var keyStroke = event.keyCode;
  934. if (keyStroke == 13)
  935. {
  936. event.srcElement.onchange();
  937. }
  938. else if (keyStroke < 48 || keyStroke > 57)
  939. {
  940. event.returnValue = false;
  941. }
  942. }
  943. function Close()
  944. {
  945. Printer.updatePageStatus(-1);
  946. window.close();
  947. }
  948. function PrintAll()
  949. {
  950. var i;
  951. var nFirstDoc;
  952. if ( g_nFramesLeft > 0
  953. && Printer.framesetDocument
  954. && !Printer.frameAsShown )
  955. {
  956. window.setTimeout("PrintAll()", 100);
  957. return;
  958. }
  959. EnsureDocuments();
  960. if (Printer.copies <= 0)
  961. {
  962. Close();
  963. }
  964. else if ( Printer.selectedPages
  965. && Printer.pageFrom > Printer.pageTo )
  966. {
  967. var L_PAGERANGE_ErrorMessage = "The 'From' value cannot be greater than the 'To' value.";
  968. alert(L_PAGERANGE_ErrorMessage);
  969. ;
  970. if (!g_fPreview)
  971. PrintNow(true);
  972. }
  973. else
  974. {
  975. g_cLeftToPrint = 1;
  976. Printer.updatePageStatus(1);
  977. PrintSentinel(((Printer.selection)
  978. ? "S"
  979. : (Printer.frameActive && !!g_strActiveFrame)
  980. ? g_strActiveFrame
  981. : "C"),
  982. true);
  983. }
  984. }
  985. function PrintSentinel( strDoc, fRecursionOK )
  986. {
  987. if ( !g_aDocTree[strDoc]
  988. || !g_aDocTree[strDoc].ReadyToPrint() )
  989. {
  990. window.setTimeout("PrintSentinel('" + strDoc + "'," + fRecursionOK + ");", 500);
  991. return;
  992. }
  993. g_aDocTree[strDoc].Print(fRecursionOK);
  994. }
  995. function PrintDocumentComplete()
  996. {
  997. g_cLeftToPrint--;
  998. if (g_cLeftToPrint <= 0)
  999. {
  1000. Close();
  1001. }
  1002. }
  1003. function PrintNow( fWithPrompt)
  1004. {
  1005. if ( !g_aDocTree["C"]
  1006. || !g_aDocTree["C"]._aaRect[1][0]
  1007. || !g_aDocTree["C"]._aaRect[1][0].contentDocument.body)
  1008. {
  1009. window.setTimeout("PrintNow('" + fWithPrompt + "');", 100);
  1010. return;
  1011. }
  1012. var oDoc = g_aDocTree["C"]._aaRect[1][0].contentDocument;
  1013. var fConfirmed;
  1014. var fFramesetDocument = (oDoc.body.tagName.toUpperCase() == "FRAMESET");
  1015. var fActiveFrame = (oDoc.all.tags("HTML").item(0).__IE_ActiveFrame != null);
  1016. Printer.framesetDocument = fFramesetDocument;
  1017. Printer.frameActiveEnabled = fActiveFrame;
  1018. if (g_fPreview)
  1019. {
  1020. Printer.frameActive = (g_nFramesetLayout == 1);
  1021. Printer.frameAsShown = (g_nFramesetLayout == 0);
  1022. Printer.currentPageAvail = true;
  1023. }
  1024. else
  1025. {
  1026. Printer.frameActive = fActiveFrame;
  1027. Printer.frameAsShown = false;
  1028. Printer.currentPageAvail = false;
  1029. }
  1030. Printer.selectionEnabled = !!(dialogArguments.__IE_ContentSelectionUrl);
  1031. Printer.selection = g_fPreview ? false : Printer.selectionEnabled;
  1032. fConfirmed = (eval(fWithPrompt)) ? Printer.showPrintDialog() : Printer.ensurePrintDialogDefaults();
  1033. if ( fConfirmed )
  1034. {
  1035. if ( Printer.selection
  1036. && dialogArguments.__IE_ContentSelectionUrl )
  1037. {
  1038. CreateDocument(dialogArguments.__IE_ContentSelectionUrl, "S", true);
  1039. }
  1040. PrintAll();
  1041. }
  1042. else
  1043. {
  1044. if ( !g_fPreview )
  1045. {
  1046. Close();
  1047. }
  1048. else
  1049. {
  1050. }
  1051. }
  1052. }
  1053. function HandlePrintClick()
  1054. {
  1055. PrintNow(true, true);
  1056. }
  1057. function CPrintDoc_ReadyToPrint()
  1058. {
  1059. if ( this._nStatus == 4
  1060. && this._aaRect[1][0].contentDocument.readyState == "complete")
  1061. {
  1062. return true;
  1063. }
  1064. return false;
  1065. }
  1066. function CPrintDoc_Print( fRecursionOK )
  1067. {
  1068. if (!this.ReadyToPrint())
  1069. {
  1070. HandleError("Printing when not ready!", document.URL, "CPrintDoc::Print");
  1071. return;
  1072. }
  1073. var nCount = Printer.copies;
  1074. var nFrom;
  1075. var nTo;
  1076. ;
  1077. if (fRecursionOK)
  1078. {
  1079. var fFrameset = (this._aaRect[1][0].contentDocument.body.tagName.toUpperCase() == "FRAMESET");
  1080. if (Printer.frameActive)
  1081. {
  1082. var n = parseInt(this._aaRect[1][0].contentDocument.all.tags("HTML").item(0).__IE_ActiveFrame);
  1083. if (n >= 0)
  1084. {
  1085. var oTargetFrame = (fFrameset)
  1086. ? this._aaRect[1][0].contentDocument.all.tags("FRAME").item(n)
  1087. : this._aaRect[1][0].contentDocument.all.tags("IFRAME").item(n);
  1088. if ( oTargetFrame.src == "res://SHDOCLC.DLL/printnof.htm"
  1089. || oTargetFrame.src == "about:blank" )
  1090. {
  1091. Printer.printNonNativeFrames(this._aaRect[1][0].contentDocument, true);
  1092. }
  1093. else
  1094. {
  1095. this.CreateSubDocument(oTargetFrame.src);
  1096. this.PrintAllSubDocuments(true);
  1097. }
  1098. PrintDocumentComplete();
  1099. return;
  1100. }
  1101. }
  1102. if (fFrameset)
  1103. {
  1104. if (!Printer.frameAsShown)
  1105. {
  1106. this.PrintAllSubDocuments(true);
  1107. Printer.printNonNativeFrames(this._aaRect[1][0].contentDocument, false);
  1108. PrintDocumentComplete();
  1109. return;
  1110. }
  1111. else
  1112. {
  1113. Printer.printNonNativeFrames(this._aaRect[1][0].contentDocument, false);
  1114. }
  1115. }
  1116. else
  1117. {
  1118. if (Printer.allLinkedDocuments)
  1119. {
  1120. this.BuildAllLinkedDocuments();
  1121. this.PrintAllSubDocuments(false);
  1122. }
  1123. }
  1124. }
  1125. if (Printer.printNonNative(this._aaRect[1][0].contentDocument) )
  1126. {
  1127. PrintDocumentComplete();
  1128. return;
  1129. }
  1130. if (Printer.selectedPages)
  1131. {
  1132. nFrom = Printer.pageFrom;
  1133. nTo = Printer.pageTo;
  1134. if (nFrom < 1)
  1135. nFrom = 1;
  1136. if (nTo > this.Pages())
  1137. nTo = this.Pages();
  1138. }
  1139. else if ( Printer.currentPage
  1140. && this._strDoc == DisplayDocument())
  1141. {
  1142. nFrom = (this.Pages() >= g_nDispPage) ? g_nDispPage : this.Pages();
  1143. nTo = nFrom;
  1144. }
  1145. else
  1146. {
  1147. nFrom = 1;
  1148. nTo = this.Pages();
  1149. }
  1150. if (nTo < nFrom)
  1151. {
  1152. PrintDocumentComplete();
  1153. return;
  1154. }
  1155. ;
  1156. ;
  1157. ;
  1158. if (Printer.startDoc(this._aaRect[1][0].contentDocument.URL))
  1159. {
  1160. if (Printer.collate)
  1161. {
  1162. var fExtraPage = ( Printer.duplex
  1163. && ((nFrom - nTo) % 2 == 0) );
  1164. for (j = 0; j < nCount; j++)
  1165. {
  1166. for (i = nFrom; i <= nTo; i++)
  1167. {
  1168. Printer.printPage(this.Page(i).children[0]);
  1169. }
  1170. if (fExtraPage)
  1171. Printer.printBlankPage();
  1172. }
  1173. }
  1174. else
  1175. {
  1176. var fDuplex = Printer.duplex;
  1177. for (i = nFrom; i <= nTo; i++)
  1178. {
  1179. for (j = 0; j < nCount; j++)
  1180. {
  1181. Printer.printPage(this.Page(i).children[0]);
  1182. if (fDuplex)
  1183. {
  1184. if (i < nTo)
  1185. Printer.printPage(this.Page(i+1));
  1186. else
  1187. Printer.printBlankPage();
  1188. }
  1189. }
  1190. if (fDuplex)
  1191. i++;
  1192. }
  1193. }
  1194. Printer.stopDoc();
  1195. }
  1196. PrintDocumentComplete();
  1197. }
  1198. function CPrintDoc_RectComplete(fOverflow, strElement)
  1199. {
  1200. var nStatus = parseInt(strElement.substr(5,1));
  1201. var nPage = parseInt(strElement.substr(strElement.lastIndexOf("p") + 1));
  1202. ;
  1203. ;
  1204. if (nStatus > this._nStatus)
  1205. return false;
  1206. if (nPage != this._acPage[nStatus] - 1 + this._anMerge[nStatus])
  1207. return false;
  1208. if (nStatus != this._nStatus)
  1209. {
  1210. if (!fOverflow)
  1211. return false;
  1212. this.StopFixupHF();
  1213. if (this._nStatus == 4)
  1214. g_nDocsToCalc++;
  1215. this._nStatus = nStatus;
  1216. }
  1217. if (fOverflow)
  1218. {
  1219. this.AddPage();
  1220. }
  1221. else
  1222. {
  1223. switch (this._nStatus)
  1224. {
  1225. case 0:
  1226. this._nStatus = 1;
  1227. this.AddFirstPage();
  1228. this._aaRect[this._nStatus][0].contentSrc = this._strDocURL;
  1229. break;
  1230. case 1:
  1231. this._nStatus = 2;
  1232. this.AddTableOfLinks();
  1233. break;
  1234. case 2:
  1235. this._nStatus = 3;
  1236. if (this._strDoc == DisplayDocument())
  1237. ChangeDispPage(g_nDispPage);
  1238. this.FixupHF();
  1239. break;
  1240. }
  1241. }
  1242. if (this._strDoc == DisplayDocument())
  1243. {
  1244. spanPageTotal.innerText = this.Pages();
  1245. updateNavButtons();
  1246. }
  1247. }
  1248. function CPrintDoc_AddPage()
  1249. {
  1250. var newHTM = "";
  1251. var aPage = this._aaPage[this._nStatus];
  1252. var aRect = this._aaRect[this._nStatus];
  1253. ;
  1254. (this._acPage[this._nStatus])++;
  1255. HeadFoot.URL = this.EnsureURL();
  1256. HeadFoot.title = this.EnsureTitle();
  1257. HeadFoot.pageTotal = this.Pages();
  1258. HeadFoot.page = HeadFoot.pageTotal;
  1259. if (this._acPage[this._nStatus] <= aPage.length)
  1260. {
  1261. var oPage = aPage[this._acPage[this._nStatus] - 1];
  1262. oPage.children("header").innerHTML = HeadFoot.HtmlHead;
  1263. oPage.children("footer").innerHTML = HeadFoot.HtmlFoot;
  1264. }
  1265. else
  1266. {
  1267. newHTM = "<DIV class=divPage><IE:DeviceRect media=\"print\" class=page id=mDiv" + this._nStatus + this._strDoc + "p" + aPage.length + ">";
  1268. newHTM += "<IE:LayoutRect id=mRect" + this._nStatus + this._strDoc + "p" + aRect.length;
  1269. newHTM += " class=mRect nextRect=mRect" + this._nStatus + this._strDoc + "p" + (aRect.length + 1);
  1270. newHTM += " onlayoutcomplete=OnRectComplete('" + this._strDoc + "')";
  1271. newHTM += " tabindex=-1 onbeforefocusenter='event.returnValue=false;' ";
  1272. newHTM += " /><DIV class=divHead id=header>";
  1273. newHTM += HeadFoot.HtmlHead;
  1274. newHTM += "</DIV><DIV class=divFoot id=footer>";
  1275. newHTM += HeadFoot.HtmlFoot;
  1276. newHTM += " </DIV></IE:DeviceRect></DIV>";
  1277. MasterContainer.insertAdjacentHTML("beforeEnd", newHTM);
  1278. aPage[aPage.length] = eval( "document.all.mDiv" + this._nStatus + this._strDoc + "p" + aPage.length);
  1279. aRect[aRect.length] = eval("document.all.mRect" + this._nStatus + this._strDoc + "p" + aRect.length);
  1280. }
  1281. }
  1282. function CPrintDoc_AddFirstPage()
  1283. {
  1284. this._acPage[this._nStatus] = 0;
  1285. if (this._anMerge[this._nStatus] == 0)
  1286. {
  1287. this.AddPage();
  1288. }
  1289. else
  1290. {
  1291. var aRect = this._aaRect[this._nStatus];
  1292. var oPage = this._aaPage[this._nStatus - 1][this._acPage[this._nStatus - 1] - 1];
  1293. var oTop = this._aaRect[this._nStatus - 1][this._acPage[this._nStatus - 1] + this._anMerge[this._nStatus - 1] - 1];
  1294. var nTop = oTop.offsetTop + oTop.scrollHeight;
  1295. var nHeight = oTop.clientHeight - oTop.scrollHeight;
  1296. ;
  1297. ;
  1298. if (aRect.length > 0)
  1299. {
  1300. var oNode = aRect[0];
  1301. oNode.style.marginTop = nTop + "px";
  1302. oNode.style.pixelHeight = nHeight;
  1303. if (oNode.parentElement != oPage)
  1304. oPage.insertBefore(oNode);
  1305. }
  1306. else
  1307. {
  1308. var newHTM;
  1309. var oNode;
  1310. newHTM = "<IE:LayoutRect id=mRect" + this._nStatus + this._strDoc + "p0";
  1311. newHTM += " class=mRect nextRect=mRect" + this._nStatus + this._strDoc + "p1";
  1312. newHTM += " onlayoutcomplete=OnRectComplete('" + this._strDoc + "')";
  1313. newHTM += " tabindex=-1 onbeforefocus='event.returnValue=false;' />";
  1314. oPage.insertAdjacentHTML("beforeEnd", newHTM);
  1315. oNode = eval("document.all.mRect" + this._nStatus + this._strDoc + "p0");
  1316. aRect[0] = oNode;
  1317. oNode.style.marginTop = nTop + "px";
  1318. oNode.style.height = nHeight + "px";
  1319. }
  1320. }
  1321. }
  1322. function CPrintDoc_InitDocument( fUseStreamHeader )
  1323. {
  1324. var fReallyUseStreamHeader = (fUseStreamHeader && (dialogArguments.__IE_OutlookHeader != null));
  1325. this._anMerge[1] = (fReallyUseStreamHeader) ? 1 : 0;
  1326. this._nStatus = (fReallyUseStreamHeader) ? 0 : 1;
  1327. this.AddFirstPage();
  1328. this._aaRect[this._nStatus][0].contentSrc = (fReallyUseStreamHeader)
  1329. ? dialogArguments.__IE_OutlookHeader
  1330. : this._strDocURL;
  1331. }
  1332. function CPrintDoc_PrintAllSubDocuments( fRecursionOK )
  1333. {
  1334. if (!this._aDoc)
  1335. return;
  1336. var nDocs = this._aDoc.length;
  1337. var i;
  1338. g_cLeftToPrint += nDocs;
  1339. for (i = 0; i < nDocs; i++)
  1340. {
  1341. PrintSentinel(this._aDoc[i]._strDoc, fRecursionOK);
  1342. }
  1343. }
  1344. function CPrintDoc_BuildAllLinkedDocuments()
  1345. {
  1346. var strURL = this._aaRect[1][0].contentDocument.URL;
  1347. var aLinks = this._aaRect[1][0].contentDocument.links;
  1348. var nLinks = aLinks.length;
  1349. var i;
  1350. var j;
  1351. var strLink;
  1352. for (i = 0; i < nLinks; i++)
  1353. {
  1354. strLink = aLinks[i].href;
  1355. if ( (strURL == strLink)
  1356. || UnprintableURL(strLink) )
  1357. continue;
  1358. for (j = 0; j < i; j++)
  1359. {
  1360. if (strLink == aLinks[j].href)
  1361. break;
  1362. }
  1363. if (j < i)
  1364. continue;
  1365. this.CreateSubDocument(strLink);
  1366. }
  1367. }
  1368. function OnBuildAllFrames( strDoc )
  1369. {
  1370. if ( !g_aDocTree[strDoc]
  1371. || !g_aDocTree[strDoc]._aaRect[1][0]
  1372. || !g_aDocTree[strDoc]._aaRect[1][0].contentDocument.body)
  1373. {
  1374. window.setTimeout("OnBuildAllFrames('" + strDoc + "');", 100);
  1375. return;
  1376. }
  1377. g_aDocTree[strDoc].BuildAllFrames();
  1378. }
  1379. function CPrintDoc_BuildAllFrames()
  1380. {
  1381. var aFrames = this._aaRect[1][0].contentDocument.all.tags("FRAME");
  1382. var nFrames = aFrames.length;
  1383. var nActive = parseInt(this._aaRect[1][0].contentDocument.all.tags("HTML").item(0).__IE_ActiveFrame);
  1384. var i;
  1385. var strSrc;
  1386. var strDoc;
  1387. if (nFrames > 0)
  1388. this._fFrameset = true;
  1389. for (i = 0; i < nFrames; i++)
  1390. {
  1391. strSrc = aFrames[i].src;
  1392. if (strSrc == "res://SHDOCLC.DLL/printnof.htm")
  1393. continue;
  1394. strDoc = this.CreateSubDocument(strSrc);
  1395. if (i == nActive)
  1396. g_strActiveFrame = strDoc;
  1397. g_nFramesLeft++;
  1398. OnBuildAllFrames(strDoc);
  1399. }
  1400. g_nFramesLeft--;
  1401. if (g_nFramesLeft <= 0)
  1402. BuildAllFramesComplete();
  1403. }
  1404. function CPrintDoc_CreateSubDocument( docURL )
  1405. {
  1406. if (!this._aDoc)
  1407. this._aDoc = new Array();
  1408. var nDoc = this._aDoc.length;
  1409. var strDoc = this._strDoc + "_" + nDoc;
  1410. CreateDocument(docURL, strDoc, false);
  1411. this._aDoc[nDoc] = g_aDocTree[strDoc];
  1412. return (strDoc);
  1413. }
  1414. function CPrintDoc_AddTableOfLinks()
  1415. {
  1416. ;
  1417. if (!g_fTableOfLinks)
  1418. {
  1419. this._nStatus = 3;
  1420. ChangeDispPage(g_nDispPage);
  1421. this.FixupHF();
  1422. }
  1423. else
  1424. {
  1425. var oTableOfLinks = BuildTableOfLinks(this._aaRect[1][0].contentDocument);
  1426. if (oTableOfLinks != null)
  1427. {
  1428. var oBody = oTableOfLinks.body;
  1429. this.AddFirstPage()
  1430. this._aaRect[this._nStatus][0].contentSrc = oBody.document;
  1431. }
  1432. else
  1433. {
  1434. this._nStatus = 3;
  1435. ChangeDispPage(g_nDispPage);
  1436. this.FixupHF();
  1437. }
  1438. }
  1439. }
  1440. function OnTickHF( strDoc )
  1441. {
  1442. if (!g_aDocTree[strDoc])
  1443. {
  1444. HandleError("Document " + strDoc + " does not exist.", document.URL, "OnRectComplete");
  1445. return;
  1446. }
  1447. g_aDocTree[strDoc].TickHF();
  1448. }
  1449. function CPrintDoc_TickHF()
  1450. {
  1451. var i, j;
  1452. var iTo, jTo;
  1453. var aTok;
  1454. var oTok;
  1455. var nStartPage = this._nNextHF;
  1456. var cPages = this.Pages();
  1457. iTo = nStartPage + 2;
  1458. if (iTo > cPages)
  1459. iTo = cPages;
  1460. for (i = nStartPage; i <= iTo; i++)
  1461. {
  1462. aTok = this.Page(i).children[0].getElementsByTagName("SPAN");
  1463. for (j=0, jTo = aTok.length; j < jTo; j++)
  1464. {
  1465. oTok = aTok[j];
  1466. if (oTok.className == "hfPageTotal")
  1467. oTok.innerText = cPages;
  1468. else if ( oTok.className == "hfUrl"
  1469. && oTok.innerText == "" )
  1470. oTok.innerText = this.EnsureURL();
  1471. else if ( oTok.className == "hfTitle"
  1472. && oTok.innerText == "" )
  1473. oTok.innerText = this.EnsureTitle();
  1474. }
  1475. }
  1476. this._nNextHF = i;
  1477. if (iTo == cPages)
  1478. {
  1479. this._nStatus = 4;
  1480. if (--g_nDocsToCalc == 0)
  1481. CalcDocsComplete();
  1482. }
  1483. else
  1484. {
  1485. this._nTimerHF = window.setTimeout("OnTickHF('" + this._strDoc + "');", 250);
  1486. }
  1487. }
  1488. function CPrintDoc_FixupHF()
  1489. {
  1490. ;
  1491. this.TickHF();
  1492. }
  1493. function CPrintDoc_Pages()
  1494. {
  1495. var i;
  1496. var c;
  1497. for (i = 0, c = 0; i < 3; i++)
  1498. {
  1499. c += this._acPage[i];
  1500. }
  1501. return c;
  1502. }
  1503. function CPrintDoc_Page(nPage)
  1504. {
  1505. var i;
  1506. var n = nPage;
  1507. if (n <= 0)
  1508. return null;
  1509. for (i = 0; i < 3; i++)
  1510. {
  1511. if (n <= this._acPage[i])
  1512. return this._aaPage[i][n - 1].parentElement;
  1513. n -= this._acPage[i];
  1514. }
  1515. return null;
  1516. }
  1517. function CPrintDoc_EnsureURL()
  1518. {
  1519. if (this._strURL == null)
  1520. {
  1521. if ( this._aaRect[1][0]
  1522. && this._aaRect[1][0].contentDocument)
  1523. {
  1524. this._strURL = this._aaRect[1][0].contentDocument.URL;
  1525. }
  1526. if (this._strURL == null)
  1527. return "";
  1528. }
  1529. return this._strURL;
  1530. }
  1531. function CPrintDoc_EnsureTitle()
  1532. {
  1533. if (this._strTitle == null)
  1534. {
  1535. if ( this._aaRect[1][0]
  1536. && this._aaRect[1][0].contentDocument)
  1537. {
  1538. this._strTitle = this._aaRect[1][0].contentDocument.title;
  1539. }
  1540. if (this._strTitle == null)
  1541. return "";
  1542. }
  1543. return this._strTitle;
  1544. }
  1545. function CPrintDoc_ResetDocument()
  1546. {
  1547. var i;
  1548. for (i = 0; i < 3; i++)
  1549. {
  1550. this._acPage[i] = 0;
  1551. if (this._aaRect[i][0])
  1552. this._aaRect[i][0].contentSrc = "";
  1553. }
  1554. this.StopFixupHF();
  1555. }
  1556. function CPrintDoc_ResetTableOfLinks()
  1557. {
  1558. if (this._nStatus <= 2)
  1559. return;
  1560. this.StopFixupHF();
  1561. this._nStatus = 2;
  1562. this.AddTableOfLinks();
  1563. }
  1564. function CPrintDoc_StopFixupHF()
  1565. {
  1566. if (this._nTimerHF != -1)
  1567. window.clearTimeout(this._nTimerHF);
  1568. this._nTimerHF = -1;
  1569. this._nNextHF = 1;
  1570. }
  1571. function CPrintDoc( nDocNum, strDocURL )
  1572. {
  1573. var i;
  1574. this._aDoc = null;
  1575. this._strDoc = nDocNum;
  1576. this._strDocURL = strDocURL;
  1577. this._nStatus = 0;
  1578. this._aaPage = new Array(3);
  1579. this._aaRect = new Array(3);
  1580. this._acPage = new Array(3);
  1581. this._anMerge = new Array(3);
  1582. for (i=0; i<3; i++)
  1583. {
  1584. this._aaPage[i] = new Array();
  1585. this._aaRect[i] = new Array();
  1586. this._acPage[i] = 0;
  1587. this._anMerge[i] = 0;
  1588. }
  1589. this._nNextHF = 1;
  1590. this._nTimerHF = -1;
  1591. this._strURL = null;
  1592. this._strTitle = null;
  1593. this._fFrameset = false;
  1594. this._nStartingPage = 0;
  1595. }
  1596. CPrintDoc.prototype.RectComplete = CPrintDoc_RectComplete;
  1597. CPrintDoc.prototype.AddPage = CPrintDoc_AddPage;
  1598. CPrintDoc.prototype.AddFirstPage = CPrintDoc_AddFirstPage;
  1599. CPrintDoc.prototype.AddTableOfLinks = CPrintDoc_AddTableOfLinks;
  1600. CPrintDoc.prototype.FixupHF = CPrintDoc_FixupHF;
  1601. CPrintDoc.prototype.StopFixupHF = CPrintDoc_StopFixupHF;
  1602. CPrintDoc.prototype.TickHF = CPrintDoc_TickHF;
  1603. CPrintDoc.prototype.InitDocument = CPrintDoc_InitDocument;
  1604. CPrintDoc.prototype.ResetDocument = CPrintDoc_ResetDocument;
  1605. CPrintDoc.prototype.ResetTableOfLinks = CPrintDoc_ResetTableOfLinks;
  1606. CPrintDoc.prototype.BuildAllLinkedDocuments = CPrintDoc_BuildAllLinkedDocuments;
  1607. CPrintDoc.prototype.BuildAllFrames = CPrintDoc_BuildAllFrames;
  1608. CPrintDoc.prototype.CreateSubDocument = CPrintDoc_CreateSubDocument;
  1609. CPrintDoc.prototype.Print = CPrintDoc_Print;
  1610. CPrintDoc.prototype.PrintAllSubDocuments = CPrintDoc_PrintAllSubDocuments;
  1611. CPrintDoc.prototype.ReadyToPrint = CPrintDoc_ReadyToPrint;
  1612. CPrintDoc.prototype.Page = CPrintDoc_Page;
  1613. CPrintDoc.prototype.Pages = CPrintDoc_Pages;
  1614. CPrintDoc.prototype.EnsureURL = CPrintDoc_EnsureURL;
  1615. CPrintDoc.prototype.EnsureTitle = CPrintDoc_EnsureTitle;
  1616. </SCRIPT>
  1617. </HEAD>
  1618. <BODY onload="setTimeout('OnLoadBody()', 400);">
  1619. <!-- Controls for printing -->
  1620. <IE:TemplatePrinter id=Printer />
  1621. <IE:HeaderFooter id=HeadFoot />
  1622. <DIV id=idDivToolbar style="width:100%; overflow:hidden;">
  1623. <DIV style="width=100%; border:'thin threedhighlight groove';">
  1624. <TABLE><TR>
  1625. <TD class="UIPane"> <BUTTON id="butPrint" title="Print Document (Alt+P)" accesskey=p><U>P</U>rint...</BUTTON></TD>
  1626. <TD class="UISeparator"><IMG width=0 height=0></TD>
  1627. <TD class="UIPane"> <BUTTON id="butPageSetup" accesskey=u><IMG id="printCtl" src="printctl.gif" alt="Page Setup (Alt+U)"></BUTTON></TD>
  1628. <TD class="UISeparator"><IMG width=0 height=0></TD>
  1629. <TD class="UIPane"> <BUTTON id="butFirstPage"><IMG id="begin" src="begin_inactive.gif" alt="First Page (Alt+Home)"></BUTTON></TD>
  1630. <TD class="UIPane"> <BUTTON id="butBackPage"> <IMG id="prev" src="prev_inactive.gif" alt="Previous Page (Alt+LeftArrow)"></BUTTON></TD>
  1631. <TD class="UIPane"><SPAN style="color:windowtext;"><NOBR Loc> <ID id=idTdPageXofYLocText1>P<U>a</U>ge</ID> <INPUT type=text id="inputPageNum" title="Preview Page (Alt+A)" value="1" style="height:1.5em; width: 2em; color:windowtext;" accesskey=a Loc><ID id=idTdPageXofYLocText2> of </ID><SPAN id="spanPageTotal"></SPAN>
  1632.  </SPAN></NOBR></TD>
  1633. <TD class="UIPane"> <BUTTON id="butNextPage"> <IMG id="next" src="next_inactive.gif" alt="Next Page (Alt+RightArrow)"></BUTTON></TD>
  1634. <TD class="UIPane"> <BUTTON id="butLastPage"> <IMG id="end" src="end_inactive.gif" alt="Last Page (Alt+End)"></BUTTON></TD>
  1635. <TD class="UISeparator"><IMG width=0 height=0></TD>
  1636. <TD class="UIPane"> <BUTTON id="butZoomOut"> <IMG id="zoomOut" base="zoomOut" src="zoomout.gif" alt="Zoom Out (Alt+Minus)"></BUTTON></TD>
  1637. <TD class="UIPane"> <BUTTON id="butZoomIn"> <IMG id="zoomIn" base="zoomIn" src="zoomin.gif" alt="Zoom In (Alt+Plus)"></BUTTON></TD>
  1638. <TD class="UIPane"> <SELECT id="selectZoom" accesskey=z>
  1639. <OPTION VALUE="500" >500%
  1640. <OPTION VALUE="200" >200%
  1641. <OPTION VALUE="150" >150%
  1642. <OPTION VALUE="100" >100%
  1643. <OPTION VALUE="75" SELECTED >75%
  1644. <OPTION VALUE="50" >50%
  1645. <OPTION VALUE="25" >25%
  1646. <OPTION VALUE="10" >10%
  1647. <!-- ID's are for localization -->
  1648. <OPTION VALUE=-1 id="idPageWidth">Page Width</OPTION>
  1649. <OPTION VALUE=-2 id="idWholePage">Whole Page</OPTION>
  1650. <OPTION VALUE=-3 id="idTwoPages" >Two Pages </OPTION>
  1651. </SELECT></TD>
  1652. <TD class="UISeparator" id="separatorFrameset" style="display:none"><IMG width=0 height=0></TD>
  1653. <TD class="UIPane" id="cellFrameset" style="display:none"> <SELECT id="selectFrameset" accesskey=f>
  1654. <OPTION VALUE=0 id="idLaidOut">As laid out on screen</OPTION>
  1655. <OPTION VALUE=1 id="idSelected">Only the selected frame</OPTION>
  1656. <OPTION VALUE=2 id="idSeparate">All frames individually</OPTION>
  1657. </SELECT></TD>
  1658. <TD class="UISeparator"><IMG width=0 height=0></TD>
  1659. <TD class="UIPane"> <BUTTON id="butHelp" title="Print Preview Help (Alt+H)" accesskey=h><U>H</U>elp</BUTTON></TD>
  1660. <TD class="UISeparator"><IMG width=0 height=0></TD>
  1661. <TD class="UIPane"> <BUTTON id="butClose" title="Close Print Preview (Alt+C)" accessKey=c><U>C</U>lose</BUTTON></TD>
  1662. </TR></TABLE>
  1663. </DIV>
  1664. </DIV>
  1665. <DIV id=OverflowContainer onclick="this.focus();" onfocus="butPrint.scrollIntoView();" tabindex=1 style="position:absolute; left:0; width:100%; overflow:auto; border:'thin threedhighlight inset'; background:threedshadow;">
  1666. <DIV id=MasterContainer tabindex=0 style="width:100%; position:absolute;">
  1667. <!-- Pages go here -->
  1668. </DIV>
  1669. </DIV>
  1670. </BODY>
  1671. </HTML>
  1672.