Cufon.set('fontFamily', 'MyriadPro');
Cufon.replace('#top-news h2');
Cufon.replace('#footer h2');
Cufon.replace('#header .tel');

if ($('.btn_text_more').length)
{
	$('.btn_text_more').click(function(){
		$(this).parent().find('.text_more').slideToggle();
		if ($(this).html() == 'Czytaj więcej') {
			$(this).html('Czytaj mniej');
		} else {
			$(this).html('Czytaj więcej');
		}	
		return false;
	})
}

if ($('.btn_text_more_2').length)
{
	$('.btn_text_more_2').click(function(){
		$(this).parent().parent().find('.text_more').slideToggle();
		return false;
	})
}

/* ta ACCORDION 1.0 */
(function($){
  $.fn.ta_accordion = function(options) 
  {    
    var defaults = {
      tab     : '.item',
      trigger : 'h2',
      hook    : 'h2'
    };
    var options =  $.extend(defaults, options);
    
    var id = this.selector;


    $(id+' '+options.tab).hide();
    $(id+' '+options.trigger+':first').addClass('current').next().show();
    
    $(id+' '+options.hook).click(function() {
      if ($(this).parent(options.trigger).html()) {
        if($(this).parent(options.trigger).next().is(':hidden')) {
          $(id+' '+options.trigger).removeClass('current').next().slideUp();  
          $(this).parent(options.trigger).addClass('current').next().slideDown();
        }
      } else {
        if($(this).next().is(':hidden')) {
          $(id+' '+options.trigger).removeClass('current').next().slideUp();  
          $(this).addClass('current').next().slideDown();
        }
      }
      return false;
    });
  };
})(jQuery);

$('#inspiracje').ta_accordion();
