// JavaScript Document

$(document).ready(function() {
	
	
	// Gallery TPW Calls.
	
	
	// Function to stop certain nav links from working
	
	$("#nav li.dead:has(ul)").hover(function () {
     	$(this).children("a").click(function () {
       		return false;
     	});
 	});

			
	// Registration Form
	$(".email-pop").fancybox({
		'height'			: 384,
        'width'		     	: 500,
		'padding'			: 30,
		'titleShow'			: false,
        'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'type'				: 'iframe'
		
	});
	
	// Google Map
	$(".googlemap").fancybox({
		'height'			: 650,
        'width'		     	: 800,
		'titleShow'			: false,
        'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'padding'			: 10,
		'type'				: 'iframe'
	});
	
	// popup
	$(".popup").fancybox({
		'height'			: 750,
        'width'		     	: 700,
		'titleShow'			: false,
        'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'padding'			: 10,
		'type'				: 'iframe'
	});
	
	$('.popup').click(function(){
		$('#fancybox-content').css('border-left', '20px solid #fff'); 
		$('#fancybox-content').css('border-top', '20px solid #fff'); 
		$('#fancybox-content').css('border-bottom', '20px solid #fff'); 
		$('#fancybox-content').css('border-right', '2px solid #fff'); 
		
	});
		
		
	// Image gallery. Resizes to content, close button, caption over image
	$(".gallery a").fancybox({
		'transitionIn'			: 'fade',
		'transitionOut'			: 'fade',
		'cyclic'				: 'true',
		'padding'				: 13,
		'titlePosition' 		: 'inside',
		'titleFormat'			: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-inside">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + ' - ' + (title.length ? '' + title : '') + '</span>';
			}
	});
	
	$(".subscribe-submit").click(function(){
		parent.$.fancybox.close();
	});
		
	/* Fancybox Ends */
	
});
