Did some work trying to fix the problem with the jQuery object dynamically passed to windows.