home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2001 July / VPR0107A.BIN / SHDOCLC.DLL / HTML / PREVIEW.DLG < prev    next >
Text File  |  2000-06-19  |  40KB  |  1,507 lines

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