point.js

var T
var L
var timerM
var timerB

function point(t) {
 if(t==0)
  move_back()
 else {
  T=t
  L=-170
  l.style.pixelLeft=L
  move(t)
 }
}

function move() {
 clearTimeout(timerB)

 L+=30
 if(L>0) {
  L=0
  clear()
 }
 p.style.pixelTop=T-5
 l.style.pixelTop=T+1
 l.style.pixelLeft=L

 timerM=setTimeout("move()",10)
}

function move_back() {
 clearTimeout(timerM)

 if(T<268) {
  T+=2
  if(L>-170)
   L-=30
  if(L<-170)
   L=-170
 }
 else {
  if(L<0)
   L+=20
  if(L>0)
   L=0
 }
 p.style.pixelTop=T
 l.style.pixelTop=T+1
 l.style.pixelLeft=L

 timerB=setTimeout("move_back()",10)
}

function clear() {
 clearTimeout(timerM)
}