var scrollLeft,scrollTop;
var windowWidth,windowHeight; 

function updateScrollWidth()
{
	if (window.pageYOffset){  
		scrollTop = window.pageYOffset 
	} else if(document.documentElement && document.documentElement.scrollTop){ 
		scrollTop = document.documentElement.scrollTop; 
	} else if(document.body){ 
		scrollTop = document.body.scrollTop; 
	} 
	scrollTop = parseInt(scrollTop);

	if(window.pageXOffset){ 
		scrollLeft=window.pageXOffset 
	} else if(document.documentElement && document.documentElement.scrollLeft){ 
		scrollLeft=document.documentElement.scrollLeft; 
	} else if(document.body){ 
		scrollLeft=document.body.scrollLeft; 
	}
	scrollLeft = parseInt(scrollLeft);

	if(window.innerWidth){ 
		windowWidth=window.innerWidth; 
	} else if(document.documentElement && document.documentElement.clientWidth){ 
		windowWidth=document.documentElement.clientWidth; 
	} else if(document.body){ 
		windowWidth=document.body.offsetWidth; 
	} 
	windowWidth = parseInt(windowWidth);

	if(window.innerHeight){ 
		windowHeight=window.innerHeight; 
	} else if(document.documentElement && document.documentElement.clientHeight){ 
		windowHeight=document.documentElement.clientHeight; 
	} else if(document.body){ 
		windowHeight=document.body.clientHeight; 
	}
	windowHeight = parseInt(windowHeight);
}


var ns=document.layers?1:0
var ie4=document.all?1:0
var ns6= document.getElementById&&!document.all?1:0
amount=14;
if (ns){
for (i=0; i < amount; i++)
document.write("<layer name= 'nsstars"+i+"' left=0 top=0 bgcolor='#fffff0' clip='0,0,1,1'></layer>");
}else if (ie4||ns6){
document.write("<div id='ieCov' style='position:absolute;top:0px;left:0px;z-index:999999;'>");
document.write("<div style='position:relative;z-index:999999;'>");
for (i=0; i < amount; i++)
document.write("<div id='iestars"+i+"' style='position:absolute; top:0px;left:0px;width:1px; height:1px;background-color:#ffffff; font-size:1;z-index:999999;'></div>");
document.write("</div></div>");}
Clrs=new Array ('#ff0000','#00ff00','#ffffff','#ff00ff','#ffa500','#ffff00', '#00ff00','#ffffff','#ff00ff')
sClrs=new Array ('#00B3C6','#E2E2E2','#00A99D','#4FE2E3','#EE145B', "#F8941D", "#008D9C")
Xpos=300;Ypos=150;initialStarColor='#00ff00';step=5;currStep=0;explosionSize=120;
function Fireworks(){
updateScrollWidth();
var WinHeight= windowHeight;
var WinWidth= windowWidth;
var Yscroll= scrollTop;
for (i=0; i < amount; i++){
if (ie4||ns6)
var layer= ns6?document.getElementById("iestars"+i).style : eval("iestars"+i).style;
else if (ns)
var layer=document.layers["nsstars"+i]
var randCol=Math.round(Math.random()*8);
var randSz=Math.round(Math.random()*2);
layer.top = Ypos + explosionSize*Math.sin ((currStep+i*5)/3)*Math.sin(currStep/100)+"px"
layer.left= Xpos + explosionSize*Math.cos ((currStep+i*5)/3)*Math.sin(currStep/100)+"px"
if (currStep < 110){
if (ns){layer.bgColor= initialStarColor;layer.clip.width= '5px';layer.clip.height='5px'}
else{layer.background= initialStarColor;layer.width= '5px';layer.height='5px';layer.fontSize=1}
}else{
if (ns){layer.bgColor= Clrs[randCol];layer.clip.width= randSz;layer.clip.height=randSz
}else{layer.background= Clrs[randCol];layer.width= randSz;layer.height= randSz;layer.fontSize=randSz}}}
if (currStep > 220){
currStep=0;
Ypos = 50+Math.round (Math.random()*WinHeight)+Yscroll;
Xpos = 50+Math.round(Math.random()*WinWidth);
for (i=0; i < sClrs.length; i++){var newIcol=Math.round(Math.random()*i);}
initialStarColor=sClrs[newIcol];
explosionSize= Math.round(80*Math.random()+100);
if (fireStop == 1)
{
	fireStop = 0;
	clearInterval(fireTimer);
	if (!ns)
		document.getElementById('ieCov').style.display = 'none';
}
else
{
	if (!ns)
		document.getElementById('ieCov').style.display = 'block';
}
}
currStep+=step;
}

