Simple JavaScript code snippet to check whether or not a window is in an iFrame.
Very useful for some functions that may make use of the URL in the address bar of the page.
var isInIframe = (window.location != window.parent.location) ? true : false;