function man_share_init() {

  var MODULE_URL = null;
  $('script').map(function(i) {
    if (this.src.match(/man_share_init\.js(\?.*)?$/)) {
      MODULE_URL = this.src.replace(/\/man_share_init\.js(\?.*)?$/, '');
    }
  });

  $("*[sancho_entity_type='ManShare']").each(function(i) {
    ////////////////////// START TOOLTIP ////////////////////////
    $('#camargue_tooltip').unbind('mouseup');
  	$(this).bind('mouseup', function(e) {
      //this one line will disable the right mouse click menu
      if(!e.ctrlKey) $(document)[0].oncontextmenu = function() {return false;}
      var rightclick;
      if (!e) var e = window.event;
      if (e.which) rightclick = (e.which == 3);
      else if (e.button) rightclick = (e.button == 2);
      if (rightclick) {
      	Camargue.Tooltip.hide();
        Camargue.Tooltip.keepVisible = true;
        Camargue.Tooltip.empty();
        var params = '';
        params += 'sancho_entity_id=' + $(this).attr('sancho_entity_id');
        params += '&sancho_content_slot_id=' + $(this).parent().attr('sancho_entity_id');
        params += '&sancho_page_area_name=' + $(this).parent().parent().attr('id');
        ///////////// START ACTIONS //////////////
        var credits = 'module: _ bookmark&share _ v.0.2 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 30-12-09';
        Camargue.Tooltip.addBlockTitle('Bookmark&share');
        Camargue.Tooltip.addLink('Remove', MODULE_URL + '/remove.php' + '?' + params, credits, {type: 'delete', modalWidth: 450, modalHeight: 110, modalName: 'man_share_remove'});
		///////////// END ACTIONS ///////////////
      	Camargue.Tooltip.show(e);
      }
    });
    $('*').click(function(){
    	Camargue.Tooltip.hide();
    });
    //////////////////////// END TOOLTIP //////////////////////////
	});



	//send to friend
 	$('a.icon_tellfriend').click(function(e) {
    if (Camargue.modals['tell_to_friend']) {
    	Camargue.modals['tell_to_friend'].close();
    }
    var fv = new FancyViewer({theme: 'giuntios_green'});
    var modurl = MODULE_URL +'/tell_to_friend.php?title='+$(this).attr('rel') + '&url=' + new String(window.location).replace('http://www.giuntios.it', '').replace('http://giuntios.it/', '');
    fv.addToSet(modurl, 'Invia questa pagina ad un amico', '', {width: 470, height: 390});
    fv.open(0);
    Camargue.modals['tell_to_friend'] = fv;
    return false;
    });


}
