$(document).ready(function() {
	
$(function() {
	$('a.derry').attr('style', 'cursor:pointer');
	$('a.belfast').attr('style', 'cursor:pointer');
	$("a.derry").click(function(x) {
		$(this).parent().parent().parent().find("#maps-belfast").fadeOut('500',function(){
		$(this).parent().parent().parent().find("#maps-derry").animate({"opacity": "toggle"}, { duration: 300 });
		x.stopPropagation();
		});
	});
	$("a.belfast").click(function(x) {
		$(this).parent().parent().parent().find("#maps-derry").fadeOut('500',function(){
		$(this).parent().parent().parent().find("#maps-belfast").animate({"opacity": "toggle"}, { duration: 300 });
		x.stopPropagation();
		});
	});
});

    
var $container = $('#gallery');
$container.imagesLoaded(function(){
  $container.masonry({
    itemSelector : 'li',
     columnWidth : 1
      //isAnimated: true
  });
});

	
$(document).keypress(function(e)
	{
		switch(e.which)
		{
			

			// user presses the "f" key and gets a big surprise
			case 102:	showViaKeypress("#fax");
						break;

			
		}
	});	
	
	function showViaKeypress(element_id)
{
	 
$(element_id).css("display","block");



} 
});


$(window).load(function() {
	$('.flexslider').flexslider({
		animation: 'fade',
		slideshowSpeed: 5000,
		animationDuration: 400,
		directionNav: false,            		
		controlNav: false
	});
});
 

$("a.fb").fancybox({
	'padding': '0',
	  'transitionIn': 'elastic',
	  'transitionOut': 'elastic',
	  'titlePosition': 'over',
	  'titleFormat': function(title, currentArray, currentIndex, currentOpts) {
	      return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
	}
});


$('#showreel').fitVids();

$('#xmas-cheer').fadeIn("slow");

//$('#hiring').fadeIn("2000").delay("12000").fadeTo("slow", 0.33);


