// This plugins extend the link inner a block to all the container-block
// and activate the click funciont over all the block
(function($) {

 $.fn.linkExtender = function(settings) { 
     var config = { 
   	  	'_targetBlank'		:	false,		// open in new window the link
		'_disableLink'		:	true		// disable the source link function
     };

   if (settings) $.extend(config, settings);

   this.each(function(){
       if($(this).find('a').length != 0) {
           $(this).css('cursor','pointer')
           if(config._disableLink) $(this).find('a').click(function(e){ e.preventDefault(); })
           $(this).click(function(){
               var link = $(this).find('a').attr('href') 
               if(config._targetBlank) window.open(link)
               else window.location=link
           })
       }
   });

   return this;

 };

})(jQuery);


