// JavaScript Document
<!-- Paste this code into an external JavaScript file named: vertical.js  -->

/* 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://www.cjpb.org.uy/nuevositio/novedades/20100720cambioNumeracionTelefonos.asp";
 arrTitles[0] = "Nuevo plan nacional de numeración telefónica - entrada en vigencia<br><font size=1>(20/07/2010)</font>"
arrLinks[1] = "http://www.cjpb.org.uy/nuevositio/novedades/20100720cambioNumeracionTelefonosInstituto.asp";
 arrTitles[1] = "Nuevo plan nacional de numeración telefónica - cambios en numeración central telefónica Instituto<br><font size=1>(20/07/2010)</font>"
arrLinks[2] = "http://www.cjpb.org.uy/nuevositio/otrosbeneficios/biblioteca/biblioteca_nvos_libros.asp";
 arrTitles[2] = "Libros incorporados a la biblioteca del Instituto<br><font size=1>(19/07/2010)</font>"
arrLinks[3] = "http://www.cjpb.org.uy/nuevositio/novedades/20100514discursoPresidente85Aniversario.asp";
 arrTitles[3] = "Mensaje del Presidente del Instituto en ocasión del 85ª aniversario<br><font size=1>(14/05/2010)</font>"
arrLinks[4] = "http://www.cjpb.org.uy/nuevositio/informacion/memoria_y_balance/memoriaBalance2009/index.asp";
 arrTitles[4] = "Memoria y Balance General 2009<br><font size=1>(23/04/2010)</font>"
arrLinks[5] = "http://www.cjpb.org.uy/nuevositio/informacion/informacion_contable/dictamenStavrosSobreEstadosFinancierosConsolidados2009.asp";
 arrTitles[5] = "Dictamen Stavros Moyal y Asociados sobre Estados Financieros Consolidados al 31/12/2009<br><font size=1>(13/04/2010)</font>"  
arrLinks[6] = "http://www.cjpb.org.uy/nuevositio/otrosbeneficios/pmos_personales/pmosPersonales.asp";
 arrTitles[6] = "Nuevos plazos en préstamos personales para afiliados Activos y Pasivos<br><font size=1>(14/01/2010)</font>"  
arrLinks[7] = "http://www.cjpb.org.uy/nuevositio/informacion/comunicados/instituciones_anteriores/20091215Comunicado2009011.asp";
 arrTitles[7] = "Instituciones - Comunicado 011/2009<br><font size=1>(15/12/2009)</font>"  
arrLinks[8] = "http://www.cjpb.org.uy/nuevositio/informacion/instituciones/calendario_vtos.asp";
 arrTitles[8] = "Instituciones - Calendario pagos y nóminas años 2009 - 2010<br><font size=1>(14/12/2009)</font>"  
}


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, 100);
  var base = document.getElementById("jump_base");

  m_Height = base.offsetHeight;

  var divi = parseInt(m_Height/6);
  m_Height = divi*6;

  var td1 = document.getElementById("td1");
  var td2 = document.getElementById("td2");
  var td3 = document.getElementById("td3");
  td1.height = m_Height-6;
  td2.height = m_Height-6;
  td3.height = m_Height-6;

  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+=6;
  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, 200);
}