home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / ASE.Z / imagswap.js < prev    next >
Encoding:
JavaScript  |  1997-08-21  |  515 b   |  30 lines

  1. //imageswap.js
  2. //functions to swap the src and lowsrc of an image
  3.  
  4. function swapSrc(imageRef)
  5. {
  6.     if ((imageRef) && (imageRef != null))
  7.     {
  8.         if (imageRef.lowsrc && imageRef.src);
  9.         {
  10.         
  11.             var lsrc = imageRef.lowsrc;
  12.             var src = imageRef.src;
  13.             
  14.             imageRef.lowsrc = src;
  15.             imageRef.src = lsrc;    
  16.         }
  17.     }
  18. }
  19.  
  20. function replaceSrc(imageRef, newimg)
  21. {
  22.     if ((imageRef) && (imageRef != null))
  23.     {
  24.         if ((newimg) && (newimg != null) && (newimg != ""));
  25.         {
  26.                 imageRef.src = newimg;    
  27.         }
  28.     }
  29. }
  30.