function Navegador(){
	this.esIE = false;// Internet Explorer
	this.esIE6 = false;
	this.esIE7 = false;
	this.esIE8 = false;
	this.esFf = false;// Mozilla
	this.esOp = false;// Opera
	this.esNs = false;// Netscape
	this.esMz = false;// Netscape	
	
	if(window.navigator.userAgent.search(RegExp("MSIE","im"))!=-1){
		this.esIE = true;
		if(window.navigator.userAgent.search(RegExp("MSIE 8","im"))!=-1) this.esIE8 = true;
		else if(window.navigator.userAgent.search(RegExp("MSIE 7","im"))!=-1) this.esIE7 = true;
		else if(window.navigator.userAgent.search(RegExp("MSIE 6","im"))!=-1) this.esIE6 = true;
	}
	else if(window.navigator.userAgent.search(RegExp("Firefox","im"))!=-1){
		this.esFf = true;
		this.esMz = true;
	}
	else if(window.navigator.userAgent.search(RegExp("Opera","im"))!=-1) this.esOp = true;
	else if(window.navigator.userAgent.search(RegExp("Safari","im"))!=-1) this.esSa = true;
	else if(window.navigator.userAgent.search(RegExp("Netscape","im"))!=-1) this.esNs = true;
};
var Nav = new Navegador();
Function.prototype.closure = function(obj){
	// Init object storage.
	if (!window.__objs){
		window.__objs = [];
		window.__funs = [];
	}
	
	// For symmetry and clarity.
	var fun = this;
	
	// Make sure the object has an id and is stored in the object store.
	var objId = obj.__objId;
	if (!objId) __objs[objId = obj.__objId = __objs.length] = obj;
	
	// Make sure the function has an id and is stored in the function store.
	var funId = fun.__funId;
	if (!funId) __funs[funId = fun.__funId = __funs.length] = fun;
	
	// Init closure storage.
	if (!obj.__closures) obj.__closures = [];
	
	// See if we previously created a closure for this object/function pair.
	var closure = obj.__closures[funId];
	if (closure) return closure;
	
	// Clear references to keep them out of the closure scope.
	obj = null;
	fun = null;
	
	// Create the closure, store in cache and return result.
	var o = __objs[objId].__closures[funId] = function (){
		if(!!__funs[funId] && !!__objs[objId]) return __funs[funId].apply(__objs[objId], arguments);
		else return false;
	};
	o.__funId = funId;
	return o;
	
};

var EliminarClosures = function(o){
	var i = 0;
	if(o){
		if(o.__objId){
			for(i in o.__closures){
				delete(window.__funs[i]);
				delete(o.__closures[i]);
			}
			delete(window.__objs[o.__objId]);
			/*delete(o.__closures);
			delete(o.__objId);*/
			o.__closures = null;
			o.__objId = null;
		}
	}
	i = null;
}

var LimpiarClosures = function(){
	if(!!Nav && !Nav.esIE) window.addEventListener('unload', LimpiarClosures, false);
	else window.detachEvent("onunload",LimpiarClosures);
	
	if(window.__objs){
		for(i in window.__objs) EliminarClosures(window.__objs[i]);
	}
	window.__objs = [];
	window.__funs = [];
};

var Limpiar = function(){
	if(!!Nav && !Nav.esIE) window.addEventListener('unload', LimpiarClosures, false);
	else window.attachEvent("onunload", LimpiarClosures);
}();

