initializewidgets() & destroywidgets() functions added

via jQuery event binding