home *** CD-ROM | disk | FTP | other *** search
/ Enter 2001 September / EnterCD9.iso / Off-line / w09 / glowne / animate.js next >
Encoding:
Text File  |  2001-04-16  |  2.0 KB  |  85 lines

  1. <!--
  2.     // See KB article about changing this dynamic HTML
  3.     dynamicanimAttr = "dynamicanimation"
  4.     animCancel = "skipanim"
  5.     fpanimationPrefix = "fpAnim"
  6.     animateElements = new Array()
  7.     currentElement = 0
  8.     speed = 1
  9.     stepsZoom = 8
  10.     stepsWord = 8
  11.     stepsFly = 17
  12.     stepsSpiral = 16
  13.     stepsSpiralWord = 19
  14.     stepsElastic = 32
  15.     steps = stepsZoom
  16.     step = 0
  17.     cornerPhase=0
  18.     outEffect=0
  19.     function remSuffix(str)
  20.     {
  21.         ind=str.indexOf("FP")
  22.         str = str.substring(0,ind)
  23.         return str
  24.     }
  25.     function dynAnimOut(el)
  26.     {
  27.         outEffect=1
  28.         dynAnimation(el)
  29.         outEffect=0
  30.     }
  31.     function dynAnimation(obj)
  32.     {
  33.         animateElements = new Array()
  34.         var ms = navigator.appVersion.indexOf("MSIE")
  35.         ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)
  36.         if(!ie4)
  37.         {
  38.             if((navigator.appName == "Netscape") &&
  39.                 (parseInt(navigator.appVersion.substring(0, 1)) >= 4))
  40.                 doc_els=document.layers
  41.             else
  42.                 return
  43.         }
  44.         else
  45.             doc_els=document.all
  46.         if(outEffect && !ie4)
  47.             return
  48.         if(ie4)
  49.         {
  50.             for (index=document.all.length-1; index >= document.body.sourceIndex; index--)
  51.             {
  52.                 el = document.all[index]
  53.                 if(outEffect && el != obj)
  54.                     continue
  55.                 if(outEffect)
  56.                     animationId = el.id.substring(9,el.id.length)
  57.                 else
  58.                     animationId = el.id.substring(6,el.id.length)
  59.                 animation=remSuffix(animationId)
  60.                 if(null != animation)
  61.                 {
  62.                     altcnt=0
  63.                     if(    animation == "dropWord"                ||
  64.                         animation == "flyTopRightWord"            ||
  65.                         animation == "flyBottomRightWord"        ||
  66.                         animation == "waveWords"            ||
  67.                         animation == "hopWords")
  68.                     {
  69.                         ih = el.innerHTML
  70.                         outString = ""
  71.                         i1 = 0
  72.                         iend = ih.length
  73.                         while(true)
  74.                         {
  75.                             i2 = startWord(ih, i1)
  76.                             if(i2 == -1)
  77.                             i2 = iend
  78.                             outWord(ih, i1, i2, false, "", outEffect ? obj.id : el.id)
  79.                             if(i2 == iend)
  80.                                 break
  81.                             i1 = i2
  82.                             i2 = endWord(ih, i1)
  83.                             if(i2 == -1)
  84.                                 i2 = iend
  85.                             if (animation == "waveWord