var deltaX, xPos, yPos;
var amplitude, stepX, stepY;
var i, intervalId, docWidth = 800, docHeight = 600;
var timesViewed, heartsLeft;
function sniffer()
{
if (window.navigator.appName.indexOf("Microsoft")!=-1)
{
if (window.navigator.appVersion.indexOf("MSIE 3")!=-1 || window.navigator.appVersion.indexOf("MSIE
2")!=-1) return "other";
else return "ie";
}
else{
if (window.navigator.appName.indexOf("Netscape")!=-1) return "Netscape";
else return "other";
}
}
function Init()
{
var app=sniffer();
if (app=="ie"){
deltaX, xPos, yPos;
amplitude, stepX, stepY;
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
deltaX = new Array();
xPos = new Array();
yPos = new Array();
amplitude = new Array();
stepX = new Array();
stepY = new Array();
timesViewed = new Array();
heartsLeft = numberFlakes;
imageFile = document.all["IncrediFlakeImg"].src;
for(i=0; i<numberFlakes; i++){
deltaX[i] = 0;
xPos[i] = Math.random()*(docWidth-50);
yPos[i] = Math.random()*docHeight;
amplitude[i] = Math.random()*20;
stepX[i] = 0.02 + Math.random()/10;
stepY[i] = 0.7 + Math.random();
timesViewed[i] = 0;
document.body.insertAdjacentHTML("afterBegin", "<div id=\"dot"+
i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +";
VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=flake.gif
border=\"0\"></div>")
}
intervalId = setInterval("playIE()",delay);
}
}
function playIE()
{
for(i=0; i<numberFlakes; i++){
yPos[i] += stepY[i];
if(yPos[i] > docHeight-50){
xPos[i] = Math.random()*(docWidth-amplitude[i]-30);
yPos[i] = 0;
stepX[i] = 0.02 + Math.random()/10;
stepY[i] = 0.7 + Math.random();
docWidth = document.body.clientWidth;
docHeight = document.body.clientHeight;
timesViewed[i] += 1;
}
deltaX[i] += stepX[i];
if(!useTimesToLoop && timesViewed[i] == timesToLoop + 1)
{
document.body.children['dot'+i].style.visibility = "hidden";
timesViewed[i] += 1;
heartsLeft++;
}
else{
document.body.children['dot'+i].style.pixelTop = yPos[i];
document.body.children['dot'+i].style.pixelLeft = xPos[i] + amplitude[i]*Math.sin(deltaX[i]);
}
if(heartsLeft == 0){
clearInterval(intervalId);
}
}
}
</SCRIPT>
<SCRIPT language=javascript event=onload for=window>
Init();
</SCRIPT>
<IMG id=IncrediFlakeImg style="DISPLAY: none" height=0
src="flake.gif" width=0>