//if the topmost frame is not the document calling the code
//we do some stuff to make sure we're not being hijacked
if (top != self ) {
//Add a whitelist array.
//Add any site you WANT to be able to frame your site.
//The default allows for your own site to frame the page.
//It just seemed like the way to go.
//Are there any other typical sites that need to be whitelisted?
    var whitelist =[
            document.location.hostname
    ];
    var i;
    var test = whitelist.length;
    var safe = false;
//Then we simply test for the presence of the
//Frame's location in the whitelist array
    for (i=0; i < test ; i++) {
    	if (document.referrer.indexOf(whitelist[i]) != -1 ) {
//if it is, it's safe
        	safe= true;
    	}
   }
//if it's not, bust a move
//and kill that (hijacking) noise
    if (safe=== false) {
    	top.location.replace(document.location);
    }
}
