/*///////////////////////////////////////////////////////////////////////
Part of the code from the book 
Building Findable Websites: Web Standards, SEO, and Beyond
by Aarron Walter (aarron@buildingfindablewebsites.com)
http://buildingfindablewebsites.com

Distrbuted under Creative Commons license
http://creativecommons.org/licenses/by-sa/3.0/us/
///////////////////////////////////////////////////////////////////////*/

jQuery(document).ready(function() {

	jQuery('#optin_submit').click(function() {
		// Update user interface
		jQuery('#response').html(pleaseWait);
		var firstname = escape(jQuery("#firstname").val());
		var email = escape(jQuery("#email").val());
		jQuery.get(pluginUrl + "store-address.php", { firstname: firstname, email: email, optinajax: 'true' },
			function(data){
				response = eval(data);
				if (response.indexOf('Error'))
				{
					response = '<span class="error">' + response + '</span>';
				}
				jQuery('#response').html(response);
				if (data == 'allright') { window.location = okLink; }
			});
	});

});
