Pull bookmarklet sction into function