jQuery(document).ready(function() {
	
	// Classic lightbox
	
	// no next or previous icons -> single image
	// <a id="lightbox1" ...
	$("a#lightbox1").fancybox({
		'titleShow'     : false
	});
	
	// it has next and previous icons -> like a gallery (it filters ALL <a rel="lightbox1" links, as if all are in a gallery)
	// <a rel="lightbox1" ...
	//$("a[rel^=lightbox1]").fancybox({
	//	'titleShow'     : false
	//});
	
	// no next or previous icons -> single image
	// <a class="lightbox1" ...
	$("a[class=lightbox1]").fancybox({
		'titleShow'     : false
	});
	
	// Show title="text" on lightbox image
	$("a#lightbox2").fancybox({
		'titlePosition'  : 'over'
	});
	
	// Requires: 
	// jquery.easing-1.3.pack.js
	// jquery.mousewheel-3.0.2.pack.js
		
	$("a#lightbox3").fancybox({
		'titleShow'     : false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack'
	});
	
	$("a#lightbox4").fancybox({
	    'titleShow'     : false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none'
	});
	
    //YouTube Videos
	
	$("a#youtube").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 680,
			'height'		: 495,
			//'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'href'			: this.href = this.href.replace(new RegExp("watch\\?v=", "i"), 'v/') + '&autoplay=1',
			'type'			: 'swf',
			'swf'			: {
			    'wmode'				: 'transparent',
				'allowfullscreen'	: 'false'
			}
		});

		return false;
	});


});

