function man_giuntios_product_init() {

  var MODULE_URL = null;
  $('script').map(function(i) { 
    if (this.src.match(/man_giuntios_product_init\.js(\?.*)?$/)) {
      MODULE_URL = this.src.replace(/\/man_giuntios_product_init\.js(\?.*)?$/, '');
    }
  });  

  $("*[sancho_entity_type='ManGosProduct']").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_page_area_name=' + $(this).parent().attr('id');             
        ///////////// START ACTIONS //////////////
        var credits = 'module: _ os product _ v.0.1 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 04-01-10';
        Camargue.Tooltip.addBlockTitle('Product');  
        Camargue.Tooltip.addLink('Edit', MODULE_URL + '/edit_product.php' + '?' + params, credits, {type: 'edit', modalWidth: 550, modalHeight: 480, modalName: 'man_giuntios_product_edit'});  
				// connect to article module
        var ART_MOD_URL = null;
        $('script').map(function(i) { 
          if (this.src.match(/man_giuntios_product_article_init\.js(\?.*)?$/)) {
            ART_MOD_URL = this.src.replace(/\/man_giuntios_product_article_init\.js(\?.*)?$/, '');
          }
        });      
        params = '';
        params += 'sancho_page_id=' + Sancho.curPageId;        
        params += '&sancho_page_area_name=' + $(this).parent().attr('id');
        params += '&product_id=' + $(this).attr('sancho_entity_id');
        if ($(this).attr('man_gos_product_edit_full')) {            
          Camargue.Tooltip.addBlockTitle('Articles');  
          Camargue.Tooltip.addLink('Add new article', ART_MOD_URL + '/edit_article.php' + '?' + params, credits, {type: 'add', modalWidth: 550, modalHeight: 480, modalName: 'man_giuntios_product_article_edit'}); 
          Camargue.Tooltip.addLink('Add article(s)', ART_MOD_URL + '/dashboard.php' + '?' + params + '&mode=browse', credits, {type: 'add', modalWidth: 800, modalHeight: 500, modalName: 'man_giuntios_catalog_articles'});    
				}      
				///////////// END ACTIONS ///////////////
      	Camargue.Tooltip.show(e);
      }            
    });
    $('*').click(function(){
    	Camargue.Tooltip.hide(); 
    });    
    //////////////////////// END TOOLTIP //////////////////////////                  
	});
	
	
	$('a.button_1:contains("acquista")').click(function(){
		var targetOffset = $('a.stampascheda').offset().top;
		$('html,body').animate({scrollTop: targetOffset-10}, 1000, 'easeOutBack');
		return false;
	});
	$('a[rel="info_promo"]').click(function(){
		return false;
	});
	
} 
