// JavaScript Document Star background

var isNS = (navigator.appName == "Netscape") ? 1 : 0;
  if(isNS)
  {
  var heig=window.innerHeight
  var widt=window.innerWidth
  }
  else
  {
  var heig=document.body.clientHeight-20
  var widt=document.body.clientWidth-12
  }

var numb=Math.floor(heig*2)
var ns=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var NN=(document.layers ? true:false)
colo=new Array(numb)
j=0
tx=""
for (i=0; i <numb ; i++)
{
	x=Math.floor((Math.random()+.01)*98)+"%"
	yy=Math.floor((Math.random()+.05)*90)
	y=yy+"%"
	wi=Math.floor(Math.random()*1.1)+1
	col="#FFFFFF"
	n=0
	if (wi<1.2){col="#eeeeff";n=4}
	if (wi>2.6){col="#ffaa88";n=8}
	if (Math.random()>.75){nam="r"+j; colo[j]=n;j=j+1}
	else{nam=""}
	he=wi
	if (ns)
	{
	tx=tx+"<layer z-Index=0 "+((nam)?"name="+nam:"")+" left="+x+" top="+y+" width="+wi+" height="+he+" bgColor="+col+"></layer>"
	}

    else
	{
	document.write("<div "+((nam)?"id="+nam:"")+"  style='z-index:-1; position:absolute; left:"+x+";top:"+y+";width:"+wi+";height:"+he+";background:"+col+"'><img  width=1 height=1></div>");
	}
if(ns){document.write (tx);tx=""}
}

function recolor()
{
for (i=0; i<j; i++)
	{
		if (colo[i]==0){co=cols[Math.floor(Math.random()*4)]}
		if (colo[i]==4){co=cols[4+Math.floor(Math.random()*4)]}
		if (colo[i]==8){co=cols[8+Math.floor(Math.random()*4)]}
		
		if (ns) {document.layers["r"+i].bgColor=co}
		if (ie4){document.all["r"+i].style.background=co}
		if (ns6){document.getElementById("r"+i).style.background=co}
	}
}

cols=new Array("#FFFFFF","#FFFFCC","#66FFFF","#ccbb66","#eeeeff","#FF0000","#ccccdd","#bbbbcc","#ffaa88","#ee9977","#dd8866","#cc7755")
window.setInterval("recolor()",3000)
window.setInterval("recolor()",2500)
