JavaScript Tutorial/Language Basics/self
Use self to reference the current document
<html>
<head>
<script language="JavaScript" type = "text/javascript">
<!--
if (top==self)
{
var main_frame = "http://www.wbex.ru";
var cur_url = self.location.href;
var setframes = main_frame + "?" + cur_url;
location.href = setframes;
}
//-->
</script>
</head>
<body>
</body>
</html>