<html>
<head>
<script>
function check()
{
if (window.top!=window.self)
{
document.write("<p>This window is not the topmost window! Am I in a frame?</p>")
}
else
{
document.write("<p>This window is the topmost window!</p>")
}
}
</script>
</head>
<body>
<input type="button" onclick="check()" value="Check window">
</body>
</html>