function sendJoin() {
	var email = document.getElementById('news_email').value;
	var page = 'scripts/xmlHttpRequest.php';
	
	email = email.replace(/&/g,"**am**");
	email = email.replace(/=/g,"**eq**");
	email = email.replace(/\+/g,"**pl**");
	email = email.replace(/\,/g,"**com**");
	
	var post = 'form=join&email='+email;
	
	loadXMLPosDoc(page, post);
	
	var formEmail = document.getElementById('news_email');
	formEmail.value = '';
	
	$('#news_form').addClass('hidden');
	$('#news_copy').addClass('hidden');
	$('#news_thanks').removeClass('hidden');
	
}

function validateJoin() {
var email = document.getElementById('news_email');
var whiteSpace = /^[\s]+$/;
	if ( email.value == '' || whiteSpace.test(email.value) ) {
		alert("Please enter an email address.");
	}
	else {
		sendJoin();
	}
}


function ajaxJoin() {
	var joinForm = document.getElementById('news_form');
	addEvent(joinForm, 'submit', validateJoin, false);
	joinForm.onsubmit = function() { return false; };
}

$(function() {
	ajaxJoin();
});