
<!-- Paste this code into an external JavaScript file named: marquee.js  -->

/*
Mark places in the text where fading text is desired: e.g.,
  <span id="fade_text1" style="font:14pt 'Comic Sans MS',fantasy,cursive;"></span>
*/

/* 
I modeled this code on a script that did a black/white fade:
The JavaScript Source :: http://javascript.internet.com
Created by: Mike Hudson :: http://www.afrozeus.com
*/

function rand(a,b) {
// randomly selects an integer between integers  a  and  b
// returns the selected integer
var c = Math.floor((b+1-a)*Math.random() + a); 
return c;
}

function selectn (x,y,n) {
// randomly selects  n  distinct integers between  x  and  y  (inclusive)
// there are  y-x+1  choices, so  n  must be  <= y-x+1
hold = new Array(); // index starts at 0
choose = rand(x,y); // first selection
hold = hold.concat(choose); // "hold" now has length 1;  need  n-1  more numbers
holdlen = 1; // the length of "hold" will keep increasing by 1
for (i=1; i<=(n-1); i++) {
choose = rand(x,y); // choose a potential new number
// must check that it's not the same as anything else in "hold"
innerloop:
for (j=0; j<holdlen; j++) {
while (choose==hold[j]) {
choose = rand(x,y);
j = -1; } // start over again; will be incremented to 0 on next pass
} // end of innerloop
hold = hold.concat(choose);
holdlen++; 
}
return hold;
}

function setupFadeWords1() {
  // set number of words
  var numwords = 38; // = (last index) + 1
  var inds = selectn(0,numwords-1,numwords);
  // Note:  the "arr" prefix is for "array"
  arrFadeWords1[inds[0]] = "Enjoy";
  arrFadeWords1[inds[1]] = "Enjoy";
  arrFadeWords1[inds[2]] = "Enjoy";
  arrFadeWords1[inds[3]] = "Experience";
  arrFadeWords1[inds[4]] = "Experience";
  arrFadeWords1[inds[5]] = "Experience";
  arrFadeWords1[inds[6]] = "Delight in";
  arrFadeWords1[inds[7]] = "Delight in";
  arrFadeWords1[inds[8]] = "Delight in";
  arrFadeWords1[inds[9]] = "Wonder at";
  arrFadeWords1[inds[10]] = "Wonder at";
  arrFadeWords1[inds[11]] = "Wonder at";
  arrFadeWords1[inds[12]] = "Develop a passion for";
  arrFadeWords1[inds[13]] = "Join others in";
  arrFadeWords1[inds[14]] = "Join others in";
  arrFadeWords1[inds[15]] = "Endure";
  arrFadeWords1[inds[16]] = "Philosophize on";
  arrFadeWords1[inds[17]] = "Why not consider";
  arrFadeWords1[inds[18]] = "Why not consider";
  arrFadeWords1[inds[19]] = "Dabble in";
  arrFadeWords1[inds[20]] = "Try out";
  arrFadeWords1[inds[21]] = "Photograph";
  arrFadeWords1[inds[22]] = "Photograph";
  arrFadeWords1[inds[23]] = "Ponder";
  arrFadeWords1[inds[24]] = "Ponder";
  arrFadeWords1[inds[25]] = "Paint";
  arrFadeWords1[inds[26]] = "Cogitate on";
  arrFadeWords1[inds[27]] = "Develop a taste for";
  arrFadeWords1[inds[28]] = "Fantasize about";
  arrFadeWords1[inds[29]] = "Fantasize about";
  arrFadeWords1[inds[30]] = "Fantasize about";
  arrFadeWords1[inds[31]] = "Anticipate";
  arrFadeWords1[inds[32]] = "Anticipate";
  arrFadeWords1[inds[33]] = "Lie awake dreaming of";
  arrFadeWords1[inds[34]] = "Lie awake dreaming of";
  arrFadeWords1[inds[35]] = "Lie awake dreaming of";
  arrFadeWords1[inds[36]] = "Set your heart on";
  arrFadeWords1[inds[37]] = "Set your heart on";
}

