$(function() {
	$(".column").sortable({
		connectWith: '.column',
		revert: true,
		tolerance: 'pointer',
		opacity: 0.5,
		stop: function() {
			
		},
	});
	
	$(".column_grande").sortable({
		revert: true,
		tolerance: 'pointer',
		opacity: 0.5,
		stop: function() {
			
		},
	});
	

	$(".column_lateral").sortable({
		connectWith: '.column_lateral',
		revert: true,
		tolerance: 'pointer',
		opacity: 0.5
	});
	
	$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
		.find(".portlet-header")
			.addClass("ui-widget-header ui-corner-all")
			.prepend('<span class="ui-icon ui-icon-plusthick"></span>')
			.end()
		.find(".portlet-content");

	$(".portlet-header .ui-icon").click(function() {
		$(this).toggleClass("ui-icon-minusthick");
		$(this).parents(".portlet:first").find(".portlet-content").toggle();
	});

	$(".column").disableSelection();
	$(".column_grande").disableSelection();
	$(".column_lateral").disableSelection();
	
	$('body').layout({ 
		   applyDefaultStyles: true
		,  fxName:                       "slide"
		,  fxSpeed:                      "slow"
		,  north__fxName:                "none"
		,  south__fxName:                "none"
		,  spacing_closed:               14
		,  north__togglerLength_closed:  "100%"
		,  south__togglerLength_closed:  "100%"
		,  initClosed:                   false
		,  south__spacing_open:			 0		
		,  south__spacing_closed:	     0	
		,  north__spacing_open:			 0
		,  north__spacing_closed:        0
		
		,  west__spacing_closed:		 0
	});
	
	
});

