// JavaScript Document
$(document).ready(function() {
	$("a[rel=fotos]").fancybox({
		'autoScale'			: true,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		},
		 'overlayShow'			: true,
		 'overlayOpacity'		: 0.7,
		 'overlayColor'		: '#000'
	});
	
	$("a[rel=press]").fancybox({
		'autoScale'			: true,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		},
		 'overlayShow'			: true,
		 'overlayOpacity'		: 0.7,
		 'overlayColor'		: '#000'
	});
	
	$("#single_image").fancybox({
		'autoScale'			: true,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		},
		 'overlayShow'			: true,
		 'overlayOpacity'		: 0.7,
		 'overlayColor'		: '#000'
	});
	
	$("#epcoverimg").fancybox({
		'autoScale'			: true,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		},
		 'overlayShow'			: true,
		 'overlayOpacity'		: 0.7,
		 'overlayColor'		: '#000'
	});
	
	$("a.youtube").click(function() {
		 $.fancybox({
		  'padding'             : 0,
		  'autoScale'   : false,
		  'transitionIn'        : 'fade',
		  'transitionOut'       : 'fade',
		  'title'               : this.title,
		  'href'                : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		  'type'                : 'swf',    // <--add a comma here
		  'swf'                 : {'allowfullscreen':'true', 'wmode':'opaque'}, // <-- flashvars here
		  'overlayShow'			: true,
		  'overlayOpacity'		: 0.7,
		  'overlayColor'		: '#000'
		  });
		 return false;
	}); 
	
	$("#newslettermodal").fancybox({
		'top'				: 20,
		'width'				: 500,
		'height'			: 200,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayShow'		: true,
		'overlayOpacity'	: 0.7,
		'overlayColor'		: '#000'
	});
});
