//pageload.js

// do stuff when DOM is ready
$(document).ready(function() {

	// hide all the panels of the accordian
	$('div.accordion> div').hide();   
 	$('div#accordion1> div').hide();   
	// 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', function() {
		$visibleSiblings.slideUp('fast');
		});
//		});
		} else {
		$nextDiv.slideToggle('fast');
		}
	});
	
	$('div#accordion1> h3').click(function() {
		var $nextDiv = $(this).next();
/*		var $visibleSiblings = $nextDiv.siblings('table:visible');
		if ($visibleSiblings.length ) {
		$nextDiv.slideToggle('fast', function() {
		$visibleSiblings.slideUp('fast');
		});
		} else {*/
		$nextDiv.slideToggle('fast');
/*		}*/
	});

});
