/* 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 */

/*
To change the values in the setupLinks function below.
You will notice there are two arrays for each of Titles and
Links. Currently there are 3 items in each array, but you can easily
expand on that by adding to the array. For example, to add a 4th record,
you would simply include the following 2 lines at the end of setupLinks
function:

arrLinks[3] = "someURL.htm";
arrTitles[3] = "Some title";
*/
function setupLinks() {
  arrTitles[0] = "<a href=\"http://www.brainstormsw.com/testimonials.html#0\">Real Estate Agent</a><br />&quot;I have found BrainStorm useful as a study aid&quot;<br />&quot;It helps me to see how the articles are organized and to understand the material better than just skimming alone&quot;";
  arrTitles[1] = "<a href=\"http://www.brainstormsw.com/testimonials.html#1\">Graduate Student</a><br />&quot;I used BrainStorm a lot for drafting my paper&quot;<br />&quot;I love your program&quot;";
  arrTitles[2] = "<a href=\"http://www.brainstormsw.com/testimonials.html#2\">College Professor, New York</a><br />&quot;Brainstorm is my all-purpose tool for drafting, storing, and finding text, and organizing ideas&quot;<br />&quot;I have found nothing else with such a useful blend of simplicity and power&quot;";
  arrTitles[3] = "<a href=\"http://www.brainstormsw.com/testimonials.html#3\">Analyst-Programmer, Webmaster and Network Administrator</a><br />&quot;BrainStorm helps me plan and structure or quickly record ideas&quot;<br />&quot;I don\'t even need to grab my mouse as the keyboard shortcuts are so well thought-out. It's a great tool\!&quot;";
  arrTitles[4] = "<a href=\"http://www.brainstormsw.com/testimonials.html#4\">Online MBA Student</a><br />&quot;I use Brainstorm to organise my online course materials&quot;<br />&quot;I\'d be lost without it&quot;";
  arrTitles[5] = "<a href=\"http://www.brainstormsw.com/testimonials.html#5\">IT Manager</a><br />&quot;I used BrainStorm to plan the implementation of two full pathology laboratory systems&quot;<br />&quot;It has proved absolutely invaluable&quot;";
  arrTitles[6] = "<a href=\"http://www.brainstormsw.com/testimonials.html#6\">Tri Coach</a><br />&quot;I use BrainStorm for writing&quot;<br />&quot;One thing I like about Brainstorm vs other programs is that I can see both the current topic and the entire article so that the current paragraph is set in its own context&quot;";
  arrTitles[7] = "<a href=\"http://www.brainstormsw.com/testimonials.html#7\">Engineering Manager</a><br />&quot;I use brainstorm exclusively for personal matters&quot;<br />&quot;I like Brainstorm primarily because it runs from the USB and has proven stable and un-buggy&quot;";
  arrTitles[8] = "<a href=\"http://www.brainstormsw.com/testimonials.html#8\">Associate Professor</a><br />&quot;I am a FANATICAL user of Brainstorm&quot;<br />&quot;BrainStorm becomes part of the scenery. Why? Well, simply because it quietly does its job and doesn't make a fuss\!&quot;";
  arrTitles[9] = "<a href=\"http://www.brainstormsw.com/testimonials.html#9\">History Graduate Student</a><br />&quot;I use BrainStorm mostly for preparing for courses that I teach&quot;<br />&quot;I love BrainStorm&quot;";
  }

var m_iInterval;
var m_Height;
//window.onload = wl;
var iScroll=0;

var arrTitles;

var arrCursor = 0;

var arrMax;
window.onload=wl;

function wl() {
  m_iInterval = setInterval(ontimer, 4);
  var base = document.getElementById("jump_base");

  m_Height = base.offsetHeight;

  var divi = parseInt(m_Height/5);
  m_Height = divi*5;

  var td1 = document.getElementById("td1");
  var td2 = document.getElementById("td2");
  var td3 = document.getElementById("td3");
  td1.height = m_Height-5;
  td2.height = m_Height-5;
  td3.height = m_Height-5;

  arrLinks = new Array();
  arrTitles = new Array();

  setupLinks();
  arrMax = arrTitles.length-1;
  setLink();
}
  function setLink() {
  var ilink = document.getElementById("jump_link");
  ilink.innerHTML = arrTitles[arrCursor];
}
function ontimer() {
  var base = document.getElementById("jump_base");
  iScroll+=5;
  if (iScroll>(m_Height*2)) {
    iScroll=0;
    arrCursor++;
    if (arrCursor>arrMax)
      arrCursor=0;
    setLink();
  }
  if (iScroll==m_Height) {
    pause();
    m_iInterval = setTimeout(resume, 4000);
  }
  base.scrollTop=iScroll;
}
function pause() {
  clearInterval(m_iInterval);
}
function resume() {
  m_iInterval = setInterval(ontimer, 5);
}

