Copied grutajs code from nutriguia-devel.