/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Mr J | http://www.huntingground.net/ */

/*
 * 100303 Modified by Dimitris Trakas for vertical scrolling
 * and custom sctoll step.
 */

scrollStep=1

timerLeft=""
timerRight=""
timerUp=""
timerDown=""

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  scrollDivLeftStep(id,scrollStep)
}

function scrollDivRight(id){
  scrollDivRightStep(id,scrollStep)
}

function scrollDivLeftStep(id,customScrollStep){
  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=customScrollStep
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivRightStep(id,customScrollStep){
  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=customScrollStep
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
  clearTimeout(timerUp) 
  clearTimeout(timerDown)
}


/*
 * Dtra code starts here
 */

function toUp(id){
  document.getElementById(id).scrollTop=0
}

function scrollDivUp(id){
  scrollDivUpStep(id,scrollStep);
}

function scrollDivDown(id){
  scrollDivDownStep(id,scrollStep);
}

function scrollDivUpStep(id,customScrollStep){
  clearTimeout(timerUp) 
  document.getElementById(id).scrollTop+=customScrollStep
  timerUp=setTimeout("scrollDivUp('"+id+"')",10)
}

function scrollDivDownStep(id,customScrollStep){
  clearTimeout(timerDown)
  document.getElementById(id).scrollTop-=customScrollStep
  timerDown=setTimeout("scrollDivDown('"+id+"')",10)
}


function toDown(id){
  document.getElementById(id).scrollTop=document.getElementById(id).scrollHeight
}

