function setupLinks() { arrLinks[0] = "http://questure.poliziadistato.it/it/Bari/articolo/15716065b0c04907b884493898"; arrTitles[0] = "28enne arrestato dalla Polizia di Stato a Corato"; arrLinks[1] = "http://questure.poliziadistato.it/it/Torino/articolo/6886065ae56bf1a3127023417"; arrTitles[1] = "Torino: tenta di pagare un taxi con la tessera del reddito di cittadinanza, ma ha finito i soldi"; arrLinks[2] = "http://questure.poliziadistato.it/it/Torino/articolo/6886065adc880d5b091521095"; arrTitles[2] = "Torino: Ladro del “fai da te” arrestato"; arrLinks[3] = "http://questure.poliziadistato.it/it/Torino/articolo/6886065ad5c3caec418195219"; arrTitles[3] = "Torino: preleva denaro dal conto di un’anziana ricoverata nella RSA in cui lavora"; arrLinks[4] = "http://questure.poliziadistato.it/it/ViboValentia/articolo/12266065aca50be9e029735226"; arrTitles[4] = "Automobilista investe ciclista e fugge"; } var m_iInterval; var m_Height; 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/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, 6000); } base.scrollTop=iScroll; } function pause() { clearInterval(m_iInterval); } function resume() { m_iInterval = setInterval(ontimer, 100); }