jQuery().ready(function(){
	// simple Accordion
	jQuery('#list1').Accordion();
	
	// second simple Accordion with special markup
	jQuery('#navigation').Accordion({
		active: false,
		header: '.head',
		navigation: true,
		event: 'mouseover',
		autoheight: true,
		animated: 'easeslide'
	});
	
	// highly customized Accordion
	jQuery('#list2').Accordion({
		event: 'mouseover',
		active: '.selected',
		selectedClass: 'active',
		animated: "bounceslide"
	}).change(function(event, newHeader, oldHeader, newContent, oldContent) {
		jQuery('<div>' + oldHeader.text() + ' hidden, ' + newHeader.text() + ' shown</div>').appendTo('#log');
	});
	
	// first simple Accordion with special markup
	jQuery('#list3').Accordion({
		header: 'div.title',
		active: false,
		alwaysOpen: false,
		animated: false
	});
	
	var wizard = $("#wizard").Accordion({
		header: '.title',
		event: false
	});
	
	$("div.title", wizard).each(function(index) {
		$(this)
		.next()
		.children(":button")
		.filter(".next, .previous")
		.click(function() {
			wizard.activate(index + ($(this).is(".next") ? 1 : -1))
		});
	});
	
	// bind to change event of select to control first and seconds accordion
	// similar to tab's plugin triggerTab(), without an extra method
	jQuery('#switch select').change(function() {
		jQuery('#list1, #list2, #list3, #navigation').activate( this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		jQuery('#list1, #list2, #list3, #navigation').activate(-1);
	});
	jQuery('#switch2').change(function() {
		jQuery('#list1, #list2, #list3, #navigation').activate(this.value);
	});
	
});