﻿var Summaries = new Array();
var Links = new Array();
var Target = new Array();
var tickdelay = 8000
var speed = 5 //px
var msg = 0
var width = 0

function changeticker() {
    tick.style.clip = "rect(0px 0px auto 0px)"
    tick.innerHTML = Summaries[msg]
    link = Links[msg]
    if (link != "") {
        tick.href = Links[msg]
        tick.target = Target[msg]
    }
    msgtick()
}

function msgtick() {
    var msgwidth = tick.offsetWidth
    if (width < msgwidth) {
        width += speed
        tick.style.clip = "rect(0px " + width + "px auto 0px)"
        begin = setTimeout("msgtick()", 20)
    }
    else {
        width = 0
        clearTimeout(begin)
        if (msg == Summaries.length - 1) msg = 0
        else msg++
        setTimeout("changeticker()", tickdelay)
    }
}

function tick() {
    tick = document.getElementById ? document.getElementById("newstick") : document.all["newstick"]
    tickParent = tick.parentNode ? tick.parentNode : tick.parentElement
    if (parseInt(tick.offsetHeight) > 0)
        tickParent.style.height = tick.offsetHeight + 'px'
    else
        setTimeout("tickParent.style.height=tick.offsetHeight+'px'", 100) //delay for Mozilla's sake
    changeticker()
}