home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / 05_02.iso / software / nis / files / NIS / NIS.MSI / NIS.CHM / master.js < prev    next >
Encoding:
JavaScript  |  2001-12-01  |  3.4 KB  |  177 lines

  1. // set variables
  2.  
  3. var aboutgif = new Image();
  4. aboutgif.src = "./images/about.gif";
  5. var howgif = new Image();
  6. howgif.src = "./images/how.gif";
  7. var abtnohow = new Image();
  8. abtnohow.src = "./images/abtnohow.gif";
  9.  
  10. var topicState = new String;
  11. var about = new String;
  12. var how = new String;
  13. var more = new String;
  14. var topicType = new String;
  15. var deftop = new String;
  16. var intro = new String;
  17. var textus = new String;
  18. var textus = location.href.substring(0,location.href.lastIndexOf('file')+1);
  19. var proc = new String;
  20.  
  21. // define functions
  22.  
  23. function noRightClick() {
  24. if(event.button == 2 || event.button == 3) {
  25. alert("Right-click is not available in this view.  ");
  26. return false;
  27. }
  28. return true;
  29. }
  30.  
  31.  
  32. function setPixelLoc() {
  33. pT=".pixelTop=";
  34. kD="";
  35. kT=".style";
  36. d="document.body.scrollTop";
  37. checkForScroll();
  38. }
  39.  
  40. function checkForScroll() {
  41. object="foldrCon";
  42. dd=eval(d);
  43. eval(kD+object+kT+pT+dd);
  44. setTimeout("checkForScroll()",10);
  45. }
  46.  
  47. function BGToggle() {
  48. if (document.body.background==howgif.src) {document.body.background=(aboutgif.src)}
  49. else {document.body.background=(howgif.src)}
  50. }
  51.  
  52. function isWhat(stateIs){
  53. topicState = (stateIs)
  54. }
  55.  
  56. function doToggleLinks(secNum){
  57. //display the section if it's not displayed; hide it if it is displayed
  58. if (secNum.style.display=="none"){secNum.style.display=""}
  59. else{secNum.style.display="none"}
  60. }
  61.  
  62. function SectionOff(secOffNum){
  63. {secOffNum.style.display="none"}
  64. }
  65.  
  66. function SectionOn(secOnNum){
  67. {secOnNum.style.display=""}
  68. return true;
  69. }
  70.  
  71. function SectionHtOff(){
  72. if (proc==="Yes"){oht.style.display="none"}
  73. }
  74.  
  75. function SectionHtOn(){
  76. if (proc=="Yes"){cht.style.display=""}
  77. return true;
  78. }
  79.  
  80. function OpenNewWindow(theURL,winName,features) {
  81.   window.open(theURL,winName,features);
  82. }
  83.  
  84. function beforePrinting()
  85. {
  86.   if (topicType == deftop)
  87.   {
  88.   BGSwap(opengif.src);
  89.   SectionOff(cat);
  90.   SectionOff(cht);
  91.   SectionOff(cmt);
  92.   SectionOn(oat);
  93.   SectionOn(oht);
  94.   SectionOn(omt);
  95.   }
  96.  
  97.   if (topicType == intro)
  98.   {
  99.   BGSwap(opnohow.src)
  100.   SectionOff(cat);
  101.   SectionOff(cmt);
  102.   SectionOn(oat);
  103.   SectionOn(omt);
  104.   }
  105. }
  106.  
  107.  
  108. function afterPrinting()
  109. {
  110.   if (topicType == deftop)
  111.   {
  112.  
  113.     if (topicState == about)
  114.     {
  115.     BGSwap(aboutgif.src);
  116.     SectionOff(cat);
  117.     SectionOff(oht);
  118.     SectionOff(omt);
  119.     SectionOn(oat);
  120.     SectionOn(cht);
  121.     SectionOn(cmt);
  122.     }
  123.  
  124.     if (topicState == how)
  125.     {
  126.     BGSwap(howgif.src);
  127.     SectionOff(oat);
  128.     SectionOff(cht);
  129.     SectionOff(omt);
  130.     SectionOn(cat);
  131.     SectionOn(oht);
  132.     SectionOn(cmt);
  133.     }
  134.  
  135.     if (topicState == more)
  136.     {
  137.     BGSwap(moregif.src);
  138.     SectionOff(oat);
  139.     SectionOff(oht);
  140.     SectionOff(cmt);
  141.     SectionOn(cat);
  142.     SectionOn(cht);
  143.     SectionOn(omt);
  144.     }
  145.   }
  146.  
  147.   if (topicType == intro)
  148.   {
  149.  
  150.     if (topicState == about)
  151.     {
  152.     BGSwap(abtnohow.src);
  153.     SectionOff(cat);
  154.     SectionOff(omt);
  155.     SectionOn(oat);
  156.     SectionOn(cmt);
  157.     }
  158.  
  159.     if (topicState == more)
  160.     {
  161.     BGSwap(mornohow.src);
  162.     SectionOff(oat);
  163.     SectionOff(cmt);
  164.     SectionOn(cat);
  165.     SectionOn(omt);
  166.     }
  167.   }
  168. }
  169.  
  170. // define event handlers
  171.  
  172. // following event handler calls noRightClick function (above) to disable right-click
  173. // document.onmousedown=noRightClick;
  174. // comment out the preceding line for debug purposes
  175.  
  176. // window.onbeforeprint=beforePrinting;
  177. // window.onafterprint=afterPrinting;