home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 May / CHIP_CD_2003-05.iso / service / ie6sp1 / IEW2K_3.CAB / shdoclc.dll / HTML / PREVIEW.DLG < prev    next >
Text File  |  2002-10-03  |  42KB  |  1,693 lines

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