function slideSwitch() {
	var $active = $('ul.index-buckets li a.all-gates-a img.active');

	if ( $active.length == 0 ) $active = $('ul.index-buckets li a.all-gates-a img:last');

	var $next =  $active.next().length ? $active.next()
		: $('ul.index-buckets li a.all-gates-a img:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
			$active.removeClass('active last-active');
		});
}

jQuery(document).ready(function(){	

	$(".fancybox").fancybox({
		'hideOnContentClick': true,
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	500, 
		'speedOut'		:	500, 
		'overlayShow'	:	true,
		'overlayOpacity':	0.8,
		'overlayColor'	:	'#333',
		'showCloseButton':	true,
		'showNavArrows'	:	true,
		'titleShow'		:	true,
		'titlePosition'		:	'over'
	});


$("#navigation ul li a.bespoke-wooden-gates-a").hover(function() {
	$(".subnav").stop(true, true).slideToggle('medium'); },
function() {
	$(".subnav").stop(true, true).slideToggle('medium');
});

$(".subnav").hover(function() {
	$(this).stop(true, true).show(); },
function() {
	$(this).stop(true, true).slideUp('medium');
});

$(function() {
	setInterval( "slideSwitch()", 3000 );
});

$("#contact a#runner-cta-contact").removeAttr("href");
$("#contact a#runner-cta-contact").hover(function() {
	$(this).css({cursor: arrow});
});
				
});
