// JavaScript Document

function validateEmail(pEmail)
{
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	return reg.test(pEmail);
}

function joinNewsletter()
{
	if($("#fr_email").val()=="" || !validateEmail($("#fr_email").val()))
	{
		alert("Insert a valid email");
		$("#fr_email").focus();
	}
	else if($("#fr_country").val()=="")
	{
		alert("Insert your country!");
		$("#fr_country").focus();
	}

	else if(!$("#fr_autorizza").attr("checked"))
	{
		alert("Authorise the use of your personal data D.L. 196/03");
	}
	else
	{
		$.post("join_newsletter.asp",{email:$("#fr_email").val(), country:$("#fr_country").val()},join_newsletter_Resul);
	}
}

function join_newsletter_Resul(data){$("#newsletter_cont").html(data);}

