function man_link_list_init() {
  
  var MODULE_URL = null;
  $('script').map(function(i) { 
    if (this.src.match(/man_link_list_init\.js(\?.*)?$/)) {
      MODULE_URL = this.src.replace(/\/man_link_list_init\.js(\?.*)?$/, '');
    }
  });  
  
  $("*[sancho_entity_type='ManCollection']").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();     
        ///////////// START ACTIONS //////////////      
      	var credits = 'module: _ link_list _ v.0.3 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 07-01-09';
      	var params = '';          
        params += 'sancho_entity_id=' + $(this).attr('sancho_entity_id');           
        params += '&sancho_page_area_name=' + $(this).parent().parent().attr('id'); 
        params += '&sancho_content_slot_id=' + $(this).parents("*[sancho_entity_type='SanchoContentSlot']").attr('sancho_entity_id');     				                       
        Camargue.Tooltip.addBlockTitle('Manage list'); 
        if (
        		$(this).parent().parent().attr('id') == 'footer_menu_1' || 
            $(this).parent().parent().attr('id') == 'footer_menu_2' ||
            $(this).parent().parent().attr('id') == 'footer_menu_3' 
        ) {
        Camargue.Tooltip.addLink('Add footer list', MODULE_URL + '/add_footer_list.php' + '?' + params, credits, {type: 'add', modalWidth: 550, modalHeight: 140, modalName: 'man_link_list_edit'}); 
				}           
        Camargue.Tooltip.addLink('Edit list', MODULE_URL + '/edit_list.php' + '?' + params, credits, {type: 'edit', modalWidth: 550, modalHeight: 140, modalName: 'man_link_list_edit'});          
        Camargue.Tooltip.addLink('Remove list', MODULE_URL + '/remove_list.php' + '?' + params, credits, {type: 'delete', modalWidth: 550, modalHeight: 110, modalName: 'man_link_list_remove_list'}); 
				Camargue.Tooltip.addSeparator();
        Camargue.Tooltip.addBlockTitle('Manage links');  
      	var params = '';          
        params += 'sancho_entity_id=0';           
        params += '&sancho_page_area_name=' + $(this).parent().parent().attr('id'); 
        params += '&sancho_content_slot_id=' + $(this).parents("*[sancho_entity_type='SanchoContentSlot']").attr('sancho_entity_id');
        params += '&list_id=' + $(this).attr('sancho_entity_id');                 
        Camargue.Tooltip.addLink('Add link', MODULE_URL + '/edit_link.php' + '?' + params, credits, {type: 'add', modalWidth: 550, modalHeight: 480, modalName: 'man_link_list_edit_link'}); 
                	                                          
				///////////// END ACTIONS ///////////////
      	Camargue.Tooltip.show(e);
        e.stopPropagation();
      }            
    });
    $('*').click(function(){
    	Camargue.Tooltip.hide(); 
    });    
    //////////////////////// END TOOLTIP //////////////////////////   
	});  

  $("*[sancho_entity_type='ManLink']").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();      
        ///////////// START ACTIONS //////////////      
      	var credits = 'module: _ link_list _ v.0.3 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 07-01-09';
      	var params = '';        
        params += 'sancho_page_area_name=' + $(this).parents("*[sancho_entity_type='SanchoContentSlot']").parent().attr('id'); 
        params += '&sancho_content_slot_id=' + $(this).parents("*[sancho_entity_type='SanchoContentSlot']").attr('sancho_entity_id');    
        params += '&list_id=' + $(this).parents("*[sancho_entity_type='ManCollection']").attr('sancho_entity_id'); 				                       	
      	params += '&sancho_entity_id=' + $(this).attr('sancho_entity_id');        	                       
        Camargue.Tooltip.addBlockTitle('Manage link');  
        Camargue.Tooltip.addLink('Edit link', MODULE_URL + '/edit_link.php' + '?' + params, credits, {type: 'edit', modalWidth: 550, modalHeight: 480, modalName: 'man_link_list_edit_link'});  
        Camargue.Tooltip.addLink('Remove link', MODULE_URL + '/remove_link.php' + '?' + params, credits, {type: 'delete', modalWidth: 550, modalHeight: 110, modalName: 'man_link_list_remove_link'});         
			               
		///////////// END ACTIONS ///////////////
      	Camargue.Tooltip.show(e);
        e.stopPropagation();
      }            
    });
    $('*').click(function(){
    	Camargue.Tooltip.hide(); 
    });    
    //////////////////////// END TOOLTIP //////////////////////////              
	}); 
  
} 

  
