

function evento(){ 
	this.req = false; 
	this.HTMLAsociado = "COMPONENTES/evento.html";
	this.fundirCapaPrevia = false;
	this.contador = 0;
	this.cargarHTML="";
	
	
	}
	
	
	evento.prototype.cargarEnCapa = function(capa){ this.capaCarga = capa; }
	
	evento.prototype.init = function(){
		
		this.cargarHTML = this.HTMLAsociado;
			
			if(this.fundirCapaPrevia){
				new Effect.Appear(this.capaCarga, {duration:0.3,ref:this, from:1, to:0, afterFinish:  function(){this.ref.cargar(this.ref.cargarHTML,"mostrarDatos");}});
				}
			else{
				this.cargar(this.cargarHTML,"mostrarDatos"); 
				}
		}
	
	evento.prototype.mostrarDatos = function(){
		if (this.req.readyState == 4) {
			var contenedor = this.capaCarga;
			contenedor.innerHTML = " ";
			contenedor.innerHTML = this.req.responseText;
			}
	}
		
	evento.prototype.cargar = function(url, metodo){
		if(window.XMLHttpRequest && !(window.ActiveXObject)) { 
			try {this.req = new XMLHttpRequest(); } catch(e) {this.req = false;}
		} else if(window.ActiveXObject) { 
			try {this.req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try {this.req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {this.req = false;} } }
			if(this.req) { 
				var loader = this;
				this.req.onreadystatechange = function() { 
				eval("loader."+metodo+".call(loader)")
				}
			this.req.open("GET", url, true);
			this.req.send("");
			}
		}
		
	