function setupFadeWords2() {
  // set number of words
  var numwords = 49;
  var inds = selectn(0,numwords-1,numwords);
  arrFadeWords2[inds[0]] = "life and travel";
  arrFadeWords2[inds[1]] = "life and travel";
  arrFadeWords2[inds[2]] = "life and travel";
  arrFadeWords2[inds[3]] = "travel & dance";
  arrFadeWords2[inds[4]] = "travel & dance";
  arrFadeWords2[inds[5]] = "travel & dance";
  arrFadeWords2[inds[6]] = "music & weddings";
  arrFadeWords2[inds[7]] = "music & weddings";
  arrFadeWords2[inds[8]] = "wondrous oceans";
  arrFadeWords2[inds[9]] = "wondrous oceans";
  arrFadeWords2[inds[10]] = "wondrous oceans";
  arrFadeWords2[inds[11]] = "cobbled streets";
  arrFadeWords2[inds[12]] = "cobbled streets";
  arrFadeWords2[inds[13]] = "music & dance";
  arrFadeWords2[inds[14]] = "music & dance";
  arrFadeWords2[inds[15]] = "music & dance";
  arrFadeWords2[inds[16]] = "life & dance";
  arrFadeWords2[inds[17]] = "life & dance";
  arrFadeWords2[inds[18]] = "life & dance";
  arrFadeWords2[inds[19]] = "travel and life";
  arrFadeWords2[inds[20]] = "travel and life";
  arrFadeWords2[inds[21]] = "travel and life";
  arrFadeWords2[inds[22]] = "ice blue glaciers";
  arrFadeWords2[inds[23]] = "ice blue glaciers";
  arrFadeWords2[inds[24]] = "other cultures";
  arrFadeWords2[inds[25]] = "other cultures";
  arrFadeWords2[inds[26]] = "other cultures";
  arrFadeWords2[inds[27]] = "local home stays";
  arrFadeWords2[inds[28]] = "ancient villages";
  arrFadeWords2[inds[29]] = "ancient villages";
  arrFadeWords2[inds[30]] = "ancient villages";
  arrFadeWords2[inds[31]] = "foreign lands";
  arrFadeWords2[inds[32]] = "foreign lands";
  arrFadeWords2[inds[33]] = "foreign lands";
  arrFadeWords2[inds[34]] = "soaring mountain peaks";
  arrFadeWords2[inds[35]] = "soaring mountain peaks";
  arrFadeWords2[inds[36]] = "soaring mountain peaks";
  arrFadeWords2[inds[37]] = "song and dance";
  arrFadeWords2[inds[38]] = "song and dance";
  arrFadeWords2[inds[39]] = "song and dance";
  arrFadeWords2[inds[40]] = "life's journey";
  arrFadeWords2[inds[41]] = "life's journey";
  arrFadeWords2[inds[42]] = "life's journey";
  arrFadeWords2[inds[43]] = "music's journey";
  arrFadeWords2[inds[44]] = "folklore dances";
  arrFadeWords2[inds[45]] = "folklore dances";
  arrFadeWords2[inds[46]] = "life, yes life";
  arrFadeWords2[inds[47]] = "life, yes life";
  arrFadeWords2[inds[48]] = "life, yes life";
}

function setupFadeWords3() {
// set number of words
  var numwords = 34;
  var inds = selectn(0,numwords-1,numwords);
  arrFadeWords3[inds[0]] = "a difference";
  arrFadeWords3[inds[1]] = "a difference";
  arrFadeWords3[inds[2]] = "a difference";
  arrFadeWords3[inds[3]] = "meeting people";
  arrFadeWords3[inds[4]] = "meeting people";
  arrFadeWords3[inds[5]] = "meeting people";
  arrFadeWords3[inds[6]] = "no pomposity";
  arrFadeWords3[inds[7]] = "no pomposity";
  arrFadeWords3[inds[8]] = "Alaska native Tlingits";
  arrFadeWords3[inds[9]] = "Alaska native Tlingits";
  arrFadeWords3[inds[10]] = "Karl's guitar";
  arrFadeWords3[inds[11]] = "Karl's guitar";
  arrFadeWords3[inds[12]] = "Karl's guitar";
  arrFadeWords3[inds[13]] = "Latin dancers";
  arrFadeWords3[inds[14]] = "Karl's corny humor";
  arrFadeWords3[inds[15]] = "Karl's corny humor";
  arrFadeWords3[inds[16]] = "familial informality";
  arrFadeWords3[inds[17]] = "familial informality";
  arrFadeWords3[inds[18]] = "familial informality";
  arrFadeWords3[inds[19]] = "Bulgarian villages";
  arrFadeWords3[inds[20]] = "Bulgarian villages";
  arrFadeWords3[inds[21]] = "people of like interest";
  arrFadeWords3[inds[22]] = "people of like interest";
  arrFadeWords3[inds[23]] = "no \"if it's Tuesday\" syndrome";
  arrFadeWords3[inds[24]] = "Karl's portable dance music";
  arrFadeWords3[inds[25]] = "Karl's portable dance music";
  arrFadeWords3[inds[26]] = "relaxed informality";
  arrFadeWords3[inds[27]] = "relaxed informality";
  arrFadeWords3[inds[28]] = "relaxed informality";
  arrFadeWords3[inds[29]] = "friendly folks like you";
  arrFadeWords3[inds[30]] = "friendly folks like you";
  arrFadeWords3[inds[31]] = "friendly folks like you";
  arrFadeWords3[inds[32]] = "cultured pearls of wisdom";
  arrFadeWords3[inds[33]] = "cultured pearls of wisdom";
}

