//
//  In my case I want to load them onload, this is how you do it!
// 
Event.observe(window, 'load', loadPotd, false);

//
//	Set up all accordions
//
function loadPotd() {
	
	var pic_width = $("potd-anchor").getWidth();

	
	$("potd-image").setStyle({
		width: (pic_width + 40)
	});

	$("potd-pic").setStyle({
		width: (pic_width + 40)
	});
	
	$("potd-collapse-all").setStyle({
		width: (pic_width + 40)
	});
	
	$("potd-content").setStyle({
		overflow: 'visible'
	});

	var potd = new accordion("potd", {
		//resizeSpeed : 10,
		classNames: {
			toggle : "potd-toggle",
			toggleActive : "potd-toggle-active",
			content : "potd-content"
		},
		defaultSize : {
			// width: null
		},
		direction: "vertical"
	});

// Preload
// Special thanks go out to Will Shaver @ http://primedigit.com/
	var verticalAccordions = $$('.potd-toggle');
	verticalAccordions.each(function(accordion) {
		$(accordion.next(0)).setStyle({
			height: '0px'
		});
	});
	

	Event.observe($("potd-collapse-all"), 'click', function(event) {
		$('cabecera_top').scrollTo();
		potd.deactivate();
	});

//	var collapseButtons = $$('potd-collapse-all');
//	collapseButtons.each(function(button) {
								  
		
//	});
	
}