/*
    bl: when triggering save on form submit, we only want to
    save the data in the WYSIWYG editor if the WYSIWYG editor
    is currently active.  if not, then don't save or else
    we risk overwriting the current values in the textarea.

    done so by overriding the end function from tiny_mce_gzip.js
    (which currently does nothing) and using it to overwrite
    the current triggerSave function in the EditorManager.
 */
tinyMCE_GZ.end = function() {
    executeFunctionOnceAvailable(function() {
        return typeof tinymce.EditorManager == 'undefined';
    }, function() {
        tinymce.EditorManager.triggerSave = function() {
            tinymce.each(this.editors, function(e) {
                if(isWysiwygActive(e.id)) {
                    e.save();
                }
            });
        };
    });
};
