We have code like this:

var widget = self.parent().parent();

But if you theme your widgets differently (e.g. adding some more enclosing DIVs) then this code won't work.
Better code might be like this:

var widget = self.parents('.form-item');
CommentFileSizeAuthor
imagefield_crop.patch809 bytesdoq