jQuery(document).ready(function() {

	$(".fancyyoutube").click(function() {
		$.fancybox({
			'padding'		: 7,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 900,
			'height'		: 526,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});

		return false;
	});
});


$(document).ready(function () {

       $("a.fancyvideo5").click(function () {
            var url = $(this).attr('vid');
			var img = $(this).attr('name');
			var height = $(this).attr('height');
			var width = $(this).attr('width');

            $.fancybox({
                'padding': 7,
                'overlayOpacity': 0.9,
                'autoDimensions': false,
                'width'			: width,
			    'height'		: height,
                'content': '<div class="video-js-box vim-css">' +
                            '<video id="example_video_1" class="video-js" width="' + width + '" height="' + height + '" controls="controls" preload="auto" poster="' + img + '">' +
                            '<source src="' + url + '" type=\'video/mp4; codecs="avc1.42E01E, mp4a.40.2"\' />' +
                              '<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->' +
                              '<object id="flash_fallback_1" class="vjs-flash-fallback" width="' + width + '" height="' + height + '" type="application/x-shockwave-flash"' +
                                'data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">' +
                                '<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />' +
                                '<param name="allowfullscreen" value="true" />' +
                                '<param name="flashvars" value=\'config={"playlist":["' + img + '", {"url": "' + url + '","autoPlay":false,"autoBuffering":true}]}\' />' +
                                '<!-- Image Fallback. Typically the same as the poster image. -->' +
                                '<img src="' + img + '" width="' + width + '" height="' + height + '" alt="Poster Image"' +
                                 ' title="No video playback capabilities." />' +
                              '</object>' +
                            '</video>' +
                            '</div>',
                'onComplete': function () {
                   $("#fancybox-inner").css({ 'overflow': 'hidden' });
                   VideoJS.setupAllWhenReady();
                },
                'onClosed': function () { $("#fancybox-inner").empty(); }
            });
            return false;
        }); // fancyvideo

        VideoJS.setupAllWhenReady();
    });

$(document).ready(function() {
          $('#gallery a').lightBox();
});

