function Plusik() {
	this.showFirst = true;
};
Plusik.prototype = {
	hideContent : function(obj) {
		if ( $(obj).parent().find('.plusik_plus_content').length > 0 ) {
			$(obj).parent().find('.plusik_plus_content').hide();
		} else { 
			$(obj).parent().find('*').not('h6, .dontTouchPlusik, script, style, span').hide();
		}
		$(obj).removeClass('minus');
		if ( typeof footer == 'function' ) footer();
	}, 
	showContent : function(obj) {
		if ( $(obj).parent().find('.plusik_plus_content').length > 0 ) {
			$(obj).parent().find('.plusik_plus_content').show();
		} else { 
			$(obj).parent().find('*').not('h6, .dontTouchPlusik, script, style, span').show();
		}
		$(obj).addClass('minus');
		if ( typeof footer == 'function' ) footer();
	},
	init : function() {
		var _self = this;
		$('.plusik_plus_box').each(function() {
			$(this).find('.plusik_plus > h6').each(function(){
				$(this).addClass('plus').css('cursor','pointer');
				_self.hideContent(this);
				$(this).click(function() {
					if ( $(this).hasClass('minus') ) {
						_self.hideContent(this);
					} else { 					
						_self.showContent(this);
					}
					$(this).blur();
					return false;
				});
			});
			if ( _self.showFirst ) {
				_self.showContent ( $(this).find('.plusik_plus > h6').get(0) );
				if ( typeof footer == 'function' ) footer();
			}
		});
		//$('#plusik_expand').click(function() {
		$('#plusik_expand, .plusik_expand').click(function() {
			// rozwin wszystkie
			//	dla wersji z taber.js
			if ( $('.taber_container').length > 0 ) {
				$('.taber_box:visible').find('.plusik_plus > h6').each(function() {
					if ( !$(this).hasClass('minus') ) {
						_self.showContent(this);
					}
				});
			}
			$(this).blur();
			return false;
		});		
		//$('#plusik_collapse').click(function() {
		$('#plusik_collapse, .plusik_collapse').click(function() {
			// zwin wszystkie
			//	dla wersji z taber.js
			if ( $('.taber_container').length > 0 ) {
				$('.taber_box:visible').find('.plusik_plus > h6').each(function() {
					if ( $(this).hasClass('minus') ) {
						_self.hideContent(this);
					}
				});
			}
			$(this).blur();
			return false;
		});
	}
};

$(function() {
	var plus = new Plusik();
	plus.init();
});