

/* 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[2] = "someURL.htm";
arrTitles[2] = "Some title";
*/

//===================================================================================
//Update Links and Text here

//UK links and text
function setupUKLinks() {

  arrLinks[0] = "http://www.pegasus.co.uk/content.asp?PageId=1508&id=1102";
  arrTitles[0] = "5 Aug: <b>Opera II Dashboards webinar</b> - at your desk";
  arrLinks[1] = "http://www.pegasus.co.uk/content.asp?PageId=1508&id=1095";
  arrTitles[1] = "13 Aug: <b>Pegasus CIS webinar: run your contracts profitably</b> - at your desk";
  arrLinks[2] = "http://www.pegasus.co.uk/content.asp?PageId=1508&id=1106";
  arrTitles[2] = "17 Aug: <b>Service & Helpdesk Management webinar</b> - at your desk";



  

}

//IE links and text
function setupIELinks() {
  arrLinks[0] = "http://www.pegasussoftware.ie/content.asp?PageId=1508&id=688";
  arrTitles[0] = "12 Mar: <b>Pegasus CIS Workshop</b>- Dublin Airport";
  arrLinks[1] = "http://www.pegasussoftware.ie/content.asp?PageId=1508&id=687";
  arrTitles[1] = "12 Mar: <b>Opera II Workshop</b>- Dublin Airport";
  arrLinks[2] = "http://www.pegasus.co.uk/content.asp?PageId=1508&id=923";
  arrTitles[2] = "12 June: <b>See Executive Dashboards for yourself!</b> - online";
  arrLinks[3] = "http://www.pegasus.co.uk/content.asp?PageId=1508&id=924";
  arrTitles[3] = "12 June: <b>Sales Pipeline Management Webinar</b> - online";
  arrLinks[4] = "http://www.pegasus.co.uk/content.asp?PageId=1508&id=925";
  arrTitles[4] = "12 June: <b>Document Management Webinar</b> - online";
  
}
//====================================================================================

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, 40);
  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();

  if(window.location.href=="http://www.pegasussoftware.ie/"){
	  setupIELinks();
  }
  else{
	  setupUKLinks();
  }
  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, 4000);
  }
  base.scrollTop=iScroll;
}
function pause() {
  clearInterval(m_iInterval);
}
function resume() {
  m_iInterval = setInterval(ontimer, 80);
}