// JavaScript Document

$(document).ready(function() {
	
	/*PDF*/
			$(".pdf").click(function() { 
				$.fancybox({ 
				'width': '70%', // or whatever 
				'height': '90%', 
				'autoDimensions': false, 
				'content': '<embed src="'+this.href+'#nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="100%" width="100%" />', 
				'onClosed': function() { 
			$("#fancybox-inner").empty(); 
				} 
			}); 
	return false; 
});  
	/*YouTube*/		
			$("#youtube1").click(function() {
				$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'title'			: this.title,
				'width'		: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
			   	'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
				}
			});

	return false;
});
			$("#youtube2").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});
			$("#youtube3").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});
			$("#youtube4").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

		$("#youtube5").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

		$("#youtube6").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

		$("#youtube7").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

		$("#youtube8").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'title'			: this.title,
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

	return false;
});

			$("a#example1").fancybox({
				'titleShow'		: false
			});

			$("a#example2").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a#example3").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'
			});

			$("a#example4").fancybox();

			$("a#example5").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#example6").fancybox({
				'titlePosition'	: 'over'
			});
/*Image Gallery*/
			$("a[rel=example_group]").fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				$("a[rel=example_group2]").fancybox({
				'titlePosition' 	: 'none',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over2">Image </span>';
				}
			});
			$("#article1").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article2").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article3").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article4").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article5").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article6").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article7").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});
			$("#article8").fancybox({
				'width'				: 700,
				'height'			: '85%',
				'autoScale'			: false,
				'xzoom'				: '100%',
				'yzoom'				: '100%',
				'type'				: 'iframe'
			});

		}); 
		
		
