function subscribe(name,email) {

	fail = 0;

	if(name == ''){
		$('#name').css({
					backgroundColor: '#fbe8e8',
					color: 'Red'
				})
		$('#nLabel').css({
					backgroundColor: '#fbe8e8',
					color: 'Red'
				}).append(' (required)');
		
		fail = 1;
	}
	if(email == ''){
		$('#email').css({
					backgroundColor: '#fbe8e8',
					color: 'Red'
				})
		$('#eLabel').css({
					backgroundColor: '#fbe8e8',
					color: 'Red'
				}).append(' (required)');
		
		fail = 1;
	}
	
	if(fail == 1){
		return null;
	}
	

	$.ajax({		
		type: "POST",
   		url: "subscribe.php",
   		data: 	'name='+name+'&email='+email,
		success: function(msg)
			{
   				$('#Register form').fadeOut('slow',function(){
   					$('#Register form').empty();
   					$('#Register form').prepend('<h2 id="response">Thank you for your interest in 4 Paths to Peace!</h2>');
   					$('#Register form').fadeIn('slow');
   				})
   			}
 	});
};


jQuery(document).ready(function() {

	$("label").inFieldLabels();
	$("label").addClass('label');
	$("#nLabel").addClass('name');
	$("#eLabel").addClass('email');

	$('input#Submit').click(function(){

		name = $('#Register form input#name').val();
		email = $('#Register form input#email').val();
		
		subscribe(name,email);
		
		return false;
	});

});

window.onload = function()
{


}
