/**
* Fabriq.js
*
*/

$(function(){
	var bd = $('#bd');

	// Expanded blocks initialisation
	var expBlocks = $('.expblock', bd);

	expBlocks.each( function(i){
		var _that = $(this);

		var expControl = _that.find('a.dynamic'),
			expBody = _that.find('.expbody')

		// Collapse all blocks with no class=expanded on init
		if( !_that.hasClass('expanded') ) {
			expControl.removeClass('ico-minus').addClass('ico-plus');

			expBody.hide();
			_that.expand = false;
		} else {
			_that.expand = true;
		}

		expControl.click( function(){
			if( _that.expand ){
				_that.expand = false;
				expBody.slideUp('fast');
				$(this).removeClass('ico-minus').addClass('ico-plus');
			} else {
				_that.expand = true;
				expBody.slideDown('fast');
				$(this).removeClass('ico-plus').addClass('ico-minus');
			}

			return false;
		});

	});
});


/*
var basket = (function() {
	var oform = null,
		notifier = null;

	function _save() {

	}

	function _notifierShow() {
		if( notifier ) {
			notifier.animate({
				marginBottom: 0
			});
		}
	}

	return {
		init: function( id ) {
			oform = $('#' + id);
			notifier = oform.find('.warning');
		},

		save: function() {
		}
	}
})();
*/
