var tid1;
var tid2;

function Initialize()
  {
  document.getElementById("paseks").style.left='23px';
  }

function ClearStr(string)
{
  p=string.indexOf('p');
  return(string.substring(0,p));
}

function countWidth(obiekt)
  {
  var w = 0;
  var children = obiekt.childNodes;
  for(var i=0; i < children.length; i++)
    {
    if(children[i].nodeName == "DIV")
      w += parseInt(children[i].style.width) + 6;
    }
    return w;
  }

function RewindLeft()
  {
  var pasek=document.getElementById("paseks");
  var l = parseInt(ClearStr(pasek.style.left));
  if(l < 23)
    {
    l=l+7;
    if(l > 23)
      l=23;  
    pasek.style.left= l+'px';
    }
  tid1 = setTimeout("RewindLeft()",100);
  }

function StartRewindLeft()
  {
  document.getElementById("stl").src='index/art-fusing_11a.jpg';
  RewindLeft();
  }

function StopRewindLeft()
  {
  clearTimeout(tid1);
  document.getElementById("stl").src='index/art-fusing_11.jpg';
  }

function RewindRight()
  {
  var pasek=document.getElementById("paseks");
  var l = parseInt(ClearStr(pasek.style.left));
  var new_l = 753 - countWidth(document.getElementById("paseks"));
  if(l > new_l)
    {
    l=l-7;
    if(l < new_l)
      l=new_l;
    pasek.style.left= l+'px';
    }
  tid2 = setTimeout("RewindRight()",100);
  }

function StartRewindRight()
  {
  document.getElementById("str").src='index/art-fusing_15a.jpg';
  RewindRight();
  }

function StopRewindRight()
  {
  clearTimeout(tid2);
  document.getElementById("str").src='index/art-fusing_15.jpg';
  }

