if(typeof(initModuleShowHide) == 'undefined')
{

    var splitContent = function($el, commentContent){
        commentContent = commentContent || ' break ';
        return $el.each(function(){
            
            try {
                var el = $(this);
                var txt = el[0];
                var node, com, i, k, nodes=[], pnodes=[];
            
                for(k=0;k<txt.childNodes.length;k++){
                    node = txt.childNodes[k];
                    switch(true){
                        case (node.nodeName == '#comment' && node.data == commentContent) : com = node; break;
                        case (node.nodeName == 'P' && node.childNodes.length == 1 && node.childNodes[0].nodeName == '#comment' && node.childNodes[0].data == commentContent) : com = node; break;
                        case !com : pnodes.push(node); break;
                        default : nodes.push(node); break;
                    }
                }
                if(!com) return false;
    
                var wrapper = document.createElement('div');
                wrapper.className = 'second';
                
                var pwrapper = document.createElement('div');
                pwrapper.className = 'first';
                
                for(i=0; i<nodes.length; i++){
                    wrapper.appendChild(nodes[i].cloneNode(true));
                    txt.removeChild(nodes[i]);
                }
                txt.insertBefore(wrapper, com);
                
                for(i=0; i<pnodes.length; i++){
                    pwrapper.appendChild(pnodes[i].cloneNode(true));
                    txt.removeChild(pnodes[i]);
                }
                txt.insertBefore(pwrapper, wrapper);
                el.data('collapsedHeight', $('.first', el).eq(0).height());
                el.height(el.data('collapsedHeight'));
                $('.second', el).hide();
            } catch(e) {
            }
            return el;
        });
    };

    var initModuleShowHide = function(module){
        $(module).each(function(){
            var $module = $(this);
            var $div = $module.find('div.showHide');
            splitContent($div, ' break ');
            $module.find('a.showHide').each(function(){
                var $link = $(this);
                if($.browser.safari){
                    $link.hover(function(){
                        $(this).css('text-decoration', 'underline');
                    }, function(){
                        $(this).css('text-decoration', 'none');
                    });
                }
                $link.click(function(){
                    $div.toggleClass('show');
                    $div.find('.second').toggle();
                    if($div.hasClass('show')){
                        $div.css('height', null);
                        if($div.parent().hasClass('.generic, .simple')){
                        	$link.html('Hide').addClass('hide');
                        } else {
                        	$link.html('Collapse Story').addClass('hide');
                        };
                    } else {
                        $div.height($div.data('collapsedHeight'));
                        if($div.parent().hasClass('.generic, .simple')){
                        	$link.html('Read More').removeClass('hide');
                        } else {
                        	$link.html('Expand Story').removeClass('hide');
                        };
                    }
                    return false;
                });
            });
        });
    };

}