function tooltips() {
	
	
	$('a').qtip({				
		   content: $(this).title,
		   position: {
			  corner: {
				 target: 'bottomMiddle',
				 tooltip: 'topMiddle'
			  }
   		   },
		   style: { 			  
			  padding: 5,
			  background: '#053466',
			  color: '#cdff00',
			  textAlign: 'center',
			  border: {
				 width: 2,
				 radius: 3,
				 color: '#cdff00'
			  },
			  tip: 'topMiddle'	  
		   }

		})	
	
	$('area').qtip({
		   content: $(this).title,
		   position: {
			  corner: {
				 target: 'bottomMiddle',
				 tooltip: 'topMiddle'
			  }
   		   },
		   style: { 
			  width: 200,
			  padding: 5,
			  background: '#053466',
			  color: '#cdff00',
			  textAlign: 'center',
			  border: {
				 width: 2,
				 radius: 3,
				 color: '#cdff00'
			  },
			  tip: 'topMiddle'		  
		   }

		})	
}

function subscribeMail() {
	email = $('#mail').val();	
	
	if(email=='') {
		$.blockUI({ message: '<br><span class="letra_dialog">You\'ve got to specify your e-mail in order to get subscribed. Thanks.</span><br>', css: { backgroundColor: '#345B82', color: '#fff', height: '55px', width: '300px'} });
		setTimeout(function() {
			$.unblockUI();			
		},4000);
		$('#mail').focus();
	} 
	if (email !== "")
	{
	//Expresiones regulares (plant --> Email sin caracteres inválidos, plant2 --> estructura de la @ corecta.
	var plant = /[^\w^@^\.^-]+/gi
	var plant2 = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	//email = dat.email.value;	
	if (plant.test(email)) {
		$.blockUI({ message: "<br><span class='letra_dialog'>"+"E-mail adress incorrect. Please give us your correct e-mail adress in order to get subscribed. Thanks.</span><br>", css: { backgroundColor: '#345B82', color: '#fff', height: '55px', width: '300px'} });
		setTimeout(function() {
			$.unblockUI();			
		},4000);
		$('#mail').focus();
		}
		else {
		if (!(plant2.test(email))){
		$.blockUI({ message: "<br><span class='letra_dialog'>"+"E-mail adress incorrect. Please give us your correct e-mail adress in order to get subscribed. Thanks.</span><br>", css: { backgroundColor: '#345B82', color: '#fff', height: '55px', width: '300px'} });
		setTimeout(function() {
			$.unblockUI();			
		},4000);
		$('#mail').focus();
		}
		else {
		
		$('#load_animation').html("<img src='img/load.gif' />");
		
			$.ajax( 
				{ 
				  type: "GET", 
				  url: "../../../../includes/subscribe.php",  
				  data: "email="+email+
						"&idioma=en",
				  success: 
					function(resultText) {             	
						
						$.blockUI({ message: "<br><span class='letra_dialog'>" + "Data sent succesfully. Thanks for subscribing. <br><br>EBWT Team."+ "</span><br>", css: { backgroundColor: '#345B82', color: '#fff', height: '75px', width: '320px'} });
						
						setTimeout(function() {
							$.unblockUI();			
						},4000);
						
						
						$('#load_animation').html('');
						$('#mail').val('');	
					  
					}				
        	});	
		}
	}
	
		
	}
	
}

function colabora()
{
	
//Controles campos
//E-mail
email = $('#e-mail').val();	
	
	if(email=='') {
		$.blockUI({ message: '<br><span class="letra_dialog">Please give us your e-mail adress.</span><br>', css: { backgroundColor: '#345B82', color: '#fff', height: '55px', width: '300px'} });
		setTimeout(function() {
			$.unblockUI();			
		},4000);
		$('#mail').focus();
		return false;
	}

//Nombre
if ($('#nombre').val() == "")
{
	$.blockUI({ message: '<br><span class="letra_dialog">Please give us your name.</span><br>', css: { backgroundColor: '#345B82', color: '#fff', height: '55px', width: '300px'} });
		setTimeout(function() {
			$.unblockUI();			
		},4000);
		$('#nombre').focus();
		return false;
	} 


//País
if ($('#pais').val() =="")
{
	$.blockUI({ message: '<br><span class="letra_dialog">Please give us your country.</span><br>', css: {backgroundColor: '#345B82', color: '#fff', height: '55px', width: '300px'} });
		setTimeout(function() {
			$.unblockUI();			
		},4000);
		$('#pais').focus();
		return false;
}

//Mandar datos

$('#load_animation').html("<img src='img/load.gif' />");	
$.ajax(
{
	type:"GET",url:"send.php",data:"email="+$('#e-mail').val()+"&nombre="+$('#nombre').val()+"&internet="+$('#internet').val()+"&alojamiento="+$('#alojamiento').val()+"&taller="+$('#taller').val()+"&informacion="+$('#informacion').val()+"&conferencias="+$('#conferencias').val()+"&medico="+$('#medico').val()+"&agua="+$('#agua').val()+"&alimentos="+$('#alimentos').val()+"&donaciones="+$('#donaciones').val()+"&pais="+$('#pais').val()+"&comments="+$('#comments').val(),
	success:
	function(resultText){             	
						$.blockUI({ message: '<br><span class="letra_dialog">Data sent succesfully. Thanks for your collaboration.</span><br>', css: { backgroundColor: '#345B82', color: '#fff', height: '75px', width: '320px'} });
						setTimeout(function() {
							$.unblockUI();			
						},4000);					  
					}				
});
}