jQuery().ready(function(){
	// simple accordion
	jQuery('#list1a').accordion();
	jQuery('#list1b').accordion({
		autoheight: false
	});

	// bind to change event of select to control first and seconds accordion
	// similar to tab's plugin triggerTab(), without an extra method
	var accordions = jQuery('#list1a, #list1b, #list2, #list3, #navigation, #wizard');

	jQuery('#switch select').change(function() {
		accordions.accordion("activate", this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		accordions.accordion("activate", -1);
	});
	jQuery('#switch2').change(function() {
		accordions.accordion("activate", this.value);
	});
	jQuery('#enable').click(function() {
		accordions.accordion("enable");
	});
	jQuery('#disable').click(function() {
		accordions.accordion("disable");
	});
	jQuery('#remove').click(function() {
		accordions.accordion("destroy");
		wizardButtons.unbind("click");
	});
});

function abreOpcao(opcao) {
	var construcoes = opcao == 'btn_home_box_aba_01_fcd' ? 'btn_home_box_aba_01_abt' : 'btn_home_box_aba_01_fcd';
	var incorporacoes = opcao == 'btn_home_box_aba_02_fcd' ? 'btn_home_box_aba_02_abt' : 'btn_home_box_aba_02_fcd';
	var concessoes = opcao == 'btn_home_box_aba_03_fcd' ? 'btn_home_box_aba_03_abt' : 'btn_home_box_aba_03_fcd';
	
	if(document.getElementById('btn_home_box_aba_01_fcd')) {
		document.getElementById('btn_home_box_aba_01_fcd').id = construcoes;
	}
	else {
		document.getElementById('btn_home_box_aba_01_abt').id = construcoes;		
	}

	if(document.getElementById('btn_home_box_aba_02_fcd')) {
		document.getElementById('btn_home_box_aba_02_fcd').id = incorporacoes;
	}
	else {
		document.getElementById('btn_home_box_aba_02_abt').id = incorporacoes;		
	}
	
	if(document.getElementById('btn_home_box_aba_03_fcd')) {
		document.getElementById('btn_home_box_aba_03_fcd').id = concessoes;
	}
	else {
		document.getElementById('btn_home_box_aba_03_abt').id = concessoes;		
	}
}