document.LimpiarClosures  = LimpiarClosures;
AddEvent = function(o, e, f){
	if(Nav.esIE) o.attachEvent('on'+e, f);
	else o.addEventListener(e, f, ((Nav.esOp)? false : true));
};
RemEvent = function(o, e, f){
	if(Nav.esIE) o.detachEvent('on'+e, f);
	else o.removeEventListener(e, f, ((Nav.esOp)? false : true));
};
FireEvent = function(o, e){
	var evt = null;
	if(Nav.esIE) o.fireEvent('on'+e);
	else{
		if(e=='click' || e=='dblclick' || e=='mousedown' || e=='mousemove' || e=='mouseout' || e=='mouseover' || e=='mouseup'){
			evt = document.createEvent("MouseEvents");
			evt.initMouseEvent(e, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
		}
		else if(e=='keydown' || e == 'keypress' || e == 'keyup'){
			evt = document.createEvent("KeyboardEvent");
			evt.initKeyEvent(e, true, true, null, false, false, false, false, 9, 0);
		}
		else{
			evt = document.createEvent("Event");
			evt.initEvent(e, true, false);
		}
		o.dispatchEvent(evt);
	}
}
StopEvent = function(e){
	if(Nav.esIE){
		e.returnValue = false;
		e.cancelBubble = true;
	}
	else{
		e.preventDefault();
		e.stopPropagation();
	}
}
// JavaScript Document
Request = function(oListener, metodo){
	this.pedido = new crearXHR();
	this.reportar = true;
	this.respuestaXML = null;
	this.respuestaHTML = null;
	this.archivo=null;
	this.valores=null;
	this.listener=oListener;
	//
	if(!metodo) this.metodo = 'POST';
	else this.metodo = metodo;
}
Request.prototype.pedir = function(a, v, m){
	//inicializamos
	if(!!a) this.archivo = a;
	this.valores = v;
	if(!!m) this.metodo = m;
	//
	this.respuestaXML = null;
	this.respuestaHTML = null;
	//
	this.cancelar(this.pedido);
	//
	this.pedido.onreadystatechange = this.procesar.closure(this);
	//
	this.pedido.open(this.metodo, this.archivo, true);
	//
	if(this.valores) this.pedido.send(this.valores);
	else this.pedido.send();
}
Request.prototype.procesar = function(){
	var termino = false;
	if(this.pedido && this.pedido.readyState == 4){
		
		if(this.pedido.status == 200){
			if(this.pedido.responseXML)this.respuestaXML = this.pedido.responseXML.documentElement;
			this.respuestaHTML = this.pedido.responseText;
			
			termino = true;
		}
		else if((this.pedido.status >= 12029 && this.pedido.status <= 12031)  || //
				 this.pedido.status == 12152 || this.pedido.status == 12159){
			//cancelado por el servidor
			this.pedir();
		}
		else if(this.reportar){
			ERROR.reportar(" Error en clase Request.\nESTADO: "+this.pedido.status+" "+this.pedido.statusText+"\nARCHIVO: "+this.archivo+"\nMETODO: "+this.metodo);
			
			termino = true;
		}
		
		if(termino == true){
			this.cancelar();
			
			if(this.listener && this.listener.onRequestLoad) this.listener.onRequestLoad();
			else if(typeof(this.listener)=='function') this.listener();
		}
	}
}
Request.prototype.cancelar = function(){
	cancelarPedido(this.pedido);
}

/* FUNCION DE CREACION DE XMLHttpRequest */
crearXHR = function(){
    var r = null
    if (window.XMLHttpRequest) r = new XMLHttpRequest()
    else if(window.ActiveXObject) {
		var msp = new Array('Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP')
        for(var i = 0; i < msp.length; i++){
            try { r = new ActiveXObject(msp[i]) } catch (e){}
        }
    }
    return r
}
/* FUNCION DE DETENCION DE XMLHttpRequest */
cancelarPedido = function(reqXHR){
	if(reqXHR!=null){
		reqXHR.onreadystatechange=new Function()//una funcion vacia...
		reqXHR.abort()
	}
}

//
ReportarError = function(f, m){
	this.archivo = (!!f)? f:'xmlHttpRequest/reportarError.php';
	this.metodo = (!!m)? m:'POST';
	this.req = new Request();
	this.req.reportar = false;
	this.alerta = true;
	
	this.reportar = function(msj){
		this.req.pedir(this.archivo, msj, this.metodo);
		if(this.alerta) alert("Ha ocurrido un error.\nLos administradores del sistema ya han sido notificados del mismo.\nSi el error continua pongase en contacto con los mismos."+msj);
		return false;
	};
}/**/
ERROR = new ReportarError();
// JavaScript Document
trim = function(str){
	if(str && typeof(str)=='string'){
		var i = 0, x = (l = str.length) - 1;
		while(i<l && str.charAt(i)==" ") i++;
		while(x>0 && str.charAt(x)==" ") x--;
		str = str.substring(i, x + 1);
	}
	return str;
}

/*////////////
File: Tween.js
Creation Date: January 20 2006
Author: Philippe Maegerman
Email: mx2004-at-pandora.be
Website: http://jsTween.blogspot.com
Download: http://cfpim.coffeeflower.com/jsTween/Tween.js
*/////////////
function Delegate() {}
Delegate.create = function (o, f) {
	var a = new Array() ;
	var l = arguments.length ;
	for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i] ;
	return function() {
		var aP = [].concat(arguments, a) ;
		f.apply(o, aP);
	}
}

Tween = function(obj, prop, func, begin, finish, duration, suffixe){
	this.init(obj, prop, func, begin, finish, duration, suffixe)
}
var t = Tween.prototype;

