/*
  (C) by KSI media sp. z o.o. ( www.ksimedia.pl )  
  Description : SlideBox
  Author      : SP
  Create date : 2010-08-22
  Comment     :
*/

function classTouroperatorSlideBar_default() {
  this.id ;
  this.contentWidth ;
  this.visibleWidth ;
  this.timeOut ;
  this.position = 0 ;
  this.contentElement ;
  this.interval = 1 ;
  
  this.start = function(id, contentWidth, visibleWidth, timeOut)
  {
    try
    {
      this.id = id ;
      this.contentWidth = contentWidth ;
      this.visibleWidth = visibleWidth ;
      this.timeOut = timeOut ;
      this.contentElement = document.getElementById(this.id+'_content') ;

      if ( this.contentWidth > this.visibleWidth )
      {      
        var content = this.contentElement.innerHTML;      
        this.contentElement.innerHTML = content + content ;
        this.contentElement.style.width = this.contentWidth * 2 + 'px' ;
        this.slide();
      }
    } catch(err) {
    }
  }
  
  this.slide = function()
  {
    try
    {
      this.position = this.position - this.interval ;
      if ( this.position <= - this.contentWidth )
      {
        this.position = 0 ;
      }
      this.contentElement.style.left = this.position + 'px';
      setTimeout('TouroperatorSlideBar_default.slide();', this.timeOut);
    } catch ( err ) {
    }
  }
  
 }
 
 var TouroperatorSlideBar_default = new classTouroperatorSlideBar_default();
