// JavaScript Document
/* 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() {
  arrLinks[0] = "http://forums.webdeveloper.com/forumdisplay.php?s=&forumid=3";
  arrTitles[0] = "If you have any questions, be sure to visit our forums.";
  arrLinks[1] = "http://javascript.internet.com/new/";
  arrTitles[1] = "Don't miss anything - check our new additions.";
  arrLinks[2] = "http://www.webreference.com/programming/javascript/diaries/";
  arrTitles[2] = "Want to learn JavaScript? Start at the beginning.";
}

var m_iInterval;
var m_Height;

var iScroll=0;

var arrLinks;
var arrTitles;

var arrCursor = 0;

var arrMax;
//window.onload=wl;
function wl() {
  m_iInterval = setInterval(ontimer, 100);
  var base = document.getElementById("jump_base");

  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 = arrLinks.length-1;
  setLink();
  
}
function setLink() {
  var ilink = document.getElementById("jump_link");
  ilink.innerHTML = arrTitles[arrCursor];
  ilink.href = arrLinks[arrCursor];
}
function ontimer() {
  var base = document.getElementById("jump_base");
  iScroll+=10;
  if (iScroll>(m_Height)) {
    iScroll=0;
    arrCursor++;
    if (arrCursor>arrMax)
      arrCursor=0;
    setLink();
  }
  if (iScroll==m_Height) {
    pause();
    
  }
  base.scrollTop=iScroll;
}
function pause() {
  clearInterval(m_iInterval);
}

function wlu() {

  m_iInterval = setInterval(ontimeru, 100);
  var base = document.getElementById("jump_base");

  arrLinks = new Array();
  arrTitles = new Array();

  setupLinks();
  arrMax = arrLinks.length-1;
  setLink();
}
function setLink() {
  var ilink = document.getElementById("jump_link");
  ilink.innerHTML = arrTitles[arrCursor];
  ilink.href = arrLinks[arrCursor];
}
function ontimeru() {
  var base = document.getElementById("jump_base");
  iScroll-=10;
  if (iScroll>(m_Height)) {
    iScroll=0;
    arrCursor++;
    if (arrCursor>arrMax)
      arrCursor=0;
    setLink();
  }
  if (iScroll==m_Height) {
    pause();
   
  }
  base.scrollTop=iScroll;
}

/*Right content scroll*/

function setupLinksrg() {
  arrLinksrg[0] = "http://forums.webdeveloper.com/forumdisplay.php?s=&forumid=3";
  arrTitlesrg[0] = "If you have any questions, be sure to visit our forums.";
  arrLinksrg[1] = "http://javascript.internet.com/new/";
  arrTitlesrg[1] = "Don't miss anything - check our new additions.";
  arrLinksrg[2] = "http://www.webreference.com/programming/javascript/diaries/";
  arrTitlesrg[2] = "Want to learn JavaScript? Start at the beginning.";
}

var m_iIntervalrg;
var m_Heightrg;

var iScrollrg=0;

var arrLinksrg;
var arrTitlesrg;

var arrCursorrg = 0;

var arrMaxrg;
//window.onload=wl;

function wlrg() {
  m_iIntervalrg = setInterval(ontimerrg, 100);
  var baserg = document.getElementById("scrollit");

  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;

  arrLinksrg = new Array();
  arrTitlesrg = new Array();

  setupLinksrg();
  arrMaxrg = arrLinksrg.length-1;
  setLinkrg();
}
function setLinkrg() {
  var ilinkrg = document.getElementById("");
  ilinkrg.innerHTML = arrTitlesrg[arrCursorrg];
  ilinkrg.href = arrLinksrg[arrCursorrg];
}
function ontimerrg() {
  var baserg = document.getElementById("scrollit");
  iScrollrg+=10;
  if (iScrollrg>(m_Height)) {
    iScrollrg=0;
    arrCursorrg++;
    if (arrCursorrg>arrMaxrg)
      arrCursorrg=0;
    setLinkrg();
  }
  if (iScrollrg==m_Heightrg) {
    pauserg();
    
  }
  baserg.scrollTop=iScrollrg;
}
function pauserg() {
  clearInterval(m_iIntervalrg);
}

function wlurg() {

  m_iIntervalrg = setInterval(ontimerurg, 100);
  var baserg = document.getElementById("scrollit");

  arrLinksrg = new Array();
  arrTitlesrg = new Array();

  setupLinksrg();
  arrMaxrg = arrLinksrg.length-1;
  setLinkrg();
}
function setLinkrg() {
  var ilinkrg = document.getElementById("");
  ilinkrg.innerHTML = arrTitlesrg[arrCursor];
  ilinkrg.href = arrLinksrg[arrCursor];
}
function ontimerurg() {
  var baserg = document.getElementById("scrollit");
  iScrollrg-=10;
  if (iScrollrg>(m_Heightrg)) {
    iScrollrg=0;
    arrCursorrg++;
    if (arrCursorrg>arrMaxrg)
      arrCursorrg=0;
    setLinkrg();
  }
  if (iScrollrg==m_Heightrg) {
    pauserg();
   
  }
  baserg.scrollTop=iScrollrg;
}

