<!------começa aqui--------->
<SCRIPT language=JavaScript>
var timeout = null
var funcao = null
function init() {
if(funcao=='1'||funcao==null) {
sobe()
}
else if(funcao=='2') {
desce()
}
else if(funcao=='3') {
frente()
}
else if(funcao=='4') {
tras()
}
}
function sobe() {
funcao = 1
tempo = setTimeout("sobe()", 1)
timeout = 1
var divi = div.style
var action = -5
divi.xpos = parseInt(divi.top)
if(divi.xpos==80) {
clearTimeout(tempo)
frente()
}
divi.xpos += action
divi.top = divi.xpos
}
function desce() {
funcao = 2
time = setTimeout("desce()", 1)
timeout = 2
var divo = div.style
var action = 5
divo.ypos = parseInt(divo.top)
if(divo.ypos==350) {
clearTimeout(time)
tras()
}
divo.ypos += action
divo.top = divo.ypos
}
function frente() {
funcao = 3
terceiro = setTimeout("frente()", 1)
timeout = 3
var divs = div.style
var action = 5
divs.zpos = parseInt(divs.left)
if(divs.zpos==600) {
clearTimeout(terceiro)
desce()
}
divs.zpos += action
divs.left = divs.zpos
}
function tras() {
funcao = 4
quarto = setTimeout("tras()", 1)
timeout = 4
var divx = div.style
var action = -5
divx.cpos = parseInt(divx.left)
if(divx.cpos==180) {
clearTimeout(quarto)
sobe()
}
divx.cpos += action
divx.left = divx.cpos
}
</SCRIPT>
<DIV id=div style="LEFT: 180px; POSITION: absolute; TOP: 350px">
<IMG src="http://www.codigofonte.com.br/img/logo.gif" width="200" height="30">
</DIV>
<DIV style="LEFT: 350px; POSITION: absolute; TOP: 200px"><INPUT style="LEFT: 0px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 0px" onclick="init(); this.style.visibility='hidden'; stop.style.visibility='visible'; this.value='Reiniciar'" type=button value=Iniciar name=comeca><BR>
<INPUT style="LEFT: 0; VISIBILITY: hidden; WIDTH: 100px; POSITION: absolute; TOP: 0" onclick="if(timeout=='1') { clearTimeout(tempo) } else if(timeout=='2') { clearTimeout(time) } else if(timeout=='3') { clearTimeout(terceiro) } else if(timeout=='4') { clearTimeout(quarto) }; comeca.style.visibility='visible'; this.style.visibility='hidden'" type=button value=Parar name=stop>
</DIV>
<!----------termina aqui------->