$(document).ready(function(){

	/* AJAX Forms */	
	$('#mailinglist_form').ajaxForm({  
	  target:"#mailinglist_form .temp",   
	  beforeSubmit:function(){ 
	     $("#mailinglist_form .msg").html("Sending...");
	  },
	   success:function() { 
			if ($("#mailinglist_form .temp #content").has("ul").length ){
		   			$("#mailinglist_form .msg").html(  $("#mailinglist_form .temp #content ul li").html() );
		   	} else {
		   			$("#mailinglist_form .msg").html(  "Thank you. Please check your email for a confirmation message." );
		   	}
	      $("#mailinglist_form .temp").empty();
	   } 
	});

});

