
function L3Communicator() {
	try {
		this.flashobject = (navigator.appName.indexOf("Microsoft") != -1) ?
					document.all["communicator"] : document.communicator;
	} catch (e) {
		L3COMMUNICATOR_USE_FLASH = 0;
	}
	this.setRequestPage = L3Communicator_setRequestPage;
	this.setRequestHost = L3Communicator_setRequestHost;
	this.setVariable = L3Communicator_setVariable;
	this.send = L3Communicator_send;
	this.load = L3Communicator_load;
	this.nvData = null;
}

	function L3Communicator_setRequestPage(sPage) {
		this.flashobject.SetVariable("VARREQUESTPAGE", sPage);
		this.flashobject.GotoFrame(4);
	}

	function L3Communicator_setRequestHost(sHost, sPort) {
		this.flashobject.SetVariable("VARREQUESTHOST", sHost);
		this.flashobject.SetVariable("VARREQUESTPORT", sPort);
		this.flashobject.GotoFrame(9);
		this.flashobject.GotoFrame(4);
		this.flashobject.GotoFrame(9);
	}

	function L3Communicator_setVariable(sName, sValue) {
		this.flashobject.SetVariable("VARFIELD", sName);
		this.flashobject.SetVariable("VARVALUE", sValue);
		this.flashobject.GotoFrame(13);
		this.flashobject.GotoFrame(14);
	}

	function L3Communicator_send() {
		this.flashobject.GotoFrame(9);
		this.flashobject.GotoFrame(19);
	}

	function L3Communicator_load(sData) {
		this.nvData = new NameValue(sData, "\r\n\r\n", "\r\n");
		this.flashobject.GotoFrame(9);
	}

	function communicator_DoFSCommand(sCommand, sData) {
		switch (sCommand) {
		case "initialize" :
			((navigator.appName.indexOf("Microsoft") != -1) ?
					document.all["communicator"] : document.communicator).GotoFrame(9);
			L3CommunicatorReady();
			break;
		case "connect" :
			L3CommunicatorConnected();
			break;
		case "data" :
			L3CommunicatorDataReceived(unescape(sData));
			break;
		}
	}

function NameValue(strNameValue,r,c) {
	if (strNameValue) {
		var arrNameValue = strNameValue.split(r);
		if (arrNameValue[0]) for (var i=0; i<arrNameValue.length; i++) {
			arrNameValue[i] = arrNameValue[i].split(c);
			if (arrNameValue[i].length < 2) arrNameValue[i][1] = "";
		}
	} else arrNameValue = new Array();

	this.NameValue = arrNameValue;
	this.r = r;
	this.c = c;
	this.Get = NameValue_Get;
}

	function NameValue_Get(Name) {
		var sreturn = ""
		for (var i=0; i<this.NameValue.length; i++) if (this.NameValue[i][0]==Name) sreturn = this.NameValue[i][1];
		return sreturn;
	}

