/* ASIDE NAV */

$(document).ready(function(){
	/* This code is executed after the DOM has been completely loaded */

	/* Binding a click event handler to the links: */
	$('li.button a').click(function(e){
	
		/* Finding the drop down list that corresponds to the current section: */
		var dropDown = $(this).parent().next();
		
		if( dropDown.hasClass('dropdown') )
		{
			/* Closing all other drop down sections, except the current one */
			$('.dropdown').not(dropDown).slideUp('fast');
			dropDown.stop(false,true).slideToggle('fast');
			
			/* Preventing the default event (which would be to navigate the browser to the link's address) */
			e.preventDefault();
		}
	})
	
});



/* HOME - SLIDESHOW */

$(document).ready(function(){
	$('#home_slideshow').bxSlider({
		controls:false,
		pager:true,
		auto:true,
		autoHover: true
	});
});

/* POPUP AUTO */
$(document).ready(function(){
	$(".fancy_auto").fancybox({"hideOnContentClick": false
	}).trigger("click");
});
