var numb=400,D=document, nbC=0, nbE=0;
var cols = new Array("Whi","Whi","Bei","Blu","Pin","Yel");

 function NostraSky(StarDensity)
 {
 var x, y, wi, colId, filnam, i, rand, scrX, scrY, path="", mltplr=1;
  if(isOP)
  mltplr = 0.6;
  if(ThisFrame == "C3")
  path = "../../";

  if(isNS)
  {
  ScrWdt = window.innerWidth;
  ScrHgt = window.innerHeight;
  }
  else
  {
  ScrWdt = D.body.clientWidth;
  ScrHgt = D.body.clientHeight;
  }
  if(ScrWdt == 0)//safari
  ScrWdt = screen.width;
  if(ScrHgt == 0)
  ScrHgt = (screen.height)*.24;
 
 var ActArea = ScrWdt*ScrHgt;
 numb = Math.round( (StarDensity/10000)*ActArea)*mltplr;
 numbSm = Math.round(numb*.95)//10% big
 var j=0;
 scrX = (ScrWdt-28);
 scrY = (ScrHgt-28);
 CentLX = Math.round(ScrWdt/9);
 CentRX = CentLX*8;
 CentTY = Math.round(ScrHgt/5);
 CentBY = CentTY*4;
  for (i=0; i <numb ; i++)
  {
  IsFFRand=false;
  rand=Math.random();
  x = Math.floor(Math.random()*(scrX))+14;
  y = Math.floor(Math.random()*(scrY))+14;
  var IsCent = (x>CentLX && x<CentRX && y>CentTY && y<CentBY);
  rand=Math.random();
   if(IsCent)
   {
   colId = wi = Math.round(rand);//0,1
   nam="ce"+nbC;
   nbC++;
   }
   else 
   {
   colId = wi = Math.round(rand*2);//0, 1 or 2
   nam="na"+nbE;
   nbE++;
   }
  filnam="Star2px"+cols[colId];
  document.write("<img id='"+nam+"' style='position:absolute; top:"+y+"px; left:"+x+"px; width:"+wi+"px; height:"+wi+"px' src='"+path+"TOCFrame_fichiers/"+filnam+".gif'>");
  }//end for
 }//end NostraSky

 function blinSizC()
 {
 var c, rand, sIdC, elsiC, siz;
  for(var i=0; i<5; i++)
  {
  c=Math.round(Math.random()*nbC);
  sIdC="ce"+c;
  elsiC=D.getElementById(sIdC);
   if(elsiC)
   {
   rand=Math.random();
   siz = parseInt(elsiC.style.width);
    if(siz<=0)
    siz = 1;
	else
    siz = 0;
   elsiC.style.width=siz+"px";
   elsiC.style.height=siz+"px";
   }//end if elsi
  }//end for
 }
 
 function blinSizE()
 {
 var e, rand, sIdE, elsiE, siz, inc=0;
  for(var i=0; i<5; i++)
  {
  e=Math.round(Math.random()*nbE);
  sIdE="na"+e;
  elsiE=D.getElementById(sIdE);
   if(elsiE)
   {
   siz = parseInt(elsiE.style.width);
   rand = Math.random();
    if(siz<=0)
    inc = 1;
    else if(siz>=2)
    inc = -1;
    else if(rand>0.5)//siz=1
    inc = 1;
    else if(rand<0.5)//siz=1
    inc = -1;
   siz += inc;
    if(siz)
    {
    elsiE.style.width=siz+"px";
    elsiE.style.height=siz+"px";
    }//end if elsi
   }//end if elsi
  }//end for
 }//end function

window.setInterval("blinSizC()",700)
window.setInterval("blinSizE()",1000)
