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


    var initModuleShare = function(opts){
        opts = opts || {};
        var debug = function(msg){
            if(!opts.debug) return;
            if($.browser.mozilla) console.log(msg);
        };
        
        var fnCloseShare = function(){
            debug('fnCloseShare');
            $(this).removeClass('open');
            $(this).css({
                'background-position': '0 0',
                height: '25px',
                width: '70px'
            });
            $(this).find('ul').css('display','none');
        };
        
        var fnOpenShare = function(){
            debug('fnOpenShare');
            $(this).addClass('open');
            $(this).css({
                'background-position': '0 -26px',
                height: '125px',
                width: '110px'
            });
            $(this).find('ul').css('display','block');
        };
        
        $(document).click(function(e){
            debug('document.click()');
            var target = $(e.target);
            if(target.hasClass('share') || target.closest('div.share').length > 0) {
                if(target.is('a')){
                    // log here
                    try {
                        if(opts.googleID){
                            var serv = $(target).closest('li')[0].className;
                            gaTrack(opts.googleID, "share_" + serv, target.attr('href'));
                        }
                    } catch(ex) {
                        console.log(ex);
                    }
                    return true;
                }
                if(!target.hasClass('share')) target = target.closest('div.share');
                $('div.share').each(function(){
                    if(-1 == $(this).index(target))
                        $(this).each(fnCloseShare);
                });
                if(target.hasClass('open')){
                    debug('closing');
                    target.each(fnCloseShare);
                } else {
                    debug('opening');
                    target.each(fnOpenShare);
                }
                return false;
            }
            return $('div.share').each(fnCloseShare);
        });
    };
}