
	  
	$(document).ready(function(){
		$("#ajax-refer-a-friend-form").submit(function(){

		var str = $("#ajax-refer-a-friend-form").serialize();

						   $.ajax({
						   type: "POST",
						   url: "mail-refer-a-friend.php",
						   data: str,
						   success: function(msg){
						    
		$("#refer-a-friend-form-note").ajaxComplete(function(event, request, settings){
		$("#refer-a-friend-form-note").show();
		if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
		{
			result = '<span class="notification_ok">Thank you for signing your friend up for Thought for Today. They will begin receiving the Daily Thoughts within 1 week.<br />If they do not see them, please ask them to check their spam folder. If they still do not see them, please email us at <a href="mailto:info@thought42day.com">info@thought42day.com</a> and we will check on it for you.</span>';
			$("#fields2").hide();
		}
		else
		{
			alert (msg);
			//result = msg;	
		}

		$(this).html(result);

		});

		}
						 });

		return false;

		});

	});