home *** CD-ROM | disk | FTP | other *** search
/ Sybex Virtual Trainer CCNP Switching / Sybex_Virtual_Trainer_CCNP_Switching.iso / data1.cab / Program_Files / media / html / lib.js < prev    next >
Encoding:
JavaScript  |  2001-04-04  |  2.1 KB  |  108 lines

  1. // Copyright (c) 1999,Y2K  Maris Multimedia Ltd.  http://www.maris.com/
  2. // Thank you for examining our code.
  3.  
  4. var ns = false;
  5. var ie = false;
  6.  
  7. if (document.layers)
  8. {
  9.     ns = true;
  10. }
  11.  
  12. if (document.all)
  13. {
  14.     ie = true;
  15. }
  16.  
  17. function imageObject(name,imageSrc)
  18. {
  19.     this.name = name;
  20.     
  21.     this.Out  = new Image();
  22.     this.Over = new Image();
  23.     this.Down = new Image();
  24.     
  25.     this.Out.src  = imageSrc + "out.gif";
  26.     this.Over.src = imageSrc + "over.gif";
  27.     this.Down.src = imageSrc + "down.gif";
  28.  
  29.     this.mOut = mOut;
  30.     this.mOver = mOver;
  31.     this.mDown = mDown;
  32. }
  33.  
  34. function mOut()
  35. {
  36.     eval("document."+this.name+".src="+this.name+"Image.Out.src;")
  37. }
  38.  
  39. function mOver()
  40. {
  41.     eval("document."+this.name+".src="+this.name+"Image.Over.src;")
  42. }
  43.  
  44. function mDown()
  45. {
  46.     eval("document."+this.name+".src="+this.name+"Image.Down.src;")
  47. }
  48.  
  49. function imageObjectN(imageSrc)
  50. {
  51.     this.imageObjectOut  = new Image();
  52.     this.imageObjectOver = new Image();
  53.     this.imageObjectDown = new Image();
  54.     
  55.     this.imageObjectOut.src  = imageSrc + "out.gif";
  56.     this.imageObjectOver.src = imageSrc + "over.gif";
  57.     this.imageObjectDown.src = imageSrc + "down.gif";
  58. }
  59.  
  60. function imageObjectChange(imageName,imageObj,imageState)
  61. {
  62.     eval("document."+imageName+".src="+imageObj+".imageObject"+imageState+".src;")
  63. }
  64.  
  65.  
  66. /*
  67. function imageCheckObject(imageSrc)
  68. {
  69.     this.On  = new Image();
  70.     this.On.src  = imageSrc + "on.gif";
  71.     this.Off = new Image();
  72.     this.Off.src = imageSrc + "off.gif";
  73. }
  74.  
  75. function checkGroup(group,On,imageOnOff)
  76. {
  77.     this.group=group;
  78.     this.On=On;
  79.     this.imageOnOff=imageOnOff;
  80.     this.changeOnOff=changeOnOff;
  81.     this.resizeOnOff=resizeOnOff;
  82. }
  83.  
  84. function changeOnOff(in_On)
  85. {
  86.     if(this.On!=in_On)
  87.     {
  88.         eval("document."+in_On+".src=this.imageOnOff.On.src;");
  89.         eval("document."+this.On+".src=this.imageOnOff.Off.src;");
  90.         this.On=in_On;
  91.     }
  92. }
  93.  
  94. function resizeOnOff()
  95. {
  96.     for (i=0; i<this.group.length; i++)
  97.     {
  98.         if(this.group[i]==this.On)
  99.         {
  100.             eval("document."+this.group[i]+".src=this.imageOnOff.On.src;");
  101.         }
  102.         else
  103.         {
  104.             eval("document."+this.group[i]+".src=this.imageOnOff.Off.src;");
  105.         }
  106.     }
  107. }
  108. */