(function($)
{
  $.fn.tabs = function(psParent)
  {
    return this.each(function()
    {
      var oSelf = $(this);
  	  $(' > li', this)
    	  .click(
    	    function()
    	    {
            $('> li.htmlmaker_tab_selected', oSelf)
              .removeClass('htmlmaker_tab_selected')
              .each(function()
              {
                $('#tabc_' + $(this).attr('id')).hide();
                $(' > ul > li ', this).removeClass('htmlmaker_tab_selected')
                .each(function()
                {
                  $('#tabc_' + $(this).attr('id')).hide();
                });
              });

            $(this).addClass('htmlmaker_tab_selected');
            $('#tabc_' + $(this).attr('id')).show();

            $(' > ul > li:first-child', this).click();

            //if(!$(this).attr('id').match("^tabagenda"))
              //window.location.hash = '#' + psParent + $(this).attr('id');

            return false;
    	    }
    	  )
    	  .each(
    	    function()
    	    {
    	      $(' > ul', this).tabs($(this).attr('id') + '/');
    	    }
    	  );

    	var sAncre = location.hash.substr(1);
      if (sAncre != '')
      {
        var asTabsSelected = sAncre.split('/');
        for (var nCount = 0; nCount < asTabsSelected.length; nCount++)
        {
          $('#' + asTabsSelected[nCount]).click();
        }
      }
    });
  }
})(jQuery);

$(function(){$(".htmlmaker_block_tabs").tabs('');});