// hexadecimal FF = decimal 255;
// in an RRGGBB color, each segment (RR, GG, BB) can take decimal values between 0 and 255
// #FFFFFF = white 
// a color is completely faded OUT (white) when it reaches #FFFFFF
// This variable determines the end "fading out" color.
// Colors with segment values between m_FadeIn and m_FadeOut get written to the screen
// To fade completely to white (for a white background), leave these at 255

var m_FadeOut1R = 240;
var m_FadeOut1G = 252;
var m_FadeOut1B = 208;

var m_FadeOut2R = 240;
var m_FadeOut2G = 252;
var m_FadeOut2B = 208;

var m_FadeOut3R = 240;
var m_FadeOut3G = 252;
var m_FadeOut3B = 208;


// hexadecimal 00 = decimal 0;
// to fade in completely to black (for black type), leave these at 0
// to fade in to a specified color, these should contain the RRGGBB values of the desired color
// use the MAC built-in "Digital Color Meter" to match colors, RGB as actual value, 8-bit

// matches text color in top banner:  102, 181, 152
// try: #660066=102,0,102 ; #6600CC=102,0,204 ; #660099=102,0,153 shades of purple: Carol doesn't like
// not yet tried: _Box 1 & Box 3_: R/G/B: 82/6/110, Box 2:_ R/G/B: 52/2/74
// shades of green: #153B2C=21,59,44;   #305C4B=48,92,75; #3A6957=58,105,87;    the word "with" is #5D927E

var m_FadeIn1R=21;
var m_FadeIn1G=59;
var m_FadeIn1B=44;

var m_FadeIn2R=21;
var m_FadeIn2G=59;
var m_FadeIn2B=44;

var m_FadeIn3R=21;
var m_FadeIn3G=59;
var m_FadeIn3B=44;


// the starting value for the color (usually the same as the FadeIn color above

var m_Fade1R = 21;
var m_Fade1G = 59;
var m_Fade1B = 44;

var m_Fade2R = 21;
var m_Fade2G = 59;
var m_Fade2B = 44;

var m_Fade3R = 21;
var m_Fade3G = 59;
var m_Fade3B = 44;


// if the FadeStep is 3, then colors progress like this:
// 000000, 030303, 060606, etc.
// Thus, this controls how "finely" we pass thru the different hues,
// and also how many steps it takes to do the complete fading sequence
// Unless you're going from white to black (where there's a huge range between lightest and darkest in all RGB components),
// then it's best to leave this as "1"
var m_FadeStep1 = 1;
var m_FadeStep2 = 1;
var m_FadeStep3 = 1;

// This variable determines the wait BETWEEN fading cycles
// It determines how long text is held on the screen, stationary, before beginning another cycle
// 5000 = 5000 milliseconds = 5 seconds
// initial settings:  5000, 4000, 3500
var m_FadeWait1 = 100; 
var m_FadeWait2 = 6000; 
var m_FadeWait3 = 2000; 

