function animar(objeto){
	$.ajax({
		type: "GET",
		url: "/po/mapaweb.html",
		success: function(datos){
			$("#idmapa").html(datos);
	    $(objeto)
			.animate({ 
				opacity: '1',
				top:'0px',
				height: '530px'
			}, 500, function(){$("#mapaCont").show();});
		}
	});	
}
function boletinEnviar(){
	var mensaje = "";
	eval("formulario = document.boletinfr");
	var haylistas = false;
	if (!formulario.acepto.checked) mensaje+="Deve aceitar a política de privacidade.<br />";
	for (i=0;i<formulario.listas.length;i++){
		if (formulario.listas[i].checked == true) haylistas = true;
	}
	if (haylistas == false) mensaje += "Não seleccionou nenhum lista para o subscrever.<br />";
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(formulario.mail.value))) mensaje += "O e-mail está vazio ou está incorrecto.<br />";
	if (formulario.nombre.value == "") mensaje += "O nome está vazio.<br />";

	if (mensaje != "") {
		jQuery.facebox("Dados incorrectos ou incompletos:<br />"+mensaje);
	} else {
		$("#boletindiv_cargando").html("<center><br /><img src='../imagenes/cargandob.gif' /></center>");
		$("#boletindiv").hide();
		$.ajax({
			type:"POST",
			url:"boletin2.asp",
			data:serializar(formulario),
			success: function(datos){
				var a=datos.split("|");
				if (a[0]=="OK"){
					jQuery.facebox(a[1]);
					formulario.reset();
					$(".lista").removeClass("listab");
				} else {
					jQuery.facebox(datos);
				}
			},
			error: function(){jQuery.facebox('Ocorreu um erro, tente mais tarde ou entre em contacto com o administrador.');}
		});
		$('#boletindiv_cargando').html("");
		$("#boletindiv").show();
	}
}
