$(document).ready(function() {
 
// store url for current page as global variable
//current_page = document.location.href
	var bodyId = document.body.id;
 
// apply selected states depending on current page
		$('nav a').each(function() {
			if ($(this).hasClass(bodyId)) {
				$(this).addClass("active");
			}
		})
		
	$(function() {
	// initialize scrollable
		$(".scrollable").scrollable({ circular: true });
	});
	
	//Accordian

	//Set default open/close settings
	$('.trigger-container').hide(); //Hide/close all containers
 
	//On Click
	$('.trigger').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.trigger').removeClass('active').next().slideUp(function(){}); //Remove all .trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .trigger class to clicked trigger and slide down the immediate next container
	}
	else if( $(this).next().not(':hidden') ) {
		$('.trigger').removeClass('active').next().slideUp();
	}
	return false; //Prevent the browser jump to the link anchor
	});
});
