//============================================================
//Script:    TriState Rainbow Link Script
//
//Functions: Creates a link that blinks through three colors
//           - settable blink rate with rate variable
//           - settable blink colors, settable no-blink color
//           - on/off control via links (optional)
//           - can be made to start blinking when clicked
//           - can be made to stop blinking when clicked
//
//Browsers:  NS6 and IE 4.0&up; degrades gracefully in NS3,4

//Author:    etLux
//============================================================

// ==========================
// (C) 2000 by CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

// blink speed in miliseconds
var rate = 300;

// the three blink colors
var Color1 = "#EAEAEA"
var Color2 = "#F1F1F1"

// the color if/when turned off (no-blink color)
var ColorX = "#666666"
var ColorBGX = "#FFFFFF"

// set this to true for auto start; else, false
var DoIt = true

// do not edit below this line
// ---------------------------

bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"
ok = false

var i=0;
function doTriStateRainbowLink(){
   ok =  true
   if ((bNS && bV >= 5) || (bIE && bV >= 4)){
      i++;
      if (i==1) C = Color1
      if (i==2) C = Color2
      if (i==1) D = Color1
      if (i==2) D = Color2
      if (!DoIt) C = ColorX   
      if (!DoIt) D = ColorBGX

      if (bIE) {
          BlinkLink.style.background=D
          BlinkLink.style.color=C
      }


      if (bNS) {
          if(document.getElementById('BlinkLink')){
            document.getElementById('BlinkLink').style.background = D
            document.getElementById('BlinkLink').style.color = C
          }
      }
      if (bIE) {
          BlinkLink2.style.background=D
          BlinkLink2.style.color=C
      }
      
      
      if (bNS) {
          if(document.getElementById('BlinkLink2')){
              document.getElementById('BlinkLink2').style.background = D
              document.getElementById('BlinkLink2').style.color = C
          }
      }

      if (i > 2) i = 0
      if (DoIt) timer=setTimeout('doTriStateRainbowLink()', rate)
   }      
}


function doOnOff(a){
   if (ok){
      if (a =="off") {DoIt = false}
      if ((a =="on")&&(!DoIt)) {
          DoIt = true
          doTriStateRainbowLink()
      }
   }
}



