based on jquery ui widgets.