var $j = jQuery.noConflict();
     
// Use jQuery via $j(...)
$j(document).ready(function(){
	$j("#select_zona_ev").change(onSelectEv).change();
	$j("#select_tipo_ev").change(onSelectEv).change();
        $j(".action").jHelperTip({
         trigger: "hover",
         source: "attribute",
         attrName: "alt",
         opacity: 0.8,
         autoClose:true
        });

});
function onSelectDate(fecha) {
	zona = $j("#select_zona_ev option:selected").val();
	tipo = $j("#select_tipo_ev option:selected").val();

	if(fecha == 0 ) return true;
	$j("#contenedor").hide();
	$j("#loading_cont").show();
	var options = {
	  url: "/eventos/box.php",
	  type: 'POST',
	  async: false,
	  data: "ajax=1&fecha="+ fecha,
	  success: function(resp) { 
                document.getElementById("contenedor").innerHTML=resp;
		$j("#loading_cont").hide();
                $j("#contenedor").show();
		return true;
	  },
	  complete: function(resp) { 
	  },
	  error: function(resp,txterr, ult) {
		alert("ERROR: "+ resp.responseText + " " + txterr + " " + ult);
		return false;
	  }
	};
	$j.ajax(options);

	return false;
}


    
function onSelectEv(event) {
	var id = $j(event.target).attr("id");
	var zona = '';
	var tipo = '';
	zona = $j("#select_zona_ev option:selected").val();
	tipo = $j("#select_tipo_ev option:selected").val();

	if(zona == 0 && tipo == 0) return true;
	$j("#contenedor").hide();
	$j("#loading_cont").show();
	var options = {
	  url: "/eventos/box.php",
	  type: 'POST',
	  async: false,
	  data: "ajax=1&zona="+ zona + "&tipo=" + tipo,
	  success: function(resp) { 
                document.getElementById("contenedor").innerHTML=resp;
		$j("#loading_cont").hide();
                $j("#contenedor").show();
		return true;
	  },
	  complete: function(resp) { 
	  },
	  error: function(resp,txterr, ult) {
		alert("ERROR: "+ resp.responseText + " " + txterr + " " + ult);
		return false;
	  }
	};
	$j.ajax(options);

	return false;
}
