jQuery(document).ready(function() {
	
	//show details/hide details
	//jQuery(".accordion .options-list").before('<div class="toggle-docs-links"><a class="toggle-docs-detail" href="#">Show All</a></div>');//

	var showExamples = true;
	jQuery(".toggle-docs-detail").toggle(function(e){
		var details = jQuery(this).text("Hide All")
			.parent().next("ul").find("li > div:first-child").addClass("header-open");
		if ( showExamples ) {
			details.nextAll().show('fast');
		} else {
			details.next().show('fast');
		}
		e.preventDefault();
	},function(e){
		jQuery(this).text("Show All")
			.parent().next("ul").find("li > div:first-child").removeClass("header-open")
			.nextAll().hide('fast');
		e.preventDefault();
	});

	//Initially hide all options/methods/events
	jQuery('div.option-description').hide();
	
	//Make list items collapsible
	jQuery('div.option-header h3').live('click', function() {
		var details = jQuery(this).parent().toggleClass('header-open');
		if ( showExamples ) {
			details.nextAll().toggle('fast');
		} else {
			details.next().toggle('fast');
		}
	});
});

jQuery(document).ready(function(){
	$('.accordion .head').click(function() {
		$(this).next().toggle('fast');
		return false;
	}).next().hide();
});