'use strict';

/**
 * Extremely simple visibility toggle jQuery plugin.
 * Kinda slow, but targeted towards small projects.
 */
(function ($) {
	'use strict';
	$.fn.visibilityToggle = function (name, value) {

		// Get the targets
		var key = 'visibility-toggle-' + name;
		var elements = $(this).find('[data-' + key + ']');

		// Set the proper visibility
		elements.each(function () {
			var values = ($(this).data(key) + '').split(',');
			$(this).toggle(values.indexOf(value + '') !== -1);
		});
	};
})(jQuery, window, document);
