																																																																																				
$(document).ready(function()
{
	$('.gallery') .cycle({ 
		fx:     'scrollHorz', 
		speed:  'slow', 
		timeout: 6500, 
		pager:  '.gallery_nav',
		pagerAnchorBuilder: function(index, el) {
			return '<a href="#"></a>';
		},
		pause: 1
	});
	
	$("#CalendarContent").load("http://www.whitbychristianfellowship.org.uk/calendar.php");
	
	$(".audio_download").html('<img src="http://www.whitbychristianfellowship.org.uk/assets/layout/download_sm.png" alt="Download" />');

	$("#audio_search").click(function(){
		$("#audio_form").slideToggle();
	});
	
	$(".gal_pop").fancybox({
		'width'			: 800,
		'height'		: 550,
        	'autoScale'     	: false,
        	'autoDimensions'	: false,
       		 'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'			: 'iframe'
	});
	
	$(".gal_video").click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'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;
	});
	
	$(".fancybox").fancybox({
		openEffect	: 'none',
		closeEffect	: 'none'
	});
});
					
function moveCalendar(pDate)
{
	if(pDate==null)
	{
		pDate = document.getElementById('datepicker').value;
	}

	$("#CalendarContent").load("http://www.whitbyec.com/calendar.php", { 'Date[]': [pDate] });
}
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
function showBlogs(pID)
{
	$('#'+pID).toggle();
}

function AccommodationYear(pYear,pRoomID)
{
	$('#Accommodation').load('http://www.whitbychristianfellowship.org.uk/accommodation.php?Year='+pYear+'&RoomID='+pRoomID);
}
