var i_message=0

// The trick of this script is a simple gif-image
// consisting of two colors: black and white dots.
// The black dots are transparent.
// By wipeing this gif-image back and forth over the
// textmessages you get an attractive dissolving effect.
// This image is called slidefader.gif.

// Configure the left and top margin of the text (pixels).
var covertop=0
var coverleft=18

// Configure the size of the wipeing gif-image. 
// If you change the size you should create a new image too.
// The coverheight also represents the height of the textzone.
var coverwidth=1200
var coverheight=220

var texttop=covertop
var textleft=coverleft
//configure width of text effect
//be sure to change the corresponding width attribute above in the <style> tag to match
var textwidth=200
var textheight=coverheight

var cliptop=0
var clipright=textwidth
var clipbottom=coverheight
var clipleft=0
var clippoints

// Configure the speeds of the wipeing effect
var step=10
var pause=100

var timer

function init() {
    if (document.all) {
	    document.all.text.style.posTop=texttop
        document.all.text.style.posLeft=textleft
        document.all.cover.style.posTop=covertop
        document.all.cover.style.posLeft=coverleft
        clipleft=0
        fadeout()
    }
}

function fadeout() {
    if (document.all.cover.style.posLeft >=(-coverwidth+textwidth+coverleft+step)) {   
        clipleft+=step
        clipright=clipleft+textwidth
        clippoints="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		document.all.cover.style.clip=clippoints
        document.all.cover.style.posLeft-=step
        timer= setTimeout("fadeout()",pause)
    }
    else {
        clearTimeout(timer)
        i_message++
        if (i_message>=message.length) {i_message=0}
        text.innerHTML=message[i_message]   
        fadein()
 
    }
}

function fadein() {
    if (document.all.cover.style.posLeft <=coverleft) {   
        clipleft-=step
        clipright=clipleft+textwidth
        clippoints="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
		document.all.cover.style.clip=clippoints
        document.all.cover.style.posLeft+=step
        timer= setTimeout("fadein()",pause)
    }
    else {
        clearTimeout(timer)
        init()
    }
}
