function news_ajax(mail){
	if($('#'+mail).val()=='' || $('#'+mail).val()=='ingresá tu e-mail'){
		$('#'+mail).focus();
		return;
	}
	if ($('#'+mail).val().match("@") == null || $('#'+mail).val().match(".") == null){
		alert('El campo email debe contener un email válido');
		$('#'+mail).focus();
		return;
	}
	/*$('#msg').css('display','none');
	$('#cargando').css('display','block');*/
	html='mail=' + $('#'+mail).val() + '&ajax=1';
	$.ajax({
		type: 'POST',
		url: 'http://www.iafi.com.ar/agregarnews.php',
		cache: false,
		data: 'mail=' + encodeURIComponent($('#'+mail).val()) + '&ajax=1',
		success: function(h){
			if(h.charAt(0)=='0'){ //Error
				//$('#cargando').css('display','none');
				alert(h.substring(3));
				$('#'+mail).focus();
				return;
			}else{
				/*$('#cargando').css('display','none');
				$('#msg').css('display','block');
				$('#msg').html(h);*/
				 alert(h.substring(3));
				 $('#'+mail).val("");
				 return;
			}
		},
		error: function(){
			alert(html);
		}
	});
	
}

function ajax2(){
	$.ajax({
   type: "POST",
   url: "algo.php",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Funciona: " + msg );
   }
 });

}