t.obj = new Object();
t.prop='';
t.func = function (t, b, c, d) { return c*t/d + b; };
t.begin = 0;
t.change = 0;
t.prevTime = 0;
t.prevPos = 0;
t.looping = false;
t._duration = 0;
t._time = 0;
t._pos = 0;
t._position = 0;
t._startTime = 0;
t._finish = 0;
t.name = '';
t.suffixe = '';
t._listeners = new Array();	
t.setTime = function(t){
	this.prevTime = this._time;
	if (t > this.getDuration()) {
		if (this.looping) {
			this.rewind (t - this._duration);
			this.update();
			this.broadcastMessage('onMotionLooped',{target:this,type:'onMotionLooped'});
		} else {
			this._time = this._duration;
			this.update();
			this.stop();
			this.broadcastMessage('onMotionFinished',{target:this,type:'onMotionFinished'});
		}
	} else if (t < 0) {
		this.rewind();
		this.update();
	} else {
		this._time = t;
		this.update();
	}
}
t.getTime = function(){
	return this._time;
}
t.setDuration = function(d){
	this._duration = (d == null || d <= 0) ? 100000 : d;
}
t.getDuration = function(){
	return this._duration;
}
t.setPosition = function(p){
	this.prevPos = this._pos;
	var a = this.suffixe != '' ? this.suffixe : '';
	this.obj[this.prop] = Math.round(p) + a;
	this._pos = p;
	this.broadcastMessage('onMotionChanged',{target:this,type:'onMotionChanged'});
}
t.getPosition = function(t){
	if (t == undefined) t = this._time;
	return this.func(t, this.begin, this.change, this._duration);
};
t.setFinish = function(f){
	this.change = f - this.begin;
};
t.geFinish = function(){
	return this.begin + this.change;
};
t.init = function(obj, prop, func, begin, finish, duration, suffixe){
	if (!arguments.length) return;
	this._listeners = new Array();
	this.addListener(this);
	if(suffixe) this.suffixe = suffixe;
	this.obj = obj;
	this.prop = prop;
	this.begin = begin;
	this._pos = begin;
	this.setDuration(duration);
	if (func!=null && func!='') {
		this.func = func;
	}
	this.setFinish(finish);
}
t.start = function(){
	this.rewind();
	this.startEnterFrame();
	this.broadcastMessage('onMotionStarted',{target:this,type:'onMotionStarted'});
	//alert('in');
}
t.rewind = function(t){
	this.stop();
	this._time = (t == undefined) ? 0 : t;
	this.fixTime();
	this.update();
}
t.fforward = function(){
	this._time = this._duration;
	this.fixTime();
	this.update();
}
t.update = function(){
	this.setPosition(this.getPosition(this._time));
	}
t.startEnterFrame = function(){
	this.stopEnterFrame();
	this.isPlaying = true;
	this.onEnterFrame();
}
t.onEnterFrame = function(){
	if(this.isPlaying) {
		this.nextFrame();
		setTimeout(Delegate.create(this, this.onEnterFrame), 0);
	}
}
t.nextFrame = function(){
	this.setTime((this.getTimer() - this._startTime) / 1000);
	}
t.stop = function(){
	this.stopEnterFrame();
	this.broadcastMessage('onMotionStopped',{target:this,type:'onMotionStopped'});
}
t.stopEnterFrame = function(){
	this.isPlaying = false;
}

t.continueTo = function(finish, duration){
	this.begin = this._pos;
	this.setFinish(finish);
	if (this._duration != undefined)
		this.setDuration(duration);
	this.start();
}
t.resume = function(){
	this.fixTime();
	this.startEnterFrame();
	this.broadcastMessage('onMotionResumed',{target:this,type:'onMotionResumed'});
}
t.yoyo = function (){
	this.continueTo(this.begin,this._time);
}

t.addListener = function(o){
	this.removeListener (o);
	return this._listeners.push(o);
}
t.removeListener = function(o){
	var a = this._listeners;	
	var i = a.length;
	while (i--) {
		if (a[i] == o) {
			a.splice (i, 1);
			return true;
		}
	}
	return false;
}
t.broadcastMessage = function(){
	var arr = new Array();
	for(var i = 0; i < arguments.length; i++){
		arr.push(arguments[i])
	}
	var e = arr.shift();
	var a = this._listeners;
	var l = a.length;
	for (var i=0; i<l; i++){
		if(a[i][e])
		a[i][e].apply(a[i], arr);
	}
}
t.fixTime = function(){
	this._startTime = this.getTimer() - this._time * 1000;
}
t.getTimer = function(){
	return new Date().getTime() - this._time;
}
Tween.backEaseIn = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*(t/=d)*t*((s+1)*t - s) + b;
}
Tween.backEaseOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
}
Tween.backEaseInOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158; 
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
Tween.elasticEaseIn = function(t,b,c,d,a,p){
		if (t==0) return b;  
		if ((t/=d)==1) return b+c;  
		if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) {
			a=c; var s=p/4;
		}
		else 
			var s = p/(2*Math.PI) * Math.asin (c/a);
		
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	
}
Tween.elasticEaseOut = function (t,b,c,d,a,p){
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
Tween.elasticEaseInOut = function (t,b,c,d,a,p){
	if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) var p=d*(.3*1.5);
	if (!a || a < Math.abs(c)) {var a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
}

Tween.bounceEaseOut = function(t,b,c,d){
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}
Tween.bounceEaseIn = function(t,b,c,d){
	return c - Tween.bounceEaseOut (d-t, 0, c, d) + b;
	}
Tween.bounceEaseInOut = function(t,b,c,d){
	if (t < d/2) return Tween.bounceEaseIn (t*2, 0, c, d) * .5 + b;
	else return Tween.bounceEaseOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}

Tween.regularEaseIn = function(t,b,c,d){
	return c*(t/=d)*t + b;
	}
Tween.regularEaseOut = function(t,b,c,d){
	return -c *(t/=d)*(t-2) + b;
	}

Tween.regularEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
	}
