added widgetBlock function to allow block-level things such as js-functions to be assigned to widgets in smarty templates.