home *** CD-ROM | disk | FTP | other *** search
/ InterCD 1999 September / september_1999.iso / Site Building / Web Companion / RandomImage.aj_ / RandomImage.aj
Encoding:
Text File  |  1999-06-23  |  762 b   |  38 lines

  1. <script language="Javascript">
  2. <!--
  3. // original content taken from Nic's JavaScript Page with permission
  4. // lack of these three lines will result in copyright infringment
  5. // made by: Nic's JavaScript Page - http://www.javascript-page.com
  6.  
  7. var currentdate = 0
  8. var core = 0
  9.  
  10. function StringArray (n) {
  11.   this.length = n;
  12.   for (var i =1; i <= n; i++) {
  13.     this[i] = ' '
  14.  
  15.   }
  16. }
  17.  
  18. image = new StringArray(4)
  19. image[0] = '#IMAGE1#'
  20. image[1] = '#IMAGE2#'
  21. image[2] = '#IMAGE3#'
  22. image[3] = '#IMAGE4#'
  23.  
  24. var ran = 60/image.length
  25.  
  26. function ranimage() {
  27.   currentdate = new Date()
  28.   core = currentdate.getSeconds()
  29.   core = Math.floor(core/ran)
  30.     return(image[core])
  31. }
  32.  
  33. document.write("<img src='" +ranimage()+ "'>")
  34.  
  35. //-->
  36. </script>
  37.  
  38.