// base.js

if(typeof jQuery != 'undefined') {
	
	$(document).ready(function() {
		// your jquery magic goes here
	});
	
	// fancybox
	$(document).ready(function() {
		$('a.enlarged').fancybox({
			centerOnScroll: false,
			titlePosition: 'inside',
			transitionIn: 'elastic',
			transitionOut: 'elastic',
			overlayColor: '#FFF',
			overlayOpacity: 0.5,
			hideOnContentClick: true,
			overlayShow: false
		});
	});
	
	// image fader
	$(document).ready(function() {
		slideshow = $('.content-media');
		children = '> img';
		
		elements = slideshow.find(children);
		amount = elements.size();
		
		if(amount > 1) {
			element = elements.first();
			slideshow.height(element.height());
			
			slideshow.innerfade({
				children: 'img',
				speed: 500,
				timeout: 3000
			});
		}
	});
}
