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">Si us plau introdueix el teu e-mail per tal de poder-te subscriure.</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'>"+"L'e-mail introduďt conté símbols no autoritzats</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'>"+"L'e-mail introduďt és incorrecte.</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'>" + "Les dades s'han enviat correctament. Grŕcies per subscriure't."+ "<br><br>Equip EBWT.</span><br>", css: { backgroundColor: '#345B82', color: '#fff', height: '75px', width: '320px'} });
						
						setTimeout(function() {
							$.unblockUI();			
						},4000);
						
						
						$('#load_animation').html('');
						$('#mail').val('');	
					  
					}				
        	});	
		}
	}
	
		
	}
	
}