$(document).ready(function() {
	$("#distribucion").change(function() {
		var form = $("#formComboDistribucion");
		form.attr("action", form.attr("action").replace("---distr---", $(this).val()));
		form.submit();
	});

	var textoBusqueda = "Buscar...";

	if($("#Query").val().length == 0)
		$("#Query").val(textoBusqueda);

	$("#Query").focus(function(){
		if($(this).val() == textoBusqueda)
			$(this).val("");
	});

	$("#Query").blur(function(){
		if($(this).val() == textoBusqueda || $(this).val().length == 0)
			$(this).val(textoBusqueda);
	});

	$("div.cajaEstadoDnu img.info").mouseover(function(event){
		var id = $(this).parent().parent().parent().attr("id");
		var tooltip = $("div#tooltip-" + id);
		tooltip.css("position", "absolute");
		tooltip.css("display", "block");
		tooltip.css("top",  event.pageY + 5);
		tooltip.css("left", event.pageX + 5);
	})

	$("div.cajaEstadoDnu img.info").mouseout(function(){
		var tooltip = $(this).parent().parent().parent().parent().find("div.estadoTooltip");
		tooltip.css("display", "none");
	})
});
