var k;
var ind;
var tab;

function gwiazdki(n)
{
  if(n<=0)
    return;
  ind=document.images.length;
  k=0;
  tab=new Array(n);
  var pom=new Array(n);
  for(var i=0; i<n; i++)
    pom[i]=i;
  for(var i=n; i>0; i--)
  {
    var s=Math.ceil((Math.random()*10))%i;
    tab[i-1]=pom[s];
    pom[s]=pom[i-1];
  }
  document.write('<span style="vertical-align: middle;">');
  for(var i=0; i<n; i++)
    document.write('<img src="img/gw_stat.gif" width="20" height="20">');
  document.write('</span>');
  for(var i=ind+n-1; i>=ind; i--)
    setTimeout(laduj, Math.ceil(Math.random()*6000));
}
  
function laduj()
{
  document.images[tab[k]+ind].src="img/gw_anim.gif";
  k++;
}

function hqPopup(url, name, width, height)
{
  ScrWidth = 1024; ScrHeight = 768;
  if (window.screen) {ScrWidth = window.screen.width; ScrHeight = window.screen.height}
  PosX = Math.round((ScrWidth - width)/2);
  PosY = Math.round((ScrHeight - height)/2);
  zdj=window.open("", name, 'left='+PosX+',top='+PosY+',width='+width+',height='+height);
  zdj.document.write('<html><head><title>Zdjêcie</title></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><img src="'+url+'" width="'+width+'" height="'+height+'"></body></html>');
  zdj.focus();
}
