$(document).ready(function() {

	$(".logo a").append("<span></span>");
	$(".logo_vall a").append("<span></span>");
	$("#home .postit").append("<span></span>");
	$("#content_main .team li.director").append("<span></span><span class='r'></span>");
	$("#content_main .team li").append("<span></span>");
	$("#content_main.team_director .info_ppal").append("<span></span>");
	$("#content_main .publications h2").append("<span></span>");
	$(".programs_fitxa .director").append("<span></span>");
	$("h2.publications").append("<span></span>");
	/*$(".boxes li").append("<span></span>");*/
	
	$("#container_sub.interior .logotips").addClass("clearfix");
	
	//box clicables
	$("#content_main .team li").click(function(){  
      window.location=$(this).find("a").attr("href");  
      return false;  
	}); 
	
	//box clicables
	$(".boxes li").click(function(){  
      window.location=$(this).find("a").attr("href");  
      return false;  
	}); 
	

	//external links
	$("a[rel=external]").attr("target", "_blank");
	$("a[href$=.pdf]").attr('target', '_blank');

	changeMail();
});

// Mostra el text informatiu al camp de cerca
function clear_search_text_login(){
	$('#campcercar').val('');
}
$(document).ready(function () {
	$('#campcercar').focus(clear_search_text_login);
});

/* funció per evitar spam als correus */
function changeMail() {
	$("a[href*='(ELIMINAR)']").each(function(i) {
		omg = $(this).attr('href');
		omg2 = $(this).text();
		$(this).attr('href', omg.split('(ELIMINAR)').join(''));
		$(this).text(omg2.split('(ELIMINAR)').join(''));
	});
}


function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

