per evitare il frame basta fare

if(top.name != self.name)
top.location.href=location.href;