<html>
<script>
function checkV()
{
if (document.getElementById('test').offsetTop > (document.body.scrollTop+document.body.clientHeight))
{alert('not visible');}
else
{alert('visible');}
}
</script>
<body onscroll='checkV()'>
<BR><BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR>
<BR><BR><BR><BR>
<BR><BR><BR>
<BR><BR>
<BR>
<div id='test'>foo</div>
</body>
</html>