
	// liveChat.js
	function uServers_Livechat() {
		this._numOps = "blibla";	// ALgo para definir y que no sea cero
		this.heartBeat();
	}
	
	uServers_Livechat.prototype.updateOps = function(numops) {
		if(numops != this._numOps) {
			this._numOps = numops;
			if(this.evtHandler_onOperatorChange) {
				this.evtHandler_onOperatorChange.call();
			}
		}
		
		return true;
	}
	
	uServers_Livechat.prototype.onOperatorChange = function(handler) {
		this.evtHandler_onOperatorChange = handler;
	}
	
	uServers_Livechat.prototype.heartBeat = function() {
		// Loop principal del chat
		if(this.loopTimer) { window.clearTimeout(this.loopTimer); }
		this.loopTimer = window.setTimeout(function() { livechat.heartBeat(); }, 10000);
		this.opRefresh();
	}
	
	uServers_Livechat.prototype.opRefresh = function() {
		// Manda una llamada asincrona para cambiar los monos que estan online
		uagent.aGetEval("/__web-ajax/ajax.livechat.php?a=numOps");
	}
	
	uServers_Livechat.prototype.numOps = function() {
		// Regresa el numero de ops que estan logueados en el chat
		return this._numOps;
	}
	
	uServers_Livechat.prototype.openChat = function() {
		// Abre una ventana del chot:
		this.chatwin = window.open('/__web-ajax/ajax.livechat.php?a=guia', 'livechat_client', 'width=450,height=400,scrolling=no,alwaysRaised=yes');
	}


