jQuery.fn.highlight=function(b){function a(c,f){if(c.nodeType==3){var e=c.data.toUpperCase().indexOf(f);if(e>=0){var d=document.createElement("a");d.className="destacado";e=c.splitText(e);e.splitText(f.length);var g=e.cloneNode(true);d.appendChild(g);d.href="/buscar.php?s="+encodeURIComponent(g.data);e.parentNode.replaceChild(d,e);return 1}}else if(c.nodeType==1&&c.childNodes&&!/(script|style)/i.test(c.tagName))for(d=0;d<c.childNodes.length;++d)d+=a(c.childNodes[d],f);return 0}return this.each(function(){a(this,
b.toUpperCase())})};
$(document).ready(function(){var b=/[\&\?][qp]=([^\&]*)/.exec(location.href+" "+document.referrer);b&&document.getElementById("cuadro-busqueda").setAttribute("value",decodeURIComponent(b[1].replace(/\+/g," ")));max=Math.max($("#lateral-izq").length>0?$("#lateral-izq").height()+$("#lateral-izq").position().top:0,$("#lateral-der").height())+10;max>$("#principal").height()&&$("#principal").height(max);$("#cuadro-busqueda").attr("default",$("#cuadro-busqueda").val()).focus(function(){var a=$("#cuadro-busqueda").addClass("activo");
a.val()==a.attr("default")&&a.val("")}).blur(function(){var a=$("#cuadro-busqueda").removeClass("activo");a.val().length==0&&a.val(a.attr("default"))});$("a[rel*='external']").attr("target","_blank");$("#cuadro-busqueda").val().length>0&&$(".contenido-documento").highlight($("#cuadro-busqueda").val());$("#menu-xuletas li").each(function(){$(this).hover(function(){var a=this;$("#menu-xuletas li").each(function(){$(this).dequeue().animate({width:a!=this?"21%":"35%"},250,"swing")})},function(){$("#menu-xuletas li").each(function(){$(this).dequeue().animate({width:"24%"},
250,"swing")})})});$("#idiomas").hover(function(){$(this).addClass("abierto")},function(){$(this).removeClass("abierto")});$("#enviar-comentario .text").focus(function(){$(this).addClass("activo").val()==$(this).attr("rel")&&$(this).val("")}).blur(function(){$(this).val().length==0?$(this).val($(this).attr("rel")).removeClass("activo"):$(this).addClass("activo")}).trigger("blur")});
function NubeTags(b,a){$("#nube-cabecera a").each(function(){this.className=this==b?"activo":""});AjaxLoad("#nube-contenido div",a);return false}function AjaxLoad(b,a){$(b).fadeTo("slow",0.01);$.ajax({url:a,success:function(c){checkFx=function(){$(b).queue("fx").length>0?setTimeout(checkFx,30):$(b).html(c).fadeTo("slow",1)};checkFx()},error:function(c,f){$(b).prepend("Error: "+f+"<br />").fadeTo("slow",1)}})};