// Begin the sequence by fading OUT (darker to lighter---increasing RRGGBB values)
var m_bFadeOut1 = true; // "b" is for "Boolean"
var m_bFadeOut2 = true;
var m_bFadeOut3 = true;

// these variables hold the setInterval() cycle names, so we can clear and stop/start these intervals
var m_iFadeInterval1;
var m_iFadeInterval2;
var m_iFadeInterval3;

// the arrays that hold the words that are fading in and out
var arrFadeWords1;
var arrFadeWords2;
var arrFadeWords3;

// the current index in the arrFadeWords arrays
var m_curIndexInFadeWords1 = 0;
var m_curIndexInFadeWords2 = 0;
var m_curIndexInFadeWords3 = 0;

// These variables hold the maximum array indices for the displayed words
var m_FadeWords1MaxIndex;
var m_FadeWords2MaxIndex;
var m_FadeWords3MaxIndex;

function Fadewl() {
  m_iFadeInterval1 = setInterval(fade_ontimer1, 10);
  arrFadeWords1 = new Array();
  setupFadeWords1();
  m_FadeWords1MaxIndex = arrFadeWords1.length-1;
  setFadeText1();
  m_iFadeInterval2 = setInterval(fade_ontimer2, 10);
  arrFadeWords2 = new Array();
  setupFadeWords2();
  m_FadeWords2MaxIndex = arrFadeWords2.length-1;
  setFadeText2();
  m_iFadeInterval3 = setInterval(fade_ontimer3, 10);
  arrFadeWords3 = new Array();
  setupFadeWords3();
  m_FadeWords3MaxIndex = arrFadeWords3.length-1;
  setFadeText3();
}

function setFadeText1() {
  var ilink = document.getElementById("fade_text1");
  ilink.innerHTML = arrFadeWords1[m_curIndexInFadeWords1];
}

function setFadeText2() {
  var ilink = document.getElementById("fade_text2");
  ilink.innerHTML = arrFadeWords2[m_curIndexInFadeWords2];
}

function setFadeText3() {
  var ilink = document.getElementById("fade_text3");
  ilink.innerHTML = arrFadeWords3[m_curIndexInFadeWords3];
}

function fade_ontimer1() {
  if (m_bFadeOut1) { // if we're fading OUT (i.e., getting lighter...
   (m_Fade1R < m_FadeOut1R) && (m_Fade1R+=m_FadeStep1); // only increment if it's less
      (m_Fade1R > m_FadeOut1R) && (m_Fade1R = m_FadeOut1R);  // if we've exceeded max, set to max value
   (m_Fade1G < m_FadeOut1G) && (m_Fade1G+=m_FadeStep1);
      (m_Fade1G > m_FadeOut1G) && (m_Fade1G = m_FadeOut1G); 
   (m_Fade1B < m_FadeOut1B) &&( m_Fade1B+=m_FadeStep1);
      (m_Fade1B > m_FadeOut1B) && (m_Fade1B = m_FadeOut1B);
   // if we're already as light as desired...
   if ( (m_Fade1R>=m_FadeOut1R) && (m_Fade1G>=m_FadeOut1G) && (m_Fade1B>=m_FadeOut1B) ) {
      m_curIndexInFadeWords1++; // go on to the next word to be displayed
      if (m_curIndexInFadeWords1>m_FadeWords1MaxIndex) // if we've reached the end of the word matrix...
        m_curIndexInFadeWords1=0; // start back at the beginning of the word matrix
      setFadeText1(); // display the text
      m_bFadeOut1 = false; // now, we'll start fading IN (i.e., getting darker...)
    }
  } else { // otherwise, we're fading IN (i.e., get darker...)
  (m_Fade1R > m_FadeIn1R) && (m_Fade1R-=m_FadeStep1); // only decrement if it's more
      (m_Fade1R < m_FadeIn1R) && (m_Fade1R = m_FadeIn1R);  // if we're lower than the min, set to min value
   (m_Fade1G > m_FadeIn1G) && (m_Fade1G-=m_FadeStep1);
      (m_Fade1G < m_FadeIn1G) && (m_Fade1G = m_FadeIn1G); 
   (m_Fade1B > m_FadeIn1B) &&( m_Fade1B-=m_FadeStep1);
      (m_Fade1B < m_FadeIn1B) && (m_Fade1B = m_FadeIn1B);
   // if we're already as dark as desired...
   if ( (m_Fade1R<=m_FadeIn1R) && (m_Fade1G<=m_FadeIn1G) && (m_Fade1B<=m_FadeIn1B) ) {
      clearInterval(m_iFadeInterval1); // STOP the setInterval() cycle...
      setTimeout(Faderesume1, m_FadeWait1); // after m_FadeWait milliseconds, resume the cycle
      m_bFadeOut1=true; // start fading OUT
    }
  }
  var ilink = document.getElementById("fade_text1");
  if ( (m_Fade1R<=m_FadeOut1R)&&(m_Fade1R>=m_FadeIn1R)&&(m_Fade1G<=m_FadeOut1G)&&(m_Fade1G>=m_FadeIn1G)&&(m_Fade1B<=m_FadeOut1B)&&(m_Fade1B>=m_FadeIn1B) )
    ilink.style.color = "#" + ToHexColor(m_Fade1R,m_Fade1G,m_Fade1B);
}

