Maybe UI was loaded then hidden by a new copy of jQuery.
.position is also defined in jQuery. When used the way UI uses it, it would not do anything.
I would verify that UI is there with code like
to see if that function is present.
I would also check to see if jQuery is finding menu-secondmenu with
- console.log( $("#menu-secondmenu") )