﻿
currentvalue =1;   
scrollStep=1;

timerLeft=""
timerRight=""

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){

  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=scrollStep
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivRight(id){

  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=scrollStep
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
}

function scrollDivBottom(id){

  clearTimeout(timerRight)

  document.getElementById(id).scrollTop -= scrollStep
  timerRight=setTimeout("scrollDivBottom('"+id+"')",20)
 
}
function flexScroll(id){

  clearTimeout(timerRight)
if(currentvalue == document.getElementById(id).scrollTop)
 document.getElementById(id).scrollTop = 0;
  currentvalue = document.getElementById(id).scrollTop;

  document.getElementById(id).scrollTop += scrollStep
  timerRight=setTimeout("flexScroll('"+id+"')",70)
 
}
function Test(id)
{
  clearTimeout(timerRight)

  document.getElementById(id).scrollTop -= scrollStep
  timerRight=setTimeout("Test('"+id+"')",20)

}
function loopDelay(numberMillis) { 
var now = new Date(); 
var exitTime = now.getTime() + numberMillis; 
while (true) { 
now = new Date(); 
if (now.getTime() > exitTime) 
return; 
} 
} 


function scrollDivBottom(id){
  clearTimeout(timerLeft)
  document.getElementById(id).scrollBottom-=scrollStep
  timerLeft=setTimeout("scrollDivBottom('"+id+"')",10)
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
}