

$(document).ready(function() {

$("#overlay-bainbridge").click(function(){
	$("#bainbridge").fadeIn('slow');
	return false;

});

$("#overlay-whirled").click(function(){
	$("#whirled").fadeIn('slow');
	return false;

});

$("#overlay-redgate").click(function(){
	$("#redgate").fadeIn('slow');
	return false;

});

$("#overlay-stockwell").click(function(){
	$("#stockwell").fadeIn('slow');
	return false;

});

$("#overlay-space").click(function(){
	$("#space").fadeIn('slow');
	return false;

});

$("#overlay-space19").click(function(){
	$("#space19").fadeIn('slow');
	return false;

});

$("#overlay-zoom").click(function(){
	$("#zoom").fadeIn('slow');
	return false;

});

$("#overlay-parkhall").click(function(){
	$("#parkhall").fadeIn('slow');
	return false;

});

$(".close").click(function(){
	$('.popup-details').fadeOut('slow');
	return false;
}); 

//$(".about a").hover(function(){
//	$(this).slideup('slow');
//});

 

});



$(document).ready(function(){
	
	$('#submit').click(function(){
	
		$('#errors').html('');
		$('#response').html('');

		var email = $.trim($('#cemail').val());
		
		if (validateEmail(email))
		{
			var option = $('.emailsignup input:radio:checked').val();

			$.post("send-email.php", {email: email, subscribeoption: option, ajaxenabled: true}, function(message){
					$('#response').html(message);
				});
		}
		
			
		return false;

	});

});

function validateEmail(email)
{
	if (email.length == 0) {
		$('#errors').html('Please enter an email address');
		return false;
	}
	
	var regex =  /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;

	if(!regex.test(email)) {
		$('#errors').html('Your email address should be in the format name@domain.com');
		return false;
	}
	
	return true;
}