function fade_ontimer2() {
  if (m_bFadeOut2) { // if we're fading OUT (i.e., getting lighter...
   (m_Fade2R < m_FadeOut2R) && (m_Fade2R+=m_FadeStep2); // only increment if it's less
      (m_Fade2R > m_FadeOut2R) && (m_Fade2R = m_FadeOut2R);  // if we've exceeded max, set to max value
   (m_Fade2G < m_FadeOut2G) && (m_Fade2G+=m_FadeStep2);
      (m_Fade2G > m_FadeOut2G) && (m_Fade2G = m_FadeOut2G); 
   (m_Fade2B < m_FadeOut2B) &&( m_Fade2B+=m_FadeStep2);
      (m_Fade2B > m_FadeOut2B) && (m_Fade2B = m_FadeOut2B);
   // if we're already as light as desired...
   if ( (m_Fade2R>=m_FadeOut2R) && (m_Fade2G>=m_FadeOut2G) && (m_Fade2B>=m_FadeOut2B) ) {
      m_curIndexInFadeWords2++; // go on to the next word to be displayed
      if (m_curIndexInFadeWords2>m_FadeWords2MaxIndex) // if we've reached the end of the word matrix...
        m_curIndexInFadeWords2=0; // start back at the beginning of the word matrix
      setFadeText2(); // display the text
      m_bFadeOut2 = false; // now, we'll start fading IN (i.e., getting darker...)
    }
  } else { // otherwise, we're fading IN (i.e., get darker...)
  (m_Fade2R > m_FadeIn2R) && (m_Fade2R-=m_FadeStep2); // only decrement if it's more
      (m_Fade2R < m_FadeIn2R) && (m_Fade2R = m_FadeIn2R);  // if we're lower than the min, set to min value
   (m_Fade2G > m_FadeIn2G) && (m_Fade2G-=m_FadeStep2);
      (m_Fade2G < m_FadeIn2G) && (m_Fade2G = m_FadeIn2G); 
   (m_Fade2B > m_FadeIn2B) &&( m_Fade2B-=m_FadeStep2);
      (m_Fade2B < m_FadeIn2B) && (m_Fade2B = m_FadeIn2B);
   // if we're already as dark as desired...
   if ( (m_Fade2R<=m_FadeIn2R) && (m_Fade2G<=m_FadeIn2G) && (m_Fade2B<=m_FadeIn2B) ) {
      clearInterval(m_iFadeInterval2); // STOP the setInterval() cycle...
      setTimeout(Faderesume2, m_FadeWait2); // after m_FadeWait milliseconds, resume the cycle
      m_bFadeOut2=true; // start fading OUT
    }
  }
  var ilink = document.getElementById("fade_text2");
  if ( (m_Fade2R<=m_FadeOut2R)&&(m_Fade2R>=m_FadeIn2R)&&(m_Fade2G<=m_FadeOut2G)&&(m_Fade2G>=m_FadeIn2G)&&(m_Fade2B<=m_FadeOut2B)&&(m_Fade2B>=m_FadeIn2B) )
    ilink.style.color = "#" + ToHexColor(m_Fade2R,m_Fade2G,m_Fade2B);
}

