
var aTextFadeColors = new Array(
  '#182094', /* Background Color */
  '#182094',
  '#182094',
  '#2830a4',
  '#2830a4',
  '#3840b4',
  '#4850c4',
  '#5860d4',
  '#6870e4',
  '#7880f4',
  '#8890ff',
  '#98a0ff',
  '#a8b0ff',
  '#b8c0ff',
  '#c8d0ff',
  '#d8e0ff',
  '#e8f0ff',
  '#f8ffff',
  '#ffffff' /* Foreground Color */
);

function FadeIn( i ) {
  if ( !oCurrentAbout ) { return; }
  if ( i < aTextFadeColors.length ) {
    i++;
    oCurrentAbout.style.color = aTextFadeColors[i];
    aAnchors = oCurrentAbout.getElementsByTagName( 'a' );
    for ( var j = 0; j < aAnchors.length; j++ ) {
      aAnchors[j].style.color = aTextFadeColors[i];
    }
    vTimeoutID = setTimeout( 'FadeIn(' + i + ')', 75 );
  } else {
    return;
  }
}

/* NOTE: can't use setTimeout to fade out as it
         runs in a separate thread concurrently with
         the fade in effect, thus is overridden. */
function FadeOut( i ) {
  oCurrentAbout.style.color = aTextFadeColors[0];
}

var oCurrentAbout = null;
var vTimeoutID = null;

function ShowAbout( sNewAboutID ) {

  // handle the previous about text
  if ( null != oCurrentAbout ) {
    clearTimeout( vTimeoutID ); /* Call twice to enforce */
    clearTimeout( vTimeoutID );
    FadeOut( aTextFadeColors.length - 1 );
    oCurrentAbout.style.display = 'none';
  }

  // handle the new about text
  oCurrentAbout = document.getElementById( 'About'+sNewAboutID );
  oCurrentAbout.style.display = 'block';
  FadeIn( 0 );

}

function ScrollIFrameDn() {
  parent.frames[0].scrollBy( 0, 2 );
  vTimeoutID = setTimeout( 'ScrollIFrameDn()', 1 );
}

function ScrollIFrameUp() {
  parent.frames[0].scrollBy( 0, -2 );
  vTimeoutID = setTimeout( 'ScrollIFrameUp()', 1 );
}

function ScrollToTop() {
  parent.frames[0].scrollTo( 0, 0 );
}

function ScrollToBtm() {
  parent.frames[0].scrollTo( 0, 99999 );
}

function StopScrolling() {
  clearTimeout( vTimeoutID ); /* Call twice to enforce */
  clearTimeout( vTimeoutID );
}
