jQuery(function($){
	$.nyroModalSettings({
		processHandler: function(settings) {
			var from = settings.from;
			if (from && from.href && from.href.indexOf('http://www.youtube.com/watch?v=') == 0) {
				$.nyroModalSettings({
					type: 'swf',
					height: 385,
					width: 640,
					minHeight: 385,
					minWidth: 640,
					padding: 25,
					zIndexStart: 1000,
					url: from.href.replace(new RegExp("watch\\?v=", "i"), 'v/')
				});
			}
		},
		hideContent: function(elts, settings, callback) {
			elts.contentWrapper
				.animate({
					opacity: 0
				}, {duration: 350, complete: function() {
					elts.contentWrapper.hide();
					callback();
				}});
		}
	});
	
	$('.video a').nyroModal();
});
