Extending jQuery UI Widgets - Accordion

Extending jQuery UI Widgets - Accordion


How would one go about extending a function/method of a widget without
re-writing it?
Basically I want to add something to the "_init" function but without
duplicating the code just to add an statement to the end of it.
I want to add the "resize" method of the accordion as a handler to the
document resize event. Currently, it is not sensitive to changes in
the container of accordions using the fillSpace option.
I would like to know how one should approach such tasks, not just for
this scenario, but others as well.