function fade_ontimer3() {
  if (m_bFadeOut3) { // if we're fading OUT (i.e., getting lighter...
   (m_Fade3R < m_FadeOut3R) && (m_Fade3R+=m_FadeStep3); // only increment if it's less
      (m_Fade3R > m_FadeOut3R) && (m_Fade3R = m_FadeOut3R);  // if we've exceeded max, set to max value
   (m_Fade3G < m_FadeOut3G) && (m_Fade3G+=m_FadeStep3);
      (m_Fade3G > m_FadeOut3G) && (m_Fade3G = m_FadeOut3G); 
   (m_Fade3B < m_FadeOut3B) &&( m_Fade3B+=m_FadeStep3);
      (m_Fade3B > m_FadeOut3B) && (m_Fade3B = m_FadeOut3B);
   // if we're already as light as desired...
   if ( (m_Fade3R>=m_FadeOut3R) && (m_Fade3G>=m_FadeOut3G) && (m_Fade3B>=m_FadeOut3B) ) {
      m_curIndexInFadeWords3++; // go on to the next word to be displayed
      if (m_curIndexInFadeWords3>m_FadeWords3MaxIndex) // if we've reached the end of the word matrix...
        m_curIndexInFadeWords3=0; // start back at the beginning of the word matrix
      setFadeText3(); // display the text
      m_bFadeOut3 = false; // now, we'll start fading IN (i.e., getting darker...)
    }
  } else { // otherwise, we're fading IN (i.e., get darker...)
  (m_Fade3R > m_FadeIn3R) && (m_Fade3R-=m_FadeStep3); // only decrement if it's more
      (m_Fade3R < m_FadeIn3R) && (m_Fade3R = m_FadeIn3R);  // if we're lower than the min, set to min value
   (m_Fade3G > m_FadeIn3G) && (m_Fade3G-=m_FadeStep3);
      (m_Fade3G < m_FadeIn3G) && (m_Fade3G = m_FadeIn3G); 
   (m_Fade3B > m_FadeIn3B) &&( m_Fade3B-=m_FadeStep3);
      (m_Fade3B < m_FadeIn3B) && (m_Fade3B = m_FadeIn3B);
   // if we're already as dark as desired...
   if ( (m_Fade3R<=m_FadeIn3R) && (m_Fade3G<=m_FadeIn3G) && (m_Fade3B<=m_FadeIn3B) ) {
      clearInterval(m_iFadeInterval3); // STOP the setInterval() cycle...
      setTimeout(Faderesume3, m_FadeWait3); // after m_FadeWait milliseconds, resume the cycle
      m_bFadeOut3=true; // start fading OUT
    }
  }
  var ilink = document.getElementById("fade_text3");
  if ( (m_Fade3R<=m_FadeOut3R)&&(m_Fade3R>=m_FadeIn3R)&&(m_Fade3G<=m_FadeOut3G)&&(m_Fade3G>=m_FadeIn3G)&&(m_Fade3B<=m_FadeOut3B)&&(m_Fade3B>=m_FadeIn3B) )
    ilink.style.color = "#" + ToHexColor(m_Fade3R,m_Fade3G,m_Fade3B);
}

function Faderesume1() {
  m_iFadeInterval1 = setInterval(fade_ontimer1, 10);
}

function Faderesume2() {
  m_iFadeInterval2 = setInterval(fade_ontimer2, 10);
}

function Faderesume3() {
  m_iFadeInterval3 = setInterval(fade_ontimer3, 10);
}


// this does only a fade with ANY starting color
// if "hexStartColor" is 00A2B3 and strValue is "3" then colors progress like this:
// 00A2B3, 03A5B6, 06A8B9, and so on
// whenever ANY "RGB" segment is "FF" (white), then it stays that way
function ToHexColor(strValueR,strValueG,strValueB) {
  try {
    var resultR = (parseInt(strValueR).toString(16));
    while (resultR.length !=2)
      resultR= ("0" +resultR);
            
    var resultG = (parseInt(strValueG).toString(16));
    while (resultG.length !=2)
      resultG= ("0" +resultG);
            
    var resultB = (parseInt(strValueB).toString(16));
    while (resultB.length !=2)
      resultB = ("0" +resultB);
            
    result = resultR + resultG + resultB;
    return result.toUpperCase();
  }
  catch(e)
  {
  }
}

window.onload = Fadewl;




