	var accordion;
	var currentIndex;
	var lightbox;	
	
	$(document).ready(function(){
														 
		// Launches Accordion on page complete 												 
		accordion = $('.accordion').classicAccordion({width:1000, height:434, slideshow:true, shadow:false, shuffle:true, alignType:'rightCenter', closedPanelSize:0, slideshowDelay:10000, animationComplete:onAnimationComplete, openPanel:onOpenPanel, stopSlideshowOnHover:false, openPanelOnMouseOver:false, stopSlideshowOnHover:false, closePanelOnMouseOut:false,
		panelProperties:{
											0:{captionWidth:260, captionHeight:45, captionTop:350, captionLeft:-1},
											1:{captionWidth:260, captionHeight:45, captionTop:350, captionLeft:-1},
											2:{captionWidth:260, captionHeight:45, captionTop:350, captionLeft:-1}										
										}
										});
		
		accordion.openPanel(0);
		
		// Launches PrettyPhoto on page complete
		//lightbox = 	$("a[rel^='prettyPhoto']").prettyPhoto();	

	});	
	
	function onAnimationComplete() {
		// if the accordion has just closed
		if (accordion.getAccordionState() == 'closed') {
			if (currentIndex == 2)
				currentIndex = 0;
			else
				currentIndex++;
			
			// open the panel after 1 second
			setTimeout(function(){accordion.openPanel(currentIndex);}, 200);
		}
	}
	
	// get the index of the currently loaded panel
	function onOpenPanel(obj) {
		currentIndex = obj.index;
	}
