function CheckFrames() { var strPage, strURL strPage = location.pathname + location.search strURL = location.protocol + "//" + location.hostname + "/index.asp?page=" + escape(strPage) if ((window.name != "body") || (window.parent.name != "frameset") || (window.parent.parent.parent != window.parent.parent)) { window.top.location.replace(strURL) } }