(function ($) {
	$(function () {
		var $solutionsUL = $('#solutionsBar > ul.collapsable');
		var delay = 500;

		function closeSolutionItem ($target) {
			$target.next('.content').hide(delay);
			$target.removeClass('current');
		}
		function openSolutionItem ($target) {
			$target.next('.content').show(delay);
			$target.addClass('current');
		}
		
		if ($solutionsUL.length) {
			var $items = $('.item', $solutionsUL);
			$('a.icon', $items).bind('click', function (e) {
				e.preventDefault();
				$this = $(e.currentTarget);
				if ($this.hasClass('current')) {
					closeSolutionItem($this);
				}
				else {
					closeSolutionItem($('a.current', $items));
					openSolutionItem($this);
				}
			});
		}
	});
})(jQuery);
