

var nd=new Array()
var ww=new Array()
var direction
var running
var thisone

function initrun() {
	ire()
	rewind(5)
}

function ire() {
    nd[5]=0
    ww[5]=1412-450
    nd[0]=0
    direction=1
    running=0
    thisone=0
}

function doo() {
    if (running>0) {
        var dd=document.getElementById('x'+thisone)
        var ss
        if (direction==1) {
            nd[thisone]++
        } else {
            nd[thisone]--
        }
        if (nd[thisone]<0) {
            nd[thisone]=0
            direction=1
        }
        if (nd[thisone]>ww[thisone]) {
            nd[thisone]--
            nd[thisone]--
            direction=0
        }
        dd.style.marginLeft="-"+nd[thisone]+"px"
        setTimeout("doo()",20)
    }
}

function rewind(x) {
    thisone=x
    direction=1
    running=1
    setTimeout("doo()",20)
}

function advance(x) {
    thisone=x
    direction=0
    running=1
    setTimeout("doo()",20)
}

function stopw() {
    running=0
}

function pauser() {
	if (running>0) {
		running=0
	} else {
		running=1
		setTimeout("doo()",20)
	}
}

