$(document).ready(function(){
	$("span.youtube a").addClass('modal iframe watch');
	$("section.slideshow , div.interiorMedia , div.gallery-wrapper").fadeIn(); // It is set to display: none inline on page to hide the loading of images, etc.
});

$(function(){

	$('#coda-slider-1').codaSlider({
		dynamicArrows: false,
		dynamicTabs: false,
		autoHeight: false,
		autoSlide: true
	});
	
	// figure out number of images, then choose the middle one
	var galCnt = $('#gallery li').size();
	var idx = parseInt((galCnt % 2 == 0 ? (galCnt / 2) - 1 : galCnt / 2));
	
	$('#gallery').flowGallery({
		easing: 'easeOutCubic',
		imagePadding: 6,
		thumbWidth: 120,
		activeIndex: idx
	});
	
	$('#coda-slider-interior').codaSlider({
		dynamicArrows: false,
		dynamicTabs: false,
		autoHeight: false,
		autoSlide: true
	});
	
	/*
	$('.modal').fancybox({
		// overlayColor: '#23030d',
		// overlayOpacity: 0.95
		overlayColor: '#330000',
		overlayOpacity: 0.85	
	});
	*/
	
	$('.modal').fancybox({
		autoDimensions: false,
		width: 620,
		height: 380,
		// overlayColor: '#330000',
		overlayColor: '#000000',
		overlayOpacity: 0.85,
		centerOnScroll: true,
		autoScale: true
	});
   
});
