function emailSignup() {

	$('#emailSignup .errors').html('');
	
	var errors = false;
	
	$('#emailSignup input').each(function(index) {
		if ($(this).attr('value')==''||$(this).attr('value')==$(this).attr('placeholder')) {
			errors = true;
		}
	});
	
	if (!errors) {
	
		var email = $('#emailSignup input[name="email"]').attr('value');
		var name = $('#emailSignup input[name="name"]').attr('value');
		var location =$('#emailSignup select[name="location"]').attr('value');
		var month = $('#emailSignup select[name="month"]').attr('value');
		var day = $('#emailSignup select[name="day"]').attr('value');

		$.ajax({
			type:	'POST',
			url:	'/bonemail/inc/emailSignup.php',
			data:	'ajax=1&email='+email+'&name='+name+'&location='+location+'&month='+month+'&day='+day,
			success: function(msg){
				//console.log(msg);
				if (msg!=1) {
					$('#emailSignup .errors').html(msg);
				} else {
					$('#emailSignup p').html('Thanks for signing up!');
					$('#emailSignup p').show('fast');
					$('#emailSignup .hide').hide('medium');
				}
			},
			error: function(msg){
				//console.log(msg);
			}
		});
		
	} else {
	
		$('#emailSignup .errors').html('All fields not completed.');
		
	}
	
}

function sendMail() {

	$('#mail .errors').html('');
	
	var errors = false;
	
		
	if (!errors) {
	
		var email = $('#mail input[name="email"]').attr('value');
		var name = $('#mail input[name="name"]').attr('value');
		var location =$('#mail select[name="location"]').attr('value');
		var phone =$('#mail input[name="phone"]').attr('value');
		var note =$('#mail textarea[name="notes"]').attr('value');
		var check = $('#mail input[name="check"]').attr('value');

		$.ajax({
			type:	'POST',
			url:	'/assets/inc/sendmail.inc.php',
			data:	'ajax=1&email='+email+'&name='+name+'&location='+location+'&phone='+phone+'&note='+note+'&check='+check,
			success: function(msg){
				//console.log(msg);
				if (msg!=1) {
					$('#mail .errors').html(msg);
				} else {
					$('#mail p').html('Thank you for your interest!');
					$('#mail p').show('100');
					$('#mail .hide').hide('medium');
				}
			},
			error: function(msg){
				//console.log(msg);
			}
		});
		
	} else {
	
		$('#mail .errors').html('All fields not completed.');
		
	}
	
}
