$(function() {

	var isEmail_re       = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/;
	
	function isEmail (s) {
		return String(s).search (isEmail_re) != -1;
	}

	var st_stephens = new Date ( 2008, 11, 26, 0, 0, 0 );
	var st_pattys = new Date ( 2010, 2, 17, 0, 0, 0 );

	$('a.lightbox').lightBox();

	$('#gallery a').lightBox();
	
	$('#adBlock').click(function () {
		window.location.href = "http://claddaghirishpubs.com/events/book-your-event/"
	});
	
	$('#menuBar > ul > li').hover(
      function () {
        $(this).addClass('over');
      }, 
      function () {
        $(this).removeClass('over');
      }
    );


	$('#book_event').submit(function(){
		var email_addy = $('#book_event #email').val();
		
		if (!isEmail(email_addy))
		{
			alert('Your email address is required.');
			return false;
		}
	});

	$('#st_stephens').countdown({until:st_stephens});
	$('#st-pattys').countdown({until: st_pattys});

	$("#location-menu").change(function() {
		window.location = $(this).val();
	});

	$("#event-location-menu").change(function() {
		window.location = $(this).val();
	});

	$("#quick-nav").change(function() {
		window.location = $(this).val();
	});

	$("#gallery-select").change(function() {
		window.location = $(this).val();
	});

});