function clean() {
	if ($('#email').val()=="El teu e-mail") {
		$('#email').val("");	
	}
}

function restore() {
	if ($('#email').val()=="") {
		$('#email').val("El teu e-mail");	
	}
}

function send() {
	if (validate($('#email').val())) {
		$.post("send.php","email="+$('#email').val(), function(data) { $('.text-form').html("Moltes gràcies!"); });
	}
}

function validate(email) {
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	var address = email;
	if (reg.test(address) == false) {
		alert('Pareix que no has introduit el teu e-mail correctament');
		return false;
	} else {
		return true;
	}
}

