var Marquee = {
   lang:'pl',
   pos:0,
   step:1,
   time:1,
   data:{
      'pl':{text:820,width:434},
      'en':{text:540,width:434}
   },
   init:function(){
      if($('banner') && MARQUEE_TEXT){
         this.txt  = MARQUEE_TEXT;
         this.lang = LANG ? LANG : 'pl';
         this.actualData = this.data[this.lang];
         var div = DIV({
            'id':'marquee'
         });
         div.style.width = this.actualData.width +'px';
         this.dBody = DIV(this.txt);

         this.dBody.style.width = this.actualData.text +'px';
         this.dBody.style.position = 'absolute';
         this.dBody.style.left = this.actualData.width +'px';
         div.appendChild(this.dBody);
         $('banner').appendChild(div);
         this.pos = this.actualData.width;
         this.timer = setInterval(this.anim.bind(this),this.time);
      }
   },
   anim:function(){
      if(this.pos < -this.actualData.text)
         this.pos = this.actualData.width;
      this.dBody.style.left = this.pos +'px';
      this.pos-=this.step;
   }
};

addEvent(window,'load',function(){
   Marquee.init();
});

