if (parent.location.href == self.location.href) { //document.location.replace('http://www.torontosurplus.com/redirect.php?middleframe='+self.location); document.location.replace('/redirect.php?middleframe='+self.location); }