//pageload.js

// do stuff when DOM is ready
$(document).ready(function() {

	// hide all the panels of the accordian
	$('div.accordion> div').hide();   
 
 	window.scroll(0,0);
	// animated page loading stuff
	// first we hide all the page elements
	// using jquery
	$("h1").hide();
	$("h2").hide();
	$(".accordion").hide();
	
	// then we show them
	$("h1").slideDown(3000);
	var wait = setTimeout("$('h2').fadeIn(3000);",2000);
	var wait = setTimeout("$('.accordion').fadeIn(3000);",3000);
	
	// the function that runs when accordion is clicked
	$('div.accordion> h3').click(function() {
		var $nextDiv = $(this).next();
		var $visibleSiblings = $nextDiv.siblings('div:visible');
		if ($visibleSiblings.length ) {
		$visibleSiblings.slideUp('fast', function() {
		$nextDiv.slideToggle('fast');
		});
		} else {
		$nextDiv.slideToggle('fast');
		}
		window.scroll(0,0);
	});

});

	