/* 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] = "";
arrTitles[3] = "Some title";
*/
function setupLinks() {
  
           arrLinks[0] = "events5.html";
  arrTitles[0] = "<strong>Spot Admissions of Algonquin College, Canada<strong>[Read More]</strong><br></br><strong>Date:</strong> 11th October 2011, Thusday <strong> Time:</strong> 3 to 5 pm <strong> <br></br> Location:</strong> Ahmedabad <strong>Contact:</strong> 079 2630 4999 / 5999, 9879066300.<br></br> <strong> Apply to Algonquin College for January 2012 intake. Save CAD$ 95 </strong><br></br>";
		   arrLinks[1] = "events2.html";
  arrTitles[1] = "<strong>Apply soon to Australia: New easy Student Visa rules.<strong>[Read More]</strong><br></br><strong>Contact:</strong> 079 2630 4999 / 5999, 9879066300.<br></br>";
  arrLinks[2] = "";
  arrTitles[2] = "<strong>Great news for students planning to study in UK (Tier 1 PSW will continue after April 2011) </strong><br>UK Border Agency announced that International students will be able to apply for Tier 1 PSW (Post Study Work Visa) even after April 2011. International students have golden chance to study and work in UK. Students can have an opportunity to get PSW after successful completion of Bachelor degree and Master degree course.</br><br> For further detailed information</br> <strong>Contact:</strong> 079 2630 4999 / 5999, 9879066300 or Email: visa@educationworld.co.in<br></br>";
  
  arrLinks[3] = "events.html";
  arrTitles[3] = "<strong>Apply soon to Canada for May and September 2011 intake.<strong>[Read More]</strong><br></br><strong>Contact:</strong> 079 2630 4999 / 5999, 9879066300.<br></br>";
    arrLinks[4] = "events3.html";
  arrTitles[4] = "<strong>Opportunity for Nursing Students.</strong> <br>We would like to give you information regarding unique opportunity for students who wish to study Nursing courses in UK.  <strong>[Read More]</strong><br></br><strong>Contact:</strong> 079 2630 4999 / 5999, 9879066300.<br></br>";
  arrLinks[5] = "events4.html";
  arrTitles[5] = "<strong>Italy:</strong> Options for Design related courses in world famous country. <strong>[Read More]</strong><br></br><strong>Contact:</strong> 079 2630 4999 / 5999, 9879066300.<br></br>";
  }

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+=1;
  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, 20);
}

