var speed = 100 

var pause = 1000

var timerID = null 
var bannerRunning = false 

var ar = new Array() 

ar[0] = "Welcome to 1000 Jokes of the Day." 
ar[1] = "Please consider subscribing to this free, daily service." 
ar[2] = "Squeaky-clean humor ... The kind you'd tell your mother or grandchildren."
ar[3] = "There are hundreds of humorous tales and special pages found here"
ar[4] = "Take time to explore them."
ar[5] = "1000 Jokes of the Day has several specialities.  You'll find them all in the library ..."
ar[6] = "Parrot tales ..."
ar[7] = "Russian tales ..."
ar[8] = "Lawyer tales ..."
ar[9] = "Philosophers ..."
ar[10] = "Religious ..."
ar[11] = "British ..."
ar[12] = "At Sea ..."
ar[13] = "Ma and Pa ..."
ar[14] = "Education ..."
ar[15] = "Medical ..."
ar[16] = "Famous Folk ..."
ar[17] = "Military ..."
ar[18] = "Business"
ar[19] = "I'd love to have you as a subscriber!"

var currentMessage = 0 

var offset = 0 

function stopBanner() { 
        if (bannerRunning) 
                clearTimeout(timerID) 

        bannerRunning = false 
} 

function startBanner() { 
        stopBanner() 

        showBanner() 
} 

function showBanner() { 
        var text = ar[currentMessage] 

        if (offset < text.length) { 
                if (text.charAt(offset) == " ") 
                        offset++                         

                var partialMessage = text.substring(0, offset + 1)  

                window.status = partialMessage 

                offset++ 

                timerID = setTimeout("showBanner()", speed) 

                bannerRunning = true 
        } else { 
                offset = 0 

                currentMessage++ 

                if (currentMessage == ar.length) 
                        currentMessage = 0 

                timerID = setTimeout("showBanner()", pause) 

                bannerRunning = true 
        } 
} 
