Replaced window.top by window.parent to allow execution in frame