
var message = new Array()
message[0]="1. rightview"
message[1]="2. rightthinking"
message[2]="3. rightmindfulness"
message[3]="4. rightspeech "
message[4]="5. rightaction"
message[5]="6. rightdiligence"
message[6]="7. rightconcentration"
message[7]="8. rightlivelihood"

var i_message=0

// Configure the left and top margin of the text (pixels).
var covertop=110
var coverleft=610

// 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=86

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=150
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=50

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()
    }
}

