scrollStep=1

timerLeft=""
timerRight=""

function toLeft(id){
  document.getElementById(id).scrollLeft=0
}

function scrollDivLeft(id){
  //document.getElementById("scroller").style.width=get_current_width(document.getElementById("scroller1"))+'px';
  clearTimeout(timerRight) 
  document.getElementById(id).scrollLeft+=scrollStep
  timerRight=setTimeout("scrollDivLeft('"+id+"')",10)
}

function scrollDivRight(id){
  //document.getElementById("scroller").style.width=get_current_width(document.getElementById("scroller1"))+'px';
  clearTimeout(timerLeft)
  document.getElementById(id).scrollLeft-=scrollStep
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10)
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth
}

function stopMe(){
  clearTimeout(timerRight) 
  clearTimeout(timerLeft)
}

function get_current_style($element,$property)
  {
  var ee,$i;
  try
    {
    var $cs=document.defaultView.getComputedStyle($element,'');
    $val=$cs.getPropertyValue($property);
    }
  catch(ee)
    {
    $property=$property.split("-");
    for($i=1;$i<$property.length;$i++) 
      $property[$i]=$property[$i].toUpperCase();
    $property=$property.join("");
    $val=$element.currentStyle.getAttribute($property);
    }
  return $val;
  }


	function style2px(hodnota)
  {
  if (hodnota) 
    return Number(hodnota.substr(0,hodnota.indexOf("px")));
  else return 0
  }


function get_current_width($element)
  {
  var ee;
  try
    {
    var $cs=document.defaultView.getComputedStyle($element,'');
    $val=style2px($cs.getPropertyValue("width"));
    }
  catch(ee)
    {
    $val=($element.offsetWidth);
    if($val<0)$val=0;
    }
  return $val;
  }

