CODE:

if (window == top) document.write("I am the top");
else document.write("I am NOT the top");



RESULT: