// JavaScript Document
	oLoteo = function(){ this.init(); }
	var p = oLoteo.prototype;
	
	p.req = null;
	p.wait = false;
	p.oInfo = null;
	p.iIdioma = 1;
	p.sBtnConsulta = 'Consulte sobre este Lote';
	p.sVendido = 'Vendido';
	p.sDisponible = 'Disponible';
	p.sReservado = 'Reservado';	
	
	p.init = function(){
		this.req = new Request();
		this.req.listener = this.response.closure(this);
	}
	
	p.info = function(s){
		var v = '';
		if(this.wait){ return false; }
		this.wait = true;
		
		v += 'datos|=|' + s + '|&|';
		$('lloader').style.display = 'block';
		
		this.req.pedir(DIR_ROOT + 'requests/loteo.php', v);
	}
	
	p.response = function(){
		var d = this.req.respuestaXML, t = (Nav.esIE)? 'innerText':'textContent';
		this.wait = false;
		
		$('lloader').style.display = 'none';
		
		if(!d){ return alert(this.req.respuestaHTML); }
		else{
			this.oInfo = new Object;
			this.oInfo.m = $('lmanzana')[t] = d.getAttribute('m');
			if(this.oInfo.m == 100){
				$('lmanzanas').style.display = 'none';
				$('lparcelas').style.display = 'block';
			}
			else{
				$('lparcelas').style.display = 'none';
				$('lmanzanas').style.display = 'block';
			}
			this.oInfo.l = $('lparcela')[t] = $('llote')[t] = d.getAttribute('l');
			$('lsup')[t] = d.getAttribute('s');
			$('lfospor')[t] = d.getAttribute('fp');
			$('lfosmet')[t] = d.getAttribute('fm');
			$('lfot')[t] = d.getAttribute('fot');
			
			var contenidoLote = '';
			if(d.getAttribute('estado') == 'disponible'){
				contenidoLote = '<img src="' + DIR_ROOT + 'img/disponible' + this.iIdioma + '.gif" alt="' + this.sDisponible + '" /><br />' + 
				'<input type="button" value="' + this.sBtnConsulta + '" onclick="Consulta.show();" />';
			}
			else if(d.getAttribute('estado') == 'vendido'){
				contenidoLote = '<img src="' + DIR_ROOT + 'img/vendido' + this.iIdioma + '.gif" alt="' + this.sVendido + '" />';
				
			}
			else if(d.getAttribute('estado') == 'reservado'){
				contenidoLote = '<img src="' + DIR_ROOT + 'img/reservado' + this.iIdioma + '.gif" alt="' + this.sReservado + '" />';	
			}
			
			$('lvendido').innerHTML = contenidoLote;
			$('lcoment')[t] = d.firstChild.data;
			
			$('lvacio').style.display = 'none';
			$('linfo').style.display = 'block';
		}
	}
	
