var cur_pos=new Object();
cur_pos[1]=0;
cur_pos[2]=0;
var to_move=new Object();
var staff_tm=30;
function do_move(id)
{
  var pg=document.getElementById("staffpage"+id);
  if (Math.abs(to_move[id]-cur_pos[id])<1)
  {
    cur_pos[id]=to_move[id];
    pg.style.left=cur_pos[id];
    set_nav(id);
  }
  else
  {
    var move_step=((to_move[id]-cur_pos[id])/3);
    cur_pos[id]=cur_pos[id]+move_step;
    pg.style.left=cur_pos[id];
    setTimeout("do_move("+id+")",staff_tm);
  }
}
function staff_move_right(id)
{
  hide_nav(id);
  to_move[id]=cur_pos[id]-192;
  setTimeout("do_move("+id+")",staff_tm);
}
function staff_move_left(id)
{
  hide_nav(id);
  to_move[id]=cur_pos[id]+192;
  setTimeout("do_move("+id+")",staff_tm);
}
function hide_nav(id)
{
  document.getElementById("larrow"+id).style.visibility="hidden";
  document.getElementById("rarrow"+id).style.visibility="hidden";
}
function set_nav(id)
{
  var pg=document.getElementById("staffpage"+id);
  if (cur_pos[id]==0)
    document.getElementById("larrow"+id).style.visibility="hidden";
  else
    document.getElementById("larrow"+id).style.visibility="visible";
  if ((pg.offsetWidth+cur_pos[id])>192)
    document.getElementById("rarrow"+id).style.visibility="visible";
  else
    document.getElementById("rarrow"+id).style.visibility="hidden";

}
