		$(document).ready(function() {

$("a[rel=vid1]").click(function() {
	$.fancybox({
                        	'height'            	: 382, 
                        	'width'                	: 442,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	     	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
              	'content'               	: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'	   	: {
		'wmode'		: 'opaque' },
    		'titlePosition' 	: 'inside',
		'title'                	: this.title,
    		'titleShow'             	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});
$("a[rel=vid2]").click(function() {
	$.fancybox({
                        	'height'            	: 300, 
                        	'width'                	: 340,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	     	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
              	'content'               	: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'	   	: {
		'wmode'		: 'opaque' },
    		'titlePosition' 	: 'inside',
		'title'                	: this.title,
    		'titleShow'             	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});
$("a[rel=vid3]").click(function() {
	$.fancybox({
                        	'height'            	: 440, 
                        	'width'                	: 520,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	     	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
              	'content'               	: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'	   	: {
		'wmode'		: 'opaque' },
    		'titlePosition' 	: 'inside',
		'title'                	: this.title,
    		'titleShow'             	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});
$("a[rel=vid4]").click(function() {
	$.fancybox({
                        	'height'            	: 110, 
                        	'width'                	: 140,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	     	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
              	'content'               	: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'	   	: {
		'wmode'		: 'opaque' },
    		'titlePosition' 	: 'inside',
		'title'                	: this.title,
    		'titleShow'             	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});
$("a[rel=vid5]").click(function() {
	$.fancybox({
                  	'height'         	: 330, 
                     	'width'                 	: 180,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	       	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
                  	'content'		: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'		: {
		'wmode'		: 'opaque' },
                      	'titlePosition' 	: 'inside',
		'title'		: this.title,
                       	'titleShow'	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});
$("a[rel=vid6]").click(function() {
	$.fancybox({
                  	'height'         	: 230, 
                     	'width'                 	: 320,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	       	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
                  	'content'		: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'		: {
		'wmode'		: 'opaque' },
                      	'titlePosition' 	: 'inside',
		'title'		: this.title,
                       	'titleShow'	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});
$("a[rel=vid7]").click(function() {
	$.fancybox({
                  	'height'         	: 90, 
                     	'width'                 	: 488,
		'autoScale'	: false,
		'autoDimensions'	: true,
		'margin'		: '0.0',
		'scrolling'	       	: 'no',
		'centerOnScroll'	: true,
		'transitionIn'	: 'elastic',
		'transitionOut' 	: 'elastic',
		'easingIn'		: 'swing',
		'easingOut'	: 'swing',
		'overlayColor'	: '#000',
		'overlayOpacity'	: 0.3,
                  	'content'		: 'html',
		'type'		: 'iframe',
		'href'		: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'swf'		: {
		'wmode'		: 'opaque' },
                      	'titlePosition' 	: 'inside',
		'title'		: this.title,
                       	'titleShow'	: true,
    		'onComplete'    	: function() { 
                                         $.fancybox.resize(); 
}
});
return false;
});

			$("a[rel=example_group]").fancybox({
				'autoScale'		: false,
				'centerOnScroll'		: true,
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'easingIn'			: 'swing',
				'easingOut'		: 'swing',
				'overlayColor'		: '#000',
				'overlayOpacity'		: 0.3,
				'titlePosition' 		: 'inside',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
		});
