var step=1;
function startStars(){
	step = 1;
	animateStars();
}
function animateStars(){
	var z; z = parseInt((step-1)/8);
	var x; x = z+1;
	var y; y = step % 8;
	
	if(x < 6){ // set stars to be brigter
		setStarOpacity( "star"+x, step+10-(x*8) );
	}
	if(z>0 && step > 2 && y < 3){ // set stars to be dimmer
		setStarOpacity( "star"+z, 10-y);
	}
	if(step < 44){
		step+=1;
		setTimeout("animateStars()",50);
	}
}
function setStarOpacity(id,value){ /*accepts values 0 - 10*/
	var obj = byId(id);
	if(obj==null){
		alert(id);
	}
	obj.style.opacity = value/10;
	obj.style.filter = 'alpha(opacity=' + value*10 + ')';
}
function byId(id){
	return document.getElementById(id);
}