var count=15; var interval=15000; var last_id=0; // id ostatniego newsa var last_check=0; var completed=false; // czy poprzednie sprawdzenie juz ukonczono var newsy=new Array(); var fps=1000/25; var scrollby=2; var scroll=true; var scroll_vis=true; document.write('
'); function hidescroll() { scroll_vis=false; el=document.getElementById('scroll'); el.style.display='none'; } // object prototyp function news(id,orig_id,title,link,text,timestamp,posx) { this.id=id; this.orig_id=orig_id; this.title=title; this.link=link; this.text=text; this.timestamp=timestamp; this.posx=posx; this.gotox=posx; this.width=0; } function sortId(a,b) { return a.id>b.id; } function sortPosx(a,b) { if (a.posx!='NaN' && b.posx!='NaN') return a.posx-b.posx; else return 0; } function myindexOf(id) { for(i=0;i=count) newsy.shift(); posx="NaN"; if (newsy.length>0) posx=newsy[newsy.length-1].posx; last_id=Math.max(last_id,arr[arrpos]); newsy.push(new news(arr[arrpos++], arr[arrpos++], arr[arrpos++].replace(/ /g,' '), arr[arrpos++], arr[arrpos++], arr[arrpos++], posx)); } else { last_id=Math.max(last_id,arr[arrpos]); arrpos+=6; } } newsy.sort(sortPosx); el=document.getElementById('scroll'); html=''; for (i=0;i'+newsy[i].title+''; } el.innerHTML=html; } completed=true; } return 0; } self.xmlHttpReq.send(""); } var tajm=new Date().getTime(); function timer() { el=document.getElementById('scroll'); // pager=getRect(el); pwidth=el.offsetWidth; ypos=document.body.clientHeight-el.offsetHeight+document.body.scrollTop; el.style.top=ypos+'px'; el=document.getElementById('scroll_logo'); el.style.top=ypos+'px'; el=document.getElementById('scroll_close'); el.style.left=(pwidth-el.offsetWidth)+'px'; el.style.top=ypos+'px'; var tajm2=new Date().getTime(); // fpsskip=Math.max(Math.floor((tajm2-tajm)/fps),1); // tajm+=fpsskip*fps; // tajm=tajm2; fpsskip=1; if (tajm2>last_check+interval && completed) reload(); for (i=0;i0) { newsy[i].gotox=posx; } if (scroll) { newsy[i].posx-=scrollby; newsy[i].gotox-=scrollby; if (Math.abs(newsy[i].posx-newsy[i].gotox)>=scrollby) newsy[i].posx+=(newsy[i].gotox-newsy[i].posx)/10.0; else newsy[i].posx=newsy[i].gotox; } posx=newsy[i].gotox+newsy[i].width; if (i==0 && newsy[i].posx<-newsy[i].width) rollover=true; } if (rollover) { newsy[0].posx=newsy[0].gotox=Math.max(pwidth,posx); newsy.push(newsy.shift()); i=-1; } } if (scroll_vis) window.setTimeout('timer()',fps); } reload(); timer();