Updated code to work with jQueryUI update in WordPress 3.6.