/**
 * @author jeff lowder
 * mobile: 0419 350 760
 * for thehub.ethics.org.au
 */
var SJEC = function(){
    
        return {
        showEditor: function(id){
            var oFCKeditor = new FCKeditor(id);
            oFCKeditor.BasePath = "/fckeditor/";
            oFCKeditor.ToolbarSet = 'BasicSet';
            oFCKeditor.Width  = '500';
            oFCKeditor.Height = '200';
            oFCKeditor.ReplaceTextarea();
        },
        showBasicEditor: function(id,width){
            var oFCKeditor = new FCKeditor(id);
            oFCKeditor.BasePath = "/fckeditor/";
            oFCKeditor.ToolbarSet = 'Basic';
            oFCKeditor.Width  = width;
            oFCKeditor.Height = '200';
            oFCKeditor.ReplaceTextarea();
        },
        
        equaliseHeights: function(){
            var currentTallest = 600;
            $('#left_col').css({'height':'','min-height':''});
            $('#right_col').css({'height':'','min-height':''});
            $('#page_content').css({'height':'','min-height':''});
            $('#content > div').each(function(){
                if($(this).height() > currentTallest) {
                    currentTallest = $(this).height();
                }
            });
            $('#content > div').each(function(){
                if($.browser.msie && $.browser.version == 6.0){
                    $(this).css({'height': currentTallest});
                } else {
                    $(this).css({'min-height': currentTallest});
                }
            });
        },
        
        /**
         * functionality to show/hide regoins automatically
         */
        collapseRegions: function(){
            $( '.collapsible' ).before( '<p><a class="togglenext" href="#">View more information</a></p>' );
            $( '.collapsible' ).hide();
            $('a.togglenext').toggle (function() {
                $(this.parentNode.nextSibling).slideDown('slow');
                $(this).html('Hide more information'); },function() {
                    $(this.parentNode.nextSibling).slideUp('slow');
                    $(this).html('Show more information');
            });
        }
    }

}();