while loading the page image is going to bounce like when ball is dropped.For ie functionality is working i need the code to work fine for all browsers
code which is working is IE
<%--<div id="ball" style="visibility: visible; position: absolute; left: 100; top: 10;
">
<img src="Images/Buy2Get1M-Box2FreeShipping.jpg" alt="Bouncing ball"
height="100" style="width: 259px" /><br />
</div>
<script type="text/Javascript">
iter = 0;
setId = 0;
down = true;
up = false;
var ns = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4));
ie = !ns;
bouncingBall = document.getElementById("ball").style;
var winH;
if (ns)
document.captureEvents(Event.mouseup);
function buttonUp() {
winH = (ns) ? window.innerHeight - 400 + window.scrollY : document.body.offsetHeight -400+ document.body.scrollTop;
if (setId != 0) clearInterval(setId);
bouncingBall.visibility = "visible";
bouncingBall.left = (ns) ? e.pageX - 15 : 600;
bouncingBall.top = (ns) ? e.pageY - 15 : 200 + document.body.scrollTop;
iter = 0;
setId = setInterval("generateGravity()", 20);
return true;
}
function generateGravity() {
if ((parseInt(bouncingBall.top) + iter < winH) && down) {
bouncingBall.top = parseInt(bouncingBall.top) + iter;
iter++;
return;
}
else {
if ((parseInt(bouncingBall.top) < winH) && down) {
bouncingBall.top = winH + 5;
return;
}
down = false;
up = true;
if (iter < 0 && parseInt(bouncingBall.top) > winH) {
clearInterval(setId);
bouncingBall.visibility = "hidden";
setId = 0;
}
if (parseInt(bouncingBall.top) > 0 && up && iter >= 0) {
bouncingBall.top = parseInt(bouncingBall.top) - iter;
iter--;
if (iter % 3 == 0) iter--;
return;
}
down = true;
up = false;
}
}
</script>