Tween.strongEaseIn = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}
Tween.strongEaseOut = function(t,b,c,d){
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
	}// JavaScript Document
Acordeon = function(idEleCont, anchoCont, altoCont){
	//
	this.cont = document.getElementById(idEleCont);
	this.altoDisponible = this.cont.offsetHeight;
	this.anchoDisponible = this.cont.offsetWidth;
	//
	if(altoCont && this.altoDisponible < altoCont) this.altoDisponible = altoCont;
	if(anchoCont && this.anchoDisponible < anchoCont) this.anchoDisponible = anchoCont;
	//
	this.menus = new Array;
	this.esperar = false;
	this.menuDesplegado = null;
	this.menuTemp = null;
	
	this.cssTitulosOff = '';
	this.cssTitulosOn = '';
	this.cssCapas = '';
	this.altoTitulos = 0;
	//
	var titOnmouseover = function(e){
    	if(e.titulo.className != this.cssTitulosOn) e.titulo.className = this.cssTitulosOn
    }.closure(this);
	var titOnmouseout = function(e){
		if(this.menuDesplegado && this.menuDesplegado.pos!=e.pos) e.titulo.className = this.cssTitulosOff;
	}.closure(this);
	var titOnclick = function(e){
		this.desplegarMenu(e);
	}.closure(this);
	//
	var cuandoCambio = function(e){
		this.menuTemp.capa.style.height = (this.altoDisponible - parseInt(e.target.obj.height)) + 'px';
	}.closure(this);
	var cuandoTermino = function(e){
		this.esperar = false;
		//
		this.menuDesplegado = this.menuTemp;
		this.menuDesplegado.capa.style.overflow = "auto";
		this.menuTemp = null;
	}.closure(this);
	//
	this.agregarMenu = function(el, tit, fClick){
		var obj = new Object;
		
		obj.pos = this.menus.length;
		obj.fClick = (!!fClick)? fClick:null;
		
		obj.titulo = document.createElement('div');
		this.cont.appendChild(obj.titulo);
		obj.titulo.innerHTML = tit;
		obj.titulo.className = this.cssTitulosOff;
		
		obj.capa = document.createElement('div');
		this.cont.appendChild(obj.capa);
		obj.capa.style.height = 0;
		obj.capa.style.overflow = 'hidden';
		obj.capa.className = this.cssCapas;
		if(obj.titulo.offsetWidth < this.anchoDisponible) obj.capa.style.width = this.anchoDisponible + 'px';
		else obj.capa.style.width = obj.titulo.offsetWidth + 'px';
		
		obj.el = document.getElementById(el);
		if(obj.el==undefined || obj.el==null) return alert("Error JS Acordeon.agregarMenu: Objeto a agregar inexistente.");
		obj.capa.appendChild(obj.el);
		
		if(obj.titulo.offsetHeight < this.altoTitulos) this.altoDisponible -= this.altoTitulos;
		else this.altoDisponible -= obj.titulo.offsetHeight;
		
		obj.titOnmouseover = titOnmouseover;
		obj.titOnmouseover = titOnmouseover;
		obj.titOnclick = titOnclick;
		
		AddEvent(obj.titulo, 'mouseover', function(){ this.titOnmouseover(this); }.closure(obj));
		AddEvent(obj.titulo, 'mouseout', function(){ this.titOnmouseover(this); }.closure(obj));
		AddEvent(obj.titulo, 'click', function(){ this.titOnclick(this); }.closure(obj));
		
		this.menus.push(obj);
		
		obj = null;
	};
	
	this.desplegarMenu = function(objMenu){
		
		if(this.menuDesplegado==null) return alert("Error JS Acordeon.desplegarMenu: El objeto no fue inicializado correctamente.")
		//
		if(this.esperar || this.menuDesplegado.pos==objMenu.pos) return false;
		else this.esperar = true;
		//
		if(!!objMenu.fClick) objMenu.fClick();
		//
		this.menuTemp = objMenu;
		var t1 = new Tween(this.menuDesplegado.capa.style, 'height', Tween.strongEaseOut, this.altoDisponible, 0, 1, 'px');
		//
		t1.onMotionFinished = cuandoTermino;
		t1.onMotionChanged = cuandoCambio;
		//
		this.menuTemp.titulo.className = this.cssTitulosOn;
		this.menuDesplegado.titulo.className = this.cssTitulosOff;
		this.menuDesplegado.capa.style.overflow = "hidden";
		//
		t1.start();
	};
	
	this.init = function(pos){
		if(isNaN(pos)) pos = 0;
		if(this.menus.length < 2) return alert("Error JS Acordeon.init: Debe agregar al menos dos menus al acordeon.")
		else if(this.altoDisponible < 50) return alert("Error JS Acordeon.init: No hay espacio suficiente para desplegar los menus.")
		
		this.menus[pos].capa.style.height = this.altoDisponible + 'px';
		this.menus[pos].capa.style.overflow = 'auto';
		this.menus[pos].titulo.className = this.cssTitulosOn;
		if(!!this.menus[pos].fClick) this.menus[pos].fClick();
		this.menuDesplegado = this.menus[pos];
	};
}// JavaScript Document
// Tomo como paramentros el id del input sobre el cual se realizara el filtrado y un objeto de configuracion
// idInput	= str (id de un elemento del documento)
// o.imagen = str (src de una imagen del sistema)
// o.posicionar = bool (para visualizar de forma absoluta sobre el input)
// o.archivo	= str (path al archivo que genera el filtrado)
// o.nodoPadre	= str (nombre del nodo padre del cual se leeran las opciones de filtrado de lo contrario se leeran los hijos de la raiz)
// o.obligatorio = bool (si el campo es obligatorio, no se podra continuar hasta que no complete este)
//
//Metodos
//el objeto se maneja por si solo
//
//Eventos de respuesta
//cuandoSelecciono	= se dispara una vez que el usuario presiono una opcion o cuando el filtrado arrojo como resultado 1 sola opcion
//cuandoAcerto 		= se dispara cuando el filtrado tuvo exito, obteniendo como respuesta 1 o mas opciones
//cuandoFallo		= se dispara cuando el filtrado no obtuvo ni una sola opcion o cuando intenta abandonar el input sin seleccionar 1 opcion

Filtrador = function(idInput, objConf){
	var oClase = this;
	//
	if(typeof(idInput)=='object') this.input = idInput;
	else this.input = document.getElementById(idInput);
	//this.input.value = '';
	this.input.oInfo = null;
	this.posicionar = !!objConf.posicionar;
	//
	this.contenedor = document.createElement('span');
	this.input.parentNode.insertBefore(this.contenedor, this.input);
	this.contenedor.appendChild(this.input);
	//
	if(!!objConf && !!objConf.imagen && !this.posicionar){
		this.imagen = document.createElement('img');
		this.imagen.src = objConf.imagen;
		this.imagen.style.display = 'none';
		this.imagen.style.position = 'absolute';
		this.imagen.style.paddingLeft = '2px';
		this.imagen.unselectable = true;
		this.contenedor.appendChild(this.imagen);
	}
	//
	this.lista = document.createElement('div');
	if(!this.posicionar) this.contenedor.appendChild(this.lista);
	else this.contenedor.insertBefore(this.lista, this.input);
	this.lista.className = 'FiltradorLayer';
	this.lista.unselectable = true;
	if(objConf.ancho){
		this.anchoMaximo = objConf.ancho;
		this.lista.style.width = objConf.ancho + 'px';
	}
	else{
		this.anchoMaximo = (this.input.offsetWidth - 5);
		this.lista.style.width = (this.input.offsetWidth - 5) + 'px';
	}
	
	//
	this.archivoReq = null;
	this.nodoPadre = null;
	this.req = new Request(this);
	this.esperar = false;
	this.postVarName = 'clave|=|';
	this.opciones = new Array;
	this.exito = false;
	this.intervalo = null;
	this.altoMaximo = 82;
	this.opcionElegida = null;
	this.valorBuscado = '¿¡²';
	this.obligatorio = false;
	this.msgError = 'No se encontraron registros';
	this.noDesplegar = false;
	
	//Eventos del objeto
	this.cuandoSelecciono = null;
	this.cuandoAcerto = null;
	this.cuandoFallo = null;
	
	//
	if(objConf && objConf.archivo) this.archivoReq = objConf.archivo;
	if(objConf && objConf.nodoPadre) this.nodoPadre = objConf.nodoPadre;
	if(objConf && objConf.obligatorio) this.obligatorio = objConf.obligatorio;
	
	//
	this.filtrar = 			function(e, dblclick){
		if(!!e && Nav.esMz) event = e;
		//si es enter
		if(event.keyCode==13 || (event.keyCode==9 && this.input.value!='' && this.input.value!=this.valorBuscado) || dblclick){
			if(Nav.esMz){
				event.preventDefault();
				event.stopPropagation();
			}
			else{
				event.returnValue = false;
				event.cancelBubble = true;
			}
			this.enviar();
		}
		//si es flecha abajo y tuvimos exito en la busqueda
		else if((event.keyCode==40 || event.keyCode==39) && this.exito){
			if(this.lista.style.display!='block' && event.keyCode==39) return true;
			else this.moverAbajo();
			if(Nav.esMz){
				event.preventDefault();
				event.stopPropagation();
			}
			else{
				event.returnValue = false;
				event.cancelBubble = true;
			}
		}
	}
	
	this.salir = 			function(darFocus){
		this.intervalo = window.setTimeout( function(){
			if(darFocus!=false){
				try{oClase.input.focus();}catch(e){;}
			}
			oClase.mostrarLista('none');
		}, 10);
	}
	this.cancelarSalida = 	function(){
		if(this.intervalo){
			window.clearTimeout(this.intervalo);
			delete(this.intervalo);
		}
	}
	
	this.mostrarLista = 	function(valor){
		if(this.imagen){
			this.imagen.style.display = valor;
			if(valor=='block')
				this.lista.style.marginLeft = this.imagen.offsetWidth + 'px';
		}
		else if(this.posicionar){
			this.lista.style.marginLeft = 0;
			this.lista.style.marginTop = (this.input.offsetHeight + 1) + 'px';
		}
		else this.lista.style.marginLeft = '1px';
		//
		this.lista.style.display = valor;
	}
	this.controlarAlto = 	function(){
		if(this.opciones.length > 4){
			//cambiamos
			this.lista.style.height = (this.altoMaximo) + 'px';
			this.lista.style.overflowY = 'scroll';
		}
		else{
			this.lista.style.height = '';
			this.lista.style.overflowY = '';
			if(this.lista.style.width!=(this.anchoMaximo+'px')) this.lista.style.width = this.anchoMaximo + 'px';
		}
	}
	
	this.crearOpcion = 		function(texto, oInfo){
		var a = document.createElement('div');
		this.lista.appendChild(a);
		
		var oOpcion = {objeto:a, oInfo:oInfo, pos:this.opciones.length, seleccionado:false};
		
		a.oPadre = this;
		a.unselectable = true;
		a.innerHTML = 	texto;
		
		a.className = 'FiltradorOpcionOff';
		//a.style.width = this.anchoMaximo+'px';
		
		AddEvent(a, "mouseover", function(){
			RemEvent(this.oPadre.input, "blur", fa_1);
			this.className = 'FiltradorOpcionOn';
		}.closure(a));
		AddEvent(a, "mouseout", function(){
			AddEvent(this.oPadre.input, "blur", fa_1);
			this.className = 'FiltradorOpcionOff';
		}.closure(a));
		AddEvent(a, "focus", function(){
			RemEvent(this.oPadre.input, "blur", fa_1);
			this.className = 'FiltradorOpcionOn';
		}.closure(a));
		AddEvent(a, "blur", function(){
			AddEvent(this.oPadre.input, "blur", fa_1);
			this.className = 'FiltradorOpcionOff';
		}.closure(a));
		AddEvent(a, "click", function(e){
			
			if(this.seleccionado) return false;
			this.seleccionado = true;
			oClase.cancelarSalida();
			oClase.seleccionar(this, false);
			if(Nav.esMz){
				event.preventDefault();
				event.stopPropagation();
			}
			else{
				event.cancelBubble = true;
				event.returnValue = false;
			}
		}.closure(oOpcion));
		AddEvent(a, "mouseup", function(e){
			if(!!e && Nav.esMz) event = e;
			if(this.seleccionado) return false;
			this.seleccionado = true;
			oClase.cancelarSalida();
			oClase.seleccionar(this, false);
			if(Nav.esMz){
				event.preventDefault();
				event.stopPropagation();
			}
			else{
				event.cancelBubble = true;
				event.returnValue = false;
			}
		}.closure(oOpcion));
		AddEvent(a, "keydown", function(){ oClase.detectarTecla() }.closure(a));
		
		this.opciones.push(oOpcion);
		
		a = oOpcion = null;
	}
	this.crearMsgError = 	function(){
		var a = document.createElement('div');
		
		a.unselectable = true;
		a.innerHTML = 	this.msgError;
		
		a.className = 'FiltradorError';
		
		this.lista.appendChild(a);
	}
	this.seleccionarOpcion = function(valor, campo){
		campo = (typeof(campo)=='string')? campo : 'id';
		for(var i = 0; i < this.opciones.length; i++){
			if(this.opciones[i].oInfo[campo]==valor) return this.seleccionar(this.opciones[i], false);
		}
	}
	
	this.seleccionar = 		function(oOpcion, darFocus){
		this.input.value = oOpcion.objeto.innerHTML;
		this.valorBuscado = this.input.value;
		this.input.oInfo = oOpcion.oInfo;
		this.opcionElegida = null;
		this.salir(darFocus);
		if(this.cuandoSelecciono) this.cuandoSelecciono(oOpcion.oInfo);
	}
	this.deseleccionar = 	function(){
		this.input.value = '';
		this.input.oInfo = null;
		this.valorBuscado = '=¿_|+¡-';
		this.opcionElegida = null;
		this.mostrarLista('none');
		this.req.cancelar();
		this.esperar = false;
		//if(objConf && objConf.archivo) this.archivoReq = objConf.archivo;
	}
//
	/*this.iniciarCarga = function(){
		this.seleccionarOpcion(this.__dato,this.__campo);
		this.cuandoAcerto = this.__func;
		this.archivoReq = this.__file;
		delete(this.__func);
		delete(this.__dato);
		delete(this.__campo);
		delete(this.__file);
	}*/
	this.iniciar = function(dato, campo){
		var a = '', v = '';
		/*this.deseleccionar();
		this.__func = this.cuandoAcerto;
		this.__dato = dato;
		this.__campo = campo;
		this.__file = this.archivoReq;*/
		
		if(this.archivoReq.search(/\?/)!=-1) a = this.archivoReq+'&'+campo+'='+dato;
		else a = this.archivoReq+'?'+campo+'='+dato;
		
		v = campo+'|=|'+dato+'|&|';
		
		/*this.cuandoAcerto = this.iniciarCarga;
		this.enviar(true);*/
		this.enviarPorAtras(v, a);
	}
//
	this.limpiar = 			function(){
		//
		this.input.oInfo = null;
		this.opcionElegida = null;
		//eliminamos todas las opciones cargadas
		var i = null;
		var op = null;
		while(this.opciones.length > 0){
			op = this.opciones[this.opciones.length-1];
			op.objeto.parentNode.removeChild(op.objeto);
			this.opciones.pop();
			
			EliminarClosures(op.objeto);
			EliminarClosures(op);
			
			op = null;
		}
		//por las dudas
		while(this.lista.hasChildNodes()){
			EliminarClosures(this.lista.firstChild);
			
			this.lista.removeChild(this.lista.firstChild);
		}
		i = null;
	}
	this.controlObligatorio=function(e){
		if(!!e && Nav.esMz) event = e;
		if((this.obligatorio==true || this.input.value!='') && this.opciones.length!=1){ 
			//try{this.input.focus();}catch(e){;};
			if(this.lista.style.display!='none') this.mostrarLista('none');
			if(!!event){
				if(Nav.esMz){
					event.preventDefault();
					event.stopPropagation();
				}
				else{
					event.cancelBubble = true;
					event.returnValue = false;
				}
			}
		}
	}
	
	this.inputBlur =		function(e){
		if(!!e && Nav.esMz) event = e;
		
		if(this.input.value == this.input.__msjVacio){
			if(this.cuandoFallo) this.cuandoFallo();
			return false;
		}
		
		if((this.obligatorio==true || this.input.value!='') && (this.input.oInfo==null || //
		this.valorBuscado.substr(0,this.valorBuscado.length)==this.input.value.substr(0,this.input.value.length))){
			if(Nav.esMz){
				event.preventDefault();
				event.stopPropagation();
			}
			else{
				event.returnValue = false;
				event.cancelBubble = true;
			}
			this.enviar();
		}
		else{
			if(this.input.value==''){
				this.deseleccionar();
				this.exito = false;
			}
			this.salir(false);
			this.input.oInfo = null;
			if(this.input.value=='' && this.cuandoFallo) this.cuandoFallo();
		}
	}
	
	this.detectarTecla = 	function(e){
		if(!!e && Nav.esMz) event = e;
		//si es flecha arriba y tuvimos exito en la busqueda
		if(event.keyCode==38 && this.exito) this.moverArriba();
		//si es flecha abajo y tuvimos exito en la busqueda
		else if(event.keyCode==40 && this.exito) this.moverAbajo();
		//si es enter
		else if(event.keyCode==13 && this.exito && this.opcionElegida!=null){
			FireEvent(this.opcionElegida.objeto, 'click');
			this.salir();
		}
		else if(event.keyCode==37 && this.exito){
			try{this.input.focus();}catch(e){;}
			this.opcionElegida = null;
		}
		if(Nav.esMz){
			event.preventDefault();
			event.stopPropagation();
		}
		else{
			event.returnValue = false;
			event.cancelBubble = true;
		}
	}
	this.moverAbajo = 		function(){
		var oOpcion = this.opcionElegida;
		if(oOpcion==null && this.lista.style.display != 'none'){
			//le quitamos el evento temporalmente
			RemEvent(this.input, 'blur', fa_1);
			//
			oOpcion = this.opciones[0];
		}
		else if(oOpcion!=null && (this.opcionElegida.pos+1) < this.opciones.length)
			oOpcion = this.opciones[this.opcionElegida.pos+1];
		//
		if(oOpcion!=null && this.lista.style.display != 'none'){
			try{oOpcion.objeto.focus();}catch(e){;}
		}
		//
		this.opcionElegida = oOpcion;
	}
	this.moverArriba = 		function(){
		var oOpcion = this.opcionElegida;
		if(oOpcion==null && this.lista.style.display!='none'){
			//le quitamos el evento temporalmente
			RemEvent(this.input, 'blur', fa_1);
			oOpcion = this.opciones[0];
		}
		else if(this.opcionElegida.pos-1 >= 0) oOpcion = this.opciones[this.opcionElegida.pos-1];
		else if(oOpcion!=null){
			//volvemos al input
			try{this.input.focus();}catch(e){;}
			oOpcion = null;
		}
		if(oOpcion!=null && this.lista.style.display!='none'){
			try{oOpcion.objeto.focus();}catch(e){;}
		}
		this.opcionElegida = oOpcion;
	}
	this.onRequestLoad = 	function(){
		//
		this.analizarRespuesta(this.req.respuestaXML);
		this.esperar = false;
	}
	this.enviar = 			function(noDesplegar){
		//si no esperamos
		if(noDesplegar==true) this.noDesplegar = noDesplegar;
		if(!this.esperar && this.input.value!=this.valorBuscado){
			this.esperar = true;
			this.valorBuscado = this.input.value;
			this.req.pedir(this.archivoReq, this.postVarName+this.input.value);
		}
		
		/*else if(this.input.value==this.valorBuscado){
			this.mostrarLista('block');
			this.controlarAlto();
			this.controlObligatorio();
		}*/
	}
	this.enviarPorAtras = function(v, a){
		this.mostrarLista('none');
		this.noDesplegar = true;
		if(this.esperar) this.req.cancelar();
		this.esperar = true;
		if(!a) a = this.archivoReq;
		this.req.pedir(a, v);
	}
	this.analizarRespuesta= function(oXML){
		//
		if(this.nodoPadre){
			var nodoPadre = oXML.ownerDocument.getElementsByTagName(this.nodoPadre);
			oXML = nodoPadre[0];
		}
		//
		if(oXML){
			//borramos
			this.limpiar();
			//creamos las nuevas opciones
			for(var i = 0; i < oXML.childNodes.length; i++){
				//vemos los atributos
				var oInfo = new Object;
				for(var x = 0; x < oXML.childNodes[i].attributes.length; x++)
					oInfo[oXML.childNodes[i].attributes[x].nodeName] = oXML.childNodes[i].attributes[x].nodeValue;
				//
				this.crearOpcion((oXML.childNodes[i].text)? oXML.childNodes[i].text: oXML.childNodes[i].textContent, oInfo);
			}
			//
			if(i>0){
				this.exito = true;
				if(this.opciones.length==1){
					this.seleccionar(this.opciones[0], false);
					this.valorBuscado = this.opciones[0].objeto.innerHTML;
				}
			}
			else{
				this.exito = false;
				this.crearMsgError();
			}
			//
			this.controlObligatorio();
			//
			if(i!=1 && !this.noDesplegar){
				this.mostrarLista('inline');
				this.controlarAlto();
			}
			else this.noDesplegar = false;
			//
			if(this.exito && this.cuandoAcerto){
				if(this.obligatorio && i!=1){
					this.input.oInfo = null;
					if(this.cuandoFallo) this.cuandoFallo();
				}
				else this.cuandoAcerto();
			}
			else if(!this.exito && this.cuandoFallo){
				this.input.oInfo = null;
				this.cuandoFallo();
			}
		}
		else{
			return ERROR.reportar("Error en la clase Filtrador al recibir los datos.\nHTML: "+this.req.respuestaHTML+"\nARCHIVO: "+this.req.archivo);
		}
	}
	
	//
	var fa_1 = fa_2 = fa_3 = fa_4 = fa_5 = fa_6 = fa_7 = null;
	
	this.ponerEventos = function(){
		AddEvent(this.input, "blur", fa_1 = this.inputBlur.closure(this));
		AddEvent(this.input, "focus", fa_2 = function(){
			RemEvent(this.input, "blur", fa_1);
			AddEvent(this.input, "blur", fa_1);
		}.closure(this));
		AddEvent(this.input, "keydown", fa_3 = function(e){ this.filtrar(e) }.closure(this));
		AddEvent(this.input, "dblclick", fa_4 = function(e){ this.filtrar(e, true) }.closure(this));
		
		AddEvent(this.lista, "focus", fa_5 = this.cancelarSalida.closure(this));
		AddEvent(this.lista, "keydown", fa_6 = this.detectarTecla.closure(this));
		AddEvent(this.lista, "blur", fa_7 = this.salir.closure(this));
	}
	this.ponerEventos();
	this.quitarEventos = function(){
		RemEvent(this.input, "blur", fa_1);
		RemEvent(this.input, "focus", fa_2);
		RemEvent(this.input, "keydown", fa_3);
		RemEvent(this.input, "dblclick", fa_4);
		
		RemEvent(this.lista, "focus", fa_5);
		RemEvent(this.lista, "keydown", fa_6);
		RemEvent(this.lista, "blur", fa_7);
	}
}
	
	var DIR_RAIZ = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/';
	var DIR_PROGRAMAS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/programas_files/';
	var DIR_HOTELES = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/hoteles_files/';
	var DIR_AUTOS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/autos_files/';
	var DIR_CRUCEROS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/cruceros_files/';
	var DIR_AEREOS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/aereos_files/';
	var DIR_NORMAS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/normas_files/';
	var DIR_EVENTOS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/eventos_files/';
	var DIR_CONSEJOS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/consejos_files/';
	var DIR_NOTICIAS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/notas_files/';
	var DIR_QUIENES_SOMOS = 'C:/inetpub/vhosts/juantoselli.com/httpdocs/quienes/';
	var SEP_IGUAL = '|=|';
	var SEP_AND = '|&|';
