function man_giuntios_catalog_summary_init() {
	
  // alert('text block menu init');
  
  var MODULE_URL = null;
  $('script').map(function(i) { 
    if (this.src.match(/man_giuntios_catalog_summary_init\.js(\?.*)?$/)) {
      MODULE_URL = this.src.replace(/\/man_giuntios_catalog_summary_init\.js(\?.*)?$/, '');
    }
  });  

  var CATALOG_MODULE_URL = MODULE_URL.replace(/_summary/, '');
  
  $("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").each(function(i) {
  
    ////////////////////// START TOOLTIP ////////////////////////  
    // do stuff                      
    $('#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 parent_params = '';        
        parent_params += 'sancho_entity_id=' + $(this).attr('sancho_entity_id');
        parent_params += '&sancho_content_slot_id=' + $(this).parent().attr('sancho_entity_id');      
        parent_params += '&sancho_page_area_name=' + $(this).parent().parent().attr('id');      
        Camargue.Tooltip.addBlockTitle('Product summary');           
        Camargue.Tooltip.addLink('Remove summary', MODULE_URL + '/remove_summary.php' + '?' + parent_params, '', {type: 'delete', modalWidth: 450, modalHeight: 110, modalName: 'man_giuntios_catalog_summary_remove'});
        Camargue.Tooltip.addLink('Add product', CATALOG_MODULE_URL + '/dashboard.php' + '?' + parent_params + '&mode=browse&target_type=summary', '', {type: 'add', modalWidth: 800, modalHeight: 500, modalName: 'man_giuntios_catalog'});  
				///////////// END ACTIONS ///////////////
      	Camargue.Tooltip.show(e);
      }            
    });
    $('*').click(function(){
    	Camargue.Tooltip.hide(); 
    });    
    //////////////////////// END TOOLTIP //////////////////////////                  
	});   
  
  
  $("*[sancho_entity_type='ManGiuntiOsCatalogSummary'] *[sancho_entity_type='SanchoSlot']").each(function(i) {
  
    ////////////////////// START TOOLTIP ////////////////////////  
    // do stuff                      
    $('#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 parent_params = '';        
        parent_params += 'sancho_entity_id=' + $(this).parents("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").attr('sancho_entity_id');
        parent_params += '&sancho_content_slot_id=' + $(this).parents("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").parent().attr('sancho_entity_id');      
        parent_params += '&sancho_page_area_name=' + $(this).parents("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").parent().parent().attr('id');      
        Camargue.Tooltip.addBlockTitle('Product summary');           
        Camargue.Tooltip.addLink('Remove summary', MODULE_URL + '/remove_summary.php' + '?' + parent_params, '', {type: 'delete', modalWidth: 450, modalHeight: 110, modalName: 'man_giuntios_catalog_summary_remove'});
        Camargue.Tooltip.addLink('Add product', CATALOG_MODULE_URL + '/dashboard.php' + '?' + parent_params + '&mode=browse&target_type=summary', '', {type: 'add', modalWidth: 800, modalHeight: 500, modalName: 'man_giuntios_catalog'});  
        var params = '';        
        params += '&sancho_slot_id=' + $(this).attr('sancho_entity_id');      
        params += '&sancho_page_area_name=' + $(this).parents("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").parent().parent().attr('id');       
        Camargue.Tooltip.addBlockTitle('Product');            
        Camargue.Tooltip.addLink('Remove product', MODULE_URL + '/remove_product.php' + '?' + params, '', {type: 'delete', modalWidth: 450, modalHeight: 110, modalName: 'man_giuntios_catalog_summary_product_remove'}); 
				///////////// END ACTIONS ///////////////
      	Camargue.Tooltip.show(e);
        e.stopPropagation();
      }            
    });
    $('*').click(function(){
    	Camargue.Tooltip.hide(); 
    });    
    //////////////////////// END TOOLTIP //////////////////////////                  
	});  
  
  
    /////////////////////////// HOMEPAGE //////////////////////////////
	// box_focuson_02
    if (!$("#box_focuson_02").find("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").length) {
		  var MODULE_URL = null;
		  $('script').map(function(i) { 
		    if (this.src.match(/man_giuntios_catalog_summary_init\.js(\?.*)?$/)) {
		      MODULE_URL = this.src.replace(/\/man_giuntios_catalog_summary_init\.js(\?.*)?$/, '');
		    }
		  });  
	    $("#box_focuson_02").each(function(i) {
	    ////////////////////// START TOOLTIP ////////////////////////  
	    // do stuff                      
	    $('#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: _ product summary _ v.0.1 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 30-12-09';
	        var parent_params = 'sancho_page_area_name=box_focuson_02&sancho_page_id=' + Sancho.curPageId;
	        Camargue.Tooltip.addBlockTitle('Product summary');
	        Camargue.Tooltip.addLink('Add summary', CATALOG_MODULE_URL + '/dashboard.php' + '?' + parent_params + '&mode=browse&target_type=summary', credits, {type: 'add', modalWidth: 800, modalHeight: 500, modalName: 'man_giuntios_catalog'});
			///////////// END ACTIONS ///////////////
	      	Camargue.Tooltip.show(e);
	      }            
	    });
	    $('*').click(function(){
	    	Camargue.Tooltip.hide(); 
	    });    
	    //////////////////////// END TOOLTIP //////////////////////////                  
	    });
    }   
    /////////////////////////// HOMEPAGE //////////////////////////////
	// box_novita_02
    if (!$("#box_novita_02").find("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").length) {
		  var MODULE_URL = null;
		  $('script').map(function(i) { 
		    if (this.src.match(/man_giuntios_catalog_summary_init\.js(\?.*)?$/)) {
		      MODULE_URL = this.src.replace(/\/man_giuntios_catalog_summary_init\.js(\?.*)?$/, '');
		    }
		  });  
	    $("#box_novita_02").each(function(i) {
	    ////////////////////// START TOOLTIP ////////////////////////  
	    // do stuff                      
	    $('#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: _ product summary _ v.0.1 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 30-12-09';
	        var parent_params = 'sancho_page_area_name=box_novita_02&sancho_page_id=' + Sancho.curPageId;;        
	        Camargue.Tooltip.addBlockTitle('Product summary');
	        Camargue.Tooltip.addLink('Add summary', CATALOG_MODULE_URL + '/dashboard.php' + '?' + parent_params + '&mode=browse&target_type=summary', credits, {type: 'add', modalWidth: 800, modalHeight: 500, modalName: 'man_giuntios_catalog'});  
					///////////// END ACTIONS ///////////////
	      	Camargue.Tooltip.show(e);
	      }            
	    });
	    $('*').click(function(){
	    	Camargue.Tooltip.hide(); 
	    });    
	    //////////////////////// END TOOLTIP //////////////////////////                  
	    });
    }   
    /////////////////////////// HOMEPAGE //////////////////////////////
	// box_promozioni_02
    if (!$("#box_promozioni_02").find("*[sancho_entity_type='ManGiuntiOsCatalogSummary']").length) {
		  var MODULE_URL = null;
		  $('script').map(function(i) { 
		    if (this.src.match(/man_giuntios_catalog_summary_init\.js(\?.*)?$/)) {
		      MODULE_URL = this.src.replace(/\/man_giuntios_catalog_summary_init\.js(\?.*)?$/, '');
		    }
		  });  
	    $("#box_promozioni_02").each(function(i) {
	    ////////////////////// START TOOLTIP ////////////////////////  
	    // do stuff                      
	    $('#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: _ product summary _ v.0.1 _ vendor: _ <a href="http://www.manadv.com">man</a> _ last update: _ 30-12-09';
	        var parent_params = 'sancho_page_area_name=box_promozioni_02&sancho_page_id=' + Sancho.curPageId;;        
	        Camargue.Tooltip.addBlockTitle('Product summary');
	        Camargue.Tooltip.addLink('Add summary', CATALOG_MODULE_URL + '/dashboard.php' + '?' + parent_params + '&mode=browse&target_type=summary', credits, {type: 'add', modalWidth: 800, modalHeight: 500, modalName: 'man_giuntios_catalog'});  
					///////////// END ACTIONS ///////////////
	      	Camargue.Tooltip.show(e);
	      }            
	    });
	    $('*').click(function(){
	    	Camargue.Tooltip.hide(); 
	    });    
	    //////////////////////// END TOOLTIP //////////////////////////                  
	    });
    }   
  
  
  
  
  ///////////////////////// CLIENT INIT ///////////////////////////////
  

	// settings for tooltip
	var settings_tooltip = {
		effect: 'slide',
		lazy: false,
		fadeOutSpeed: 500,
		delay: 30,
		predelay: 100,
		relative: true,
		position: "top center",
		relative:false,
		offset: [15, 0]
	};
	
	//set tooltips
	$('a.man_tooltip').tooltip(settings_tooltip);


	//calculate width slider_container
	var slider_container_width = 0;
	$('div.content_product_gallery div.slider div.slider_container > div').each(function(index, domEle){
		slider_container_width = slider_container_width + $(domEle).outerWidth() + parseInt($(domEle).css('margin-right')) + 2;
		//note: 2px for tollerance
	});
	$('div.content_product_gallery div.slider div.slider_container').width(slider_container_width);

	//slider product gallery
	$('div.content_product_gallery div.slider').jScrollHorizontalPane({scrollbarHeight:5, scrollbarMargin:0, dragMinWidth:60, dragMaxWidth:60, wheelSpeed:30});
	
	//block
	$('div.catalog_search_onpage a.button_8').click(function(){
		return false;
	});
	//filter!
	$(':input[name="catalog_text"]').keyup(function(){
		var results_dom = $(this).parents('.catalog_search_onpage').next().next().find('div');
		if($(this).val().length>2){
			//hide all
			results_dom.hide();
			//search
			var filter = $(this).val(), count = 0;
			results_dom.each(function (index, domEle) {
				var rel = $(this).find('a').attr('rel');
			    if ($('div.man_tooltip[title="'+rel+'"]').text().search(new RegExp(filter, "i")) >= 0) {
			       $(this).fadeIn();
			       count++;//use?
			    }
			});
			//end search
		}else if($(this).val().length==0){
			//clear
			results_dom.show();
		}
	});
	$('form[name="catalog_search_mini"]').submit(function(){
		return false;
	});

} 
