//function to control expandable accordion
var currentsection=0;

$(document).ready(function() {

// slideshow
    $('#homebanner')
		.before('<div id="slidenav"')
		.cycle({
			fx: 'fade',
			speed: 3000, 
			timeout: 1000, 
			pause: true,
			autostop: 0
//			pager: '#slidenav'
	});
	
	// show first accordion
//	$(".homeaccordionbody").css('height',sectionareaheight);
	$("#hidehomeaccordion").show();
	openaccordionsection('1');	

});	

function openaccordionsection(sectionnumber){	
	// Hide all sections and make all images minus signs
	$(".homeaccordionbody").hide();
	$(".homeaccordionhead img").attr("src", "images/plus.gif");

	//If the current section isn't already open
	if(sectionnumber!=currentsection){
		// open the selected section and make it a plus.
		$("#homeaccordionbody"+sectionnumber).show();
		$("#homeaccordionhead"+sectionnumber+" img").attr("src", "images/minus.gif");		
		currentsection=sectionnumber;
	}
	// If the current section is open, then we aren't opening anything.  
	// We need to change currentsection so it will open if we click on it again
	else{
		currentsection=0;
	}

}
