home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Js / PreLoadImgFunc.js < prev    next >
Encoding:
JavaScript  |  2003-06-24  |  3.4 KB  |  91 lines

  1. /* ======================================================================
  2. DESC: Preload Button and Other Images
  3.  
  4. PLATFORMS: >= MS IE 4.0
  5.  
  6. USAGE NOTES: 
  7. ====================================================================== */
  8. var IfnS = ".jpg";  // Image file name suffix; JPG for > 8 bit color; GIF <= 8 bit
  9. var preLoadStart = false;
  10. var preLoadDone = false;
  11. var ChartButtonDone = false;
  12. var TreeButtonDone = false;
  13. var ImgAr = new Array();
  14. var ImgArIx = 0;
  15.  
  16. function resetButtonDone() {
  17.     preLoadStart = false;
  18.     preLoadDone = false;
  19.     ChartButtonDone = false;
  20.     TreeButtonDone = false;
  21. }
  22.  
  23. function preLoadImgs() {
  24. preLoadStart = true;
  25. // Determine Color Depth and Type of image files to use
  26. IfnS = (screen.colorDepth > 4) ? ".jpg" : ".gif";
  27.  
  28. // Preload Images
  29. ImgArIx = -1;
  30. (ImgAr[++ImgArIx] = new Image() ).src = "images/Monito1.jpg";
  31. (ImgAr[++ImgArIx] = new Image() ).src = "images/Monito3.jpg";
  32. (ImgAr[++ImgArIx] = new Image() ).src = "images/IntroGraph.gif";
  33. (ImgAr[++ImgArIx] = new Image() ).src = "Animations/AniBTLogoFloat.gif";
  34. // Set event for last image of this group
  35. (ImgAr[++ImgArIx] = new Image() ).onload = preLI0a;
  36. (ImgAr[ImgArIx]).src = "images/IntroOverview.gif";
  37. }
  38.  
  39. function preLI0a() {
  40. (ImgAr[++ImgArIx] = new Image() ).src = "images/SepLong"+IfnS;
  41. (ImgAr[++ImgArIx] = new Image() ).src = "images/TreeIn.gif";
  42. (ImgAr[++ImgArIx] = new Image() ).src = "images/Sep1"+IfnS;
  43. (ImgAr[++ImgArIx] = new Image() ).src = "images/Checkbox.gif";
  44. (ImgAr[++ImgArIx] = new Image() ).src = "images/CheckboxHide.gif";
  45. // Set event for last image of this group
  46. (ImgAr[++ImgArIx] = new Image() ).onload = preLI7;
  47. (ImgAr[ImgArIx]).src = "images/TreeOut.gif";
  48. }
  49.  
  50. function preLI7() {
  51. ChartButtonDone = true; // indicate Chart Buttons loaded
  52. (ImgAr[++ImgArIx] = new Image() ).src = "images/topopen.gif";
  53. (ImgAr[++ImgArIx] = new Image() ).src = "images/objects.gif";
  54. (ImgAr[++ImgArIx] = new Image() ).src = "images/white.gif";
  55. (ImgAr[++ImgArIx] = new Image() ).src = "Animations/AniTrash.gif";
  56. (ImgAr[++ImgArIx] = new Image() ).src = "Animations/AniAlarmClock.gif";
  57. // Set event for last image of this group
  58. (ImgAr[++ImgArIx] = new Image() ).onload = preLI71;
  59. (ImgAr[ImgArIx]).src = "images/I.gif";
  60. }
  61.  
  62. function preLI71() {
  63. (ImgAr[++ImgArIx] = new Image() ).src = "images/Tminus.gif";
  64. (ImgAr[++ImgArIx] = new Image() ).src = "images/Tplus.gif";
  65. (ImgAr[++ImgArIx] = new Image() ).src = "images/Counter.gif";
  66. (ImgAr[++ImgArIx] = new Image() ).src = "images/L.gif";
  67. (ImgAr[++ImgArIx] = new Image() ).src = "images/T.gif";
  68. // Set event for last image of this group
  69. (ImgAr[++ImgArIx] = new Image() ).onload = preLI72;
  70. (ImgAr[ImgArIx]).src = "images/Checked.gif";
  71. }
  72.  
  73. function preLI72() {
  74. (ImgAr[++ImgArIx] = new Image() ).src = "images/Unchecked.gif";
  75. (ImgAr[++ImgArIx] = new Image() ).src = "images/Computer.gif";
  76. (ImgAr[++ImgArIx] = new Image() ).src = "images/Lminus.gif";
  77. (ImgAr[++ImgArIx] = new Image() ).src = "images/Lplus.gif";
  78. (ImgAr[++ImgArIx] = new Image() ).src = "images/rightbutton.gif";
  79. (ImgAr[++ImgArIx] = new Image() ).src = "images/invisibleleftbutton.gif";
  80. // Set event for last image of this group
  81. (ImgAr[++ImgArIx] = new Image() ).onload = LoadComplete;
  82. (ImgAr[ImgArIx]).src = "images/leftbuttont.gif";
  83. }
  84.  
  85. function LoadComplete() {
  86.     TreeButtonDone = true; // indicate Tree Buttons loaded
  87.     preLoadDone = true;
  88.     document.body.style.cursor = "auto";
  89. }
  90.  
  91.