Removed getOffset function, added positioning within new window JS