/*var scrollStep = 1;
var timerLeft = 0;
var timerRight = 0;
var timerTop = 0;
var timerFoot = 0;

function toLeft(id){
  document.getElementById(id).scrollLeft=0;
}

function scrollDivLeft(id){
  clearTimeout(timerRight);
  document.getElementById(id).scrollLeft += scrollStep;
  timerRight = setTimeout("scrollDivLeft('"+id+"')",10);
}

function toRight(id){
  document.getElementById(id).scrollLeft = document.getElementById(id).scrollWidth;
}

function scrollDivRight(id){
  clearTimeout(timerLeft);
  document.getElementById(id).scrollLeft -= scrollStep;
  timerLeft = setTimeout("scrollDivRight('"+id+"')",10);
}

function toTop(id){
  document.getElementById(id).scrollTop = 0;
}

function scrollDivTop(id){
  clearTimeout(timerTop);
  document.getElementById(id).scrollTop += scrollStep;
  timerTop = setTimeout("scrollDivTop('"+id+"')",10);
}

function toFoot(id){
  document.getElementById(id).scrollTop = document.getElementById(id).scrollHeight;
}

function scrollDivFoot(id){
  clearTimeout(timerFoot);
  document.getElementById(id).scrollTop -= scrollStep;
  timerFoot = setTimeout("scrollDivFoot('"+id+"')",10);
}

function stopMe(){
  clearTimeout(timerRight);
  clearTimeout(timerLeft);
  clearTimeout(timerTop);
  clearTimeout(timerFoot);
}*/
var timerScrolling = 0;

function toLeft(id){
  document.getElementById(id).scrollLeft = 0;
}

function scrollDivLeft(id, step){
    if (step === undefined) {step = 1;}
    clearTimeout(timerScrolling);
    document.getElementById(id).scrollLeft += step;
    timerScrolling = setTimeout("scrollDivLeft('"+id+"',"+step+")",10);
}

function toRight(id){
  document.getElementById(id).scrollLeft = document.getElementById(id).scrollWidth;
}

function scrollDivRight(id, step){
    if (step === undefined) {step = 1;}
    clearTimeout(timerScrolling);
    document.getElementById(id).scrollLeft -= step;
    timerScrolling = setTimeout("scrollDivRight('"+id+"',"+step+")",10);
}

function toTop(id){
  document.getElementById(id).scrollTop = 0;
}

function scrollDivTop(id, step){
    if (step === undefined) {step = 1;}
    clearTimeout(timerScrolling);
    document.getElementById(id).scrollTop += step;
    timerScrolling = setTimeout("scrollDivTop('"+id+"',"+step+")",10);
}

function toFoot(id){
  document.getElementById(id).scrollTop = document.getElementById(id).scrollHeight;
}

function scrollDivFoot(id, step){
    if (step === undefined) {step = 1;}
    clearTimeout(timerScrolling);
    document.getElementById(id).scrollTop -= step;
    timerScrolling = setTimeout("scrollDivFoot('"+id+"',"+step+")",10);
}

function stopScrolling(){
    clearTimeout(timerScrolling);  
}
