

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Mike Hudson :: http://www.afrozeus.com */

function setupFadeLinks() {
	arrFadeLinks[0] = "/peterswar/reviews";
  arrFadeTitles[0] = "<span style=\"display:block;font-variant:small-caps;font-size:150%;text-align:center;margin-top:20px\">Praise for <em>Peter's War...</em></span>";
	arrFadeLinks[1] = "/peterswar/reviews";
  arrFadeTitles[1] = "&quot;A well-written and important contribution to our understanding of the black experience during the Revolution.&quot; <br /><br />&#8212; Edward Rugemer, Yale University";
  arrFadeLinks[2] = "/peterswar/reviews";
  arrFadeTitles[2] = "&quot;In this deeply researched and generously wrought book, Joyce Lee Malcolm penetrates the past's shadows and helps us recover the life of an American boy relegated to obscurity &#8212; until now.&quot;<br /><br />&#8212; Wilfred M. McClay, University of Tennessee at Chattanooga";
  arrFadeLinks[3] = "/peterswar/reviews";
  arrFadeTitles[3] = "&quot;In clear, engaging language, Malcolm reconstructs the surroundings, relationships and political atmosphere of the Revolution.... Malcolm seamlessly captures the intersection of personal, political and military strategy. History buffs will revel in Peter's never-before-told story, which makes a vivid addition to Revolutionary War literature.&quot;<br /><br />&#8212; Kirkus Reviews";
  arrFadeLinks[4] = "/peterswar/reviews";
  arrFadeTitles[4] = "&quot;From the fogs of war and hidden records, Joyce Lee Malcolm has retrieved this amazing story of slavery and freedom in the midst of the American Revolution. With graceful, old-fashioned narrative style... this book is a marvelous example of what can be learned from heretofore unknown people, and a beautifully-told tale about the ugliest underside of American history.&quot;<br /><br />&#8212; David W. Blight, author of <em>A Slave No More</em>";

}

// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.

var m_FadeOut = 255; // the color to fade out to
var m_FadeIn=0; // the color of the text at full opacity
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait = 5000; // how long to wait between fade in/out transitions
var m_bFadeOut = true;

var m_iFadeInterval;

window.onload = Fadewl;

var arrFadeLinks;
var arrFadeTitles;
var arrFadeCursor = 0;
var arrFadeMax;

function Fadewl() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
  arrFadeLinks = new Array();
  arrFadeTitles = new Array();
  setupFadeLinks();
  arrFadeMax = arrFadeLinks.length-1;
  setFadeLink();
}

function setFadeLink() {
  var ilink = document.getElementById("fade_link");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
  ilink.href = arrFadeLinks[arrFadeCursor];
}

function fade_ontimer() {
  if (m_bFadeOut) {
    m_Fade+=m_FadeStep;
    if (m_Fade>m_FadeOut) {
      arrFadeCursor++;
      if (arrFadeCursor>arrFadeMax)
        arrFadeCursor=0;
      setFadeLink();
      m_bFadeOut = false;
    }
  } else {
    m_Fade-=m_FadeStep;
    if (m_Fade<m_FadeIn) {
      clearInterval(m_iFadeInterval);
      setTimeout(Faderesume, m_FadeWait);
      m_bFadeOut=true;
    }
  }
  var ilink = document.getElementById("fade_link");
  if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
    ilink.style.color = "#" + ToHex(m_Fade);
}

function Faderesume() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
}

function ToHex(strValue) {
  try {
    var result= (parseInt(strValue).toString(16));

    while (result.length !=2)
            result= ("0" +result);
    result = result + result + result;
    return result.toUpperCase();
  }
  catch(e)
  {
  }
}







