// JavaScript Document

$(function() {

	// Remove .no-js class
	$('html').removeClass('no-js');
		
	// Retina support
	$(function() {
		$('img.retina').retina();		
	});
		
	// List Styling
	$('li:odd').addClass('odd');
	$('li:even').addClass('even');
	$('ul li:first-child').addClass('first');
	$('ul li:last-child').addClass('last');
	$('ol li:first-child').addClass('first');
	$('ol li:last-child').addClass('last');
	
	// Scroll Button without Plugin
	$('a.scroll-btn[href*="#"]').click(function() {
  	$('html, body').animate({ scrollTop: 0 }, 'slow');
  	return false;
	});
	
	// Initialize accordion
	$('.accordion .pane').hide();
	//$('.accordion .pane:first').show();
	//$('.accordion .accordion-btn:first').addClass('open');
	
	// Show/Hide Panes General
	$('.accordion .accordion-btn').click(function() {
		$(this).toggleClass('open');
		$(this).next().animate(
		{'height':'toggle'}, 'slow'
		);
	});
	
	// Initialize Slideshow
	slideShow();
	
});

// Slideshow function
function slideShow() {
  var current = $('#slides .show');
  var next = current.next().length ? current.next() : current.parent().children(':first');
  current.fadeOut('slow').removeClass('show');
  next.fadeIn('slow').addClass('show');
  setTimeout(slideShow, 7000);
}
