made compatible with modern jquery/jquery ui

added a small UA sniffing to make up for $.browser being gone. Fixed
demo with modern version