/* 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/ */

scrollStep=2

timerLeft=""
timerRight=""
obj=""
breite=""
items=""



function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  clearTimeout(timerRight)
   
  if( obj =="" )
      obj=document.getElementById(id)
      
  if( !items )
      items=document.getElementsByClassName("licontent")
      
  if( !breite )
      breite=items[0].offsetWidth*items.length;
      
  if( obj.clientWidth < breite &&
      ( breite - obj.scrollLeft ) > obj.clientWidth )
  {
      obj.scrollLeft+=scrollStep
      timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
  }
}

function scrollDivRight(id){
  clearTimeout(timerLeft)

      document.getElementById(id).scrollLeft-=scrollStep
      timerLeft=setTimeout("scrollDivRight('"+id+"')",10)

}

function toRight(id){
  //document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
  
  if( obj =="" )
      obj=document.getElementById(id)
      
  if( !items )
      items=document.getElementsByClassName("licontent")
      
  if( !breite )
      breite=items[0].offsetWidth*items.length;
      
  document.getElementById(id).scrollLeft = breite - document.getElementById(id).clientWidth
}

function stopMe(){
    obj=""
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
}