/*
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 4 items in each array, but you can easily
expand on that by adding to the array. For example, to add a 5th 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] = "?page_id=35";
	arrLinks[1] = "?page_id=35";
	arrLinks[2] = "?page_id=35";
	arrLinks[3] = "?page_id=35";
	arrLinks[4] = "?page_id=35";
	arrLinks[5] = "?page_id=35";
	

  arrTitles[0] = "&quot;This author and home-design columnist is smart, seasoned, savvy, and unwilling to settle for anything less than &#39;just right&#39;...In the end, the true test of a home-design book is whether it propels the reader to action.  Jameson propelled me to stop midway through her book to rearrange my furniture.&quot;<br /><br /><em> - Los Angeles Times</em>";

  arrTitles[1] = "&quot;Marni Jameson says that creating the ideal home isn&#39;t easy, even for   a home-design columnist such as herself. By detailing real-life scenarios and experiences, Jameson shares her point of view in a humorous yet straightforward fashion...She offers how-to tips, design options, strategies, time-saver pointers and expert advice on common remodeling issues.&quot;<br /><br /><em> - Chicago Tribune</em>";

  arrTitles[2] = "&quot;...the book reads a bit like a novel as Jameson recounts anecdotes and cute stories involving contractors and her husband, Dan.  By going through the trials and tribulations of making a perfect home, Jameson can teach some valuable lessons and how to laugh.  She has created a memorable book with useful tips surrounded by a funny, relatable story.&quot;<br /><br /><em> - Newsday</em>";

  arrTitles[3] = "&quot;As a national home d&eacute;cor columnist, Marni Jameson finds herself under constant scrutiny...Her life, like her Denver-area hose, is an open book.  So she wrote one...baring her own renovation false starts and foibles to the world. And that&#39;s precisely what makes this volume work, both as a good read and a home-to tome:  She&#39;s one of us.&quot;<br /><br /><em> -  Times Picayune (New Orleans)</em>";
  
  arrTitles[4] = "&quot;Jameson perfectly translates her wryly humorous style to book form. She delves into everything from finding a style and picking paint colors to creating the perfect guest room, all while watching your budget&quot;<br /><br /><em> - Des Moines Register</em>";
  
  arrTitles[5] = "&quot;Clever, engaging and revealing...Jameson&#39;s book is bursting with so many practical insider tips-some from experience and some from interviews with experts-that it&#39;s worth reading even if you only plan to renovate one room at a time with a modest budget.&quot;<br /><br /><em> - Hartford Courant</em>";

}

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


var arrLinks;
var arrTitles;
var arrCursor = 0;
var arrMax;
window.onload=wl;

function wl() {
  m_iInterval = setInterval(ontimer, 50);

  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 = 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+=5;
  if (iScroll>(m_Height*2)) {
    iScroll=0;
    arrCursor++;
    if (arrCursor>arrMax)
      arrCursor=0;
    setLink();
  }
  if (iScroll==m_Height) {
    pause();
    m_iInterval = setTimeout(resume, 12000);
  }
  base.scrollTop=iScroll;
}


function pause() {
  clearInterval(m_iInterval);
}


function resume() {
  m_iInterval = setInterval(ontimer, 50);
}
