$.fn.fancybox.defaults = {
		padding				:	10,
		margin				:	20,
		opacity				:	false,
		modal				:	false,
		cyclic				:	false,
		scrolling			:	'auto',	// 'auto', 'yes' or 'no'

		width				:	560,
		height				:	340,

		autoScale			:	true,
		autoDimensions		:	true,
		centerOnScroll		:	false,

		ajax				:	{},
		swf					:	{ wmode: 'transparent' },

		hideOnOverlayClick	:	true,
		hideOnContentClick	:	false,

		overlayShow			:	true,
		overlayOpacity		:	0.7,
		overlayColor		:	'#2d4e61', //'#666'    #ea0b8c'

		titleShow			:	true,
		titlePosition		:	'outside',	// 'outside', 'inside' or 'over'
		titleFormat			:	null,

		transitionIn		:	'elastic',	// 'elastic', 'fade' or 'none'
		transitionOut		:	'elastic',	// 'elastic', 'fade' or 'none'

		speedIn				:	300,
		speedOut			:	300,

		changeSpeed			:	300,
		changeFade			:	'fast',

		easingIn			:	'swing',
		easingOut			:	'swing',

		showCloseButton		:	true,
		showNavArrows		:	true,
		enableEscapeButton	:	true,

		onStart				:	null,
		onCancel			:	null,
		onComplete			:	null,
		onCleanup			:	null,
		onClosed			:	null
	};


//    FancyBox


$(document).ready(function() {
			/*
			*   Examples - images
			*/

			// This version constantly shows Page Number
			$("a[rel=alaska],a[rel=bethel],a[rel=culture],a[rel=fishing],a[rel=hunting_gathering],a[rel=kuskokwim_river],a[rel=outdoor_adventures],a[rel=snowmobiling],a[rel=sub_regional_clinics],a[rel=wildlife],a[rel=working_at_ykhc]").fancybox({
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'titlePosition' 	: 'over', // change to NONE to delete image number
				'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
				    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';		
				}
			});
			
// This version shows what is is in the Title Page		
//			$("a[rel=alaska],a[rel=bethel],a[rel=culture],a[rel=fishing],a[rel=hunting_gathering],a[rel=kuskokwim_river],a[rel=outdoor_adventures],a[rel=snowmobiling],a[rel=sub_regional_clinics],a[rel=wildlife],a[rel=working_at_ykhc]").fancybox({
//				'titlePosition'	:	'over',
//				'onComplete'	:	function() {
//					$("#fancybox-wrap").hover(function() {
//					$("#fancybox-title").show();
//					}, function() {
//					$("#fancybox-title").show();
//					});
//				}
//			});

			
//			---------------------------------------------
			
			/*
			*   Examples - various
			*/
			
			$("#various1").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
			
			$("#various2").fancybox({
				ajax : {
				    type	: "POST",
				    example	: 'myexample=test'
				}
			});
	
	
		$("#various3").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
		
	
	
	// this calls up the vide from YouTube
	
			$("#video").fancybox({
				'width'				: 431,
				'height'			: 375,
		        'autoScale'     	: false,
		        'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'type'				: 'iframe',
				'scrolling'			: 'no'
			});
			
	
		
	
//	$("video").click(function() {
	//$.fancybox({
//			'padding'		: 0,
//			'autoScale'		: false,
//			'transitionIn'	: 'elastic',
//			'transitionOut'	: 'elastic',
	//		'title'			: this.title,
//			'width'		: 431,
//			'height'		: 389,
//			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
//			'type'			: 'swf',
//			'swf'			: {
	//		   	 'wmode'		: 'transparent',
//				'allowfullscreen'	: 'true'
//			}
//		});

//return false;
//});
	
	
	
$("#youtube_video").click(function() {
	$.fancybox({
		'padding'		: 0,
		'autoScale'		: false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'title'			: this.title,
		'width'		: 450,
		'height'		: 344,
		'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'type'			: 'swf'
		
				});

	return false;
});
		});


//   this calls the PDF page

$(document).ready(function() {
		$(".openPDF").fancybox({
				'width'				: 700,
				'height'			: 540,
				'autoScale'     	: false,
		        'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'speedIn'			:	50, 
				'speedOut'			:	50, 
				'type'				: 'iframe',
				'scrolling'			: 'no'
			});

});

//   this calls the PDF -- page another way

$("a.simplefancypdf").fancybox({
'width': 700540, // or whatever you want
'height': 480, // or whatever you want
'type': 'iframe'

});


