// The addLoadEvent function takes as an argument another function which should be executed once the page has loaded.
// Unlike assigning directly to window.onload, the function adds the event in such a way that any previously added onload
// functions will be executed first.
function addLoadEvent(func) {
	var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
var faqBoxes = 9;
function showHide (id) {
  for (i=1;i<=faqBoxes;i++) {
	document.getElementById("faq" + i).style.display = 'none';
  }
  document.getElementById("faq" + id).style.display = ''; 
}

			
		//
		//  In my case I want to load them onload, this is how you do it!
		// 
		//Event.observe(window, 'load', loadAccordions, false);
	
		//
		//	Set up all accordions
		//
		function loadAccordions() {
			/*
			var topAccordion = new accordion('horizontal_container', {
				classNames : {
					toggle : 'horizontal_accordion_toggle',
					toggleActive : 'horizontal_accordion_toggle_active',
					content : 'horizontal_accordion_content'
				},
				defaultSize : {
					width : 525
				},
				direction : 'horizontal'
			});
			*/
			var bottomAccordion = new accordion('vertical_container');
			
		/*	var nestedVerticalAccordion = new accordion('vertical_nested_container', {
			  classNames : {
					toggle : 'vertical_accordion_toggle',
					toggleActive : 'vertical_accordion_toggle_active',
					content : 'vertical_accordion_content'
				}
			});
			*/
			// Open first one
			bottomAccordion.activate($$('#vertical_container .accordion_toggle')[0]);
			
			// Open second one
			// topAccordion.activate($$('#horizontal_container .horizontal_accordion_toggle')[2]);
		}

addLoadEvent(function () {
  // setTimeout(initOverLabels, 50);
  // loadAccordions();
  //prettyForms();
});


