var Last=""
var current=""

function swaplayer(thislayer){
var elm=document.getElementById(thislayer)
var last_elm=document.getElementById(Last)
elm.style.top=0 // set layer to top of container

if(Last!=""&&Last!=thislayer){
last_elm.style.visibility="hidden"
}
elm.style.visibility="visible"
Last=thislayer
current=thislayer
}

setTimeout("swaplayer('One')",1000) // show initial layer

var timer=""
var speed=5
var scroll_rate=3
var step=""
var dir=""
var posnow=""
var current_elm=""



function movedown(){step=-scroll_rate;dir=0;motion()}
function moveup(){step=scroll_rate;dir=1;motion()}

function motion(){
if(current==""){return}
current_elm=document.getElementById(current)
clearTimeout(timer)
posnow=parseInt(current_elm.style.top)
if(dir==1&& posnow>-5 || dir==0&&posnow<-parseInt(current_elm.scrollHeight)+parseInt(document.getElementById("cont").offsetHeight)){
cease()
}
else{
posnow+=step
current_elm.style.top=posnow
timer=setTimeout("motion()",5)
}
}

function cease(){
clearTimeout(timer)
}

function otop(){
current_elm.style.top=0
}
