/* 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] = "index.php?section_id=1";
  //arrTitles[0] = "Our experience with RealStar was superb! What impressed us most was their professionalism and knowledge of the local market. We highly recommend RealStar to others.<br><span class='newsdate'>- John Lim, Group CEO of ARA</span>";
  arrTitles[0] = "Our experience with RealStar was superb! What impressed us most was their professionalism and knowledge of the local market. We highly recommend RealStar to others.<br><br><span class='newsdate'>- John Lim, Group CEO of ARA</span>";

  arrLinks[1] = "index.php?section_id=1";
 //arrTitles[1] = "<br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><span class='newsdate'></span>";
  arrTitles[1] = "<br><br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><br><span class='newsdate'></span>";


  arrLinks[2] = "index.php?section_id=1";
  //arrTitles[2] = "Working with RealStar has been insightful and rewarding. Their professionalism and knowledge of the local market is a tremendous asset. I appreciate their courtesy and attentiveness...<br><span class='newsdate'>- Mr Chia Chor Meng, Chairman CKL Holdings Pte Ltd</span>";
  arrTitles[2] = "Working with RealStar has been insightful and rewarding. Their professionalism and knowledge of the local market is a tremendous asset....<br><br><span class='newsdate'>- Mr Chia Chor Meng, Chairman CKL Holdings Pte Ltd</span>";

 arrLinks[3] = "index.php?section_id=1";
 //arrTitles[3] = "<br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><span class='newsdate'></span>";
  arrTitles[3] = "<br><br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><br><span class='newsdate'></span>";

  arrLinks[4] = "index.php?section_id=1";
  //arrTitles[4] = "The staff from RealStar contacted me promptly, found me a home I could afford that was truly beyond my wildest dreams and took care of details that I never knew a realtor would handle...<br><span class='newsdate'>- Karen Soden, Hong Kong Business Owner</span>";
  //arrTitles[4] = "The staff from RealStar contacted me promptly, found me a home I could afford that was truly beyond my wildest dreams and took care of...<br><br><span class='newsdate'>- Karen Soden, Hong Kong Business Owner</span>";

  arrLinks[5] = "index.php?section_id=1";
  //arrTitles[5] = "<br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><span class='newsdate'></span>";
  arrTitles[5] = "<br><br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><br><span class='newsdate'></span>";

  arrLinks[6] = "index.php?section_id=1";
  arrTitles[6] = "We all know that a team is only as good as its members. RealStar has star players - accomplished, energetic, driven and thoughtful...<br><br><span class='newsdate'>- Victor Soh, Director of Fortune Development Pte Ltd</span>";

  arrLinks[7] = "index.php?section_id=1";
//arrTitles[7] = "<br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><span class='newsdate'></span>";
  arrTitles[7] = "<br><br><br>RealStar - Is The Proud Winner Of Singapore Prestige Award 2009.<br><br><span class='newsdate'></span>";

}

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, 30);
  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, 10000);
  }
  base.scrollTop=iScroll;
}
function pause() {
  clearInterval(m_iInterval);
}
function resume() {
  m_iInterval = setInterval(ontimer, 30);
}

