var Game, GameID, PlayerType, PlayerName, ConsumeMode, GameArea, GameAreaID, GameServer, GameServerID, IsLineArity, DepositQty, ParValue, BankID, GameItemDom = null,
ItemListDom = null,
DepositItemsDom = null,
PayMethodsList = new Array(),
UUIDList = new Array(),
GameAccountList = new Array(),
NotSupportArea,
indexArray = new Array(),
gameArray = new Array(),
gameNameArray = new Array(),
lastGameID = -1,
inputerConfig; (function($) {
	$.Inputer = {
		InitConfig: function(_) {
			$.extend($.InitConfig, _ || {});
			if ($.InitConfig.inputid == "" || $("#" + $.InitConfig.inputid) == null) {
				alert("config is Invalid");
				return;
			}
			$.fn.BindControl();
			if ($.InitConfig.paymethod != "60") {
				PageRender.PageInit();
			}
			$.SetBodyEvent();
		}
	};
	$.InitConfig = {
		paymethod: "",
		paytype: "",
		inputid: "inputGame",
		imageid: "imgGame",
		selectdiv: "SelectDiv",
		clickdiv: "ClickDiv",
		CallBackEvent: function() {},
		configpath: "Config",
		clickcss: "",
		selectcss: "",
		isBindArea: true,
		DisableItem: "",
		PlayerTypeEvent: null,
		ConsumeEvent: null
	};
	$.fn.BindControl = function() {
		$("#" + $.InitConfig.imageid).bind("click", $.fn.Click);
		$("#" + $.InitConfig.inputid).bind("keyup", $.fn.Select);
		$("#" + $.InitConfig.inputid).bind("focus", $.fn.Focus);
		$("#" + $.InitConfig.inputid).bind("blur", $.fn.Blur);
	};
	$.fn.Click = function() {
		if ($.InitConfig.paymethod == "60") {
			PageRender.PageInit();
		}
		var A = $.InitConfig.clickdiv,
		_ = $("#" + $.InitConfig.inputid).get(0);
		if ($("#" + A).length == 0) {
			$("<div id='" + A + "'></div>").appendTo($("body")).css({
				left: $.getLeft(_) + "px",
				top: $.getTop(_) + 21 + "px",
				display: ""
			});
			$("#" + A).css($.InitConfig.clickcss);
		} else {
			$("#" + A).show();
		}
		$("#" + $.InitConfig.selectdiv).hide();
		$.fn.GetClickData();
	};
	$.fn.Select = function(_) {
		if ($.InitConfig.paymethod == "60") {
			PageRender.PageInit();
		}
		$("#" + $.InitConfig.inputid).val($.trim($("#" + $.InitConfig.inputid).val()));
		if ($("#" + $.InitConfig.inputid).val() == "") {
			return;
		}
		var A = $.InitConfig.selectdiv;
		if ($("#" + A).length == 0) {
			$("<div id='" + A + "' onkeydown='return PageRender.selectKeyDown(event)'></div>").appendTo($("body")).css({
				left: $.getLeft(this) + "px",
				top: $.getTop(this) + 20 + "px",
				display: ""
			});
			$("#" + A).css($.InitConfig.selectcss);
		} else {
			$("#" + A).show();
		}
		$("#" + $.InitConfig.clickdiv).hide();
		$.fn.GetSelectData(_);
	};
	$.fn.Focus = function() {
		$("#" + $.InitConfig.inputid).css({
			color: "#000000"
		});
		$("#" + $.InitConfig.inputid).select();
	};
	$.fn.Blur = function() {
		if ($(this).val() == "") {
			$(this).val("\u6c49\u5b57| \u62fc\u97f3 |\u5b57\u6bcd");
		} else {
			if ($(this).val() == "\u6c49\u5b57| \u62fc\u97f3 |\u5b57\u6bcd") {
				$(this).css({
					color: "#a7a7a7"
				});
			}
		}
	};
	$.fn.GetClickData = function() {
		var _ = $.InitConfig.clickdiv;
		$("#" + _).show();
		$(_).remove("iframe");
		if ($(_).html() == "") {
			return;
		} else {
			$("#" + _).html(PageRender.createList());
		}
		$("#" + _).bgiframe();
	};
	$.fn.GetSelectData = function(A) {
		var _ = $.InitConfig.selectdiv;
		$("#" + _).show();
		$("#" + _).html(PageRender.getFilterList(A));
		$("#" + _).bgiframe();
	};
	$.FloatDiv = function(_) {
		if (_ == 1) {
			$("select").show();
		} else {
			$("select").hide();
		}
	};
	$.SetBodyEvent = function() {
		$("body").bind("click",
		function(_) {
			var B = _ || window.event,
			A = B.srcElement || B.target;
			if (A.type != "name" && A.tagName != "A" && A.id == "") {
				$("#" + $.InitConfig.clickdiv + ",#" + $.InitConfig.selectdiv).hide();
			}
			PageRender.AutoIframe();
		});
	};
	$.CallBack = function() {
		this.BackGame;
		this.BackGameID;
		this.Test = GameID;
		this.DoAction = function() {
			alert("action");
		};
	};
	$.Reset = function() {
		Game = GameID = PlayerType = PlayerName = ConsumeMode = GameArea = GameAreaID = GameServer = GameServerID = ParValue = BankID = null;
	};
	$.IsNull = function($) {
		if (!$ || $ == null || typeof $ == "undefined") {
			return true;
		}
		return false;
	};
})((jQuery));
var MyXml = {
	GetNameById: function(_) {
		if (DepositItemsDom == null) {
			DepositItemsDom = this.GetDepositItem();
		}
		return $.GetXmlAttr(DepositItemsDom, "//items/item[@id='" + $.trim(_) + "']", "name");
	},
	GetIdByName: function(_) {
		if (DepositItemsDom == null) {
			DepositItemsDom = this.GetDepositItem();
		}
		return $.GetXmlAttr(DepositItemsDom, "//items/item[@name='" + $.trim(_) + "']", "id");
	},
	IsLineArity: function(_) {
		if (GameItemDom == null) {
			GameItemDom = this.GetGameItem();
		}
		var A = $.GetXmlAttr(GameItemDom, "//deposititem/consumes/consume[@id='" + _ + "']", "linearity");
		if (A == "0") {
			return false;
		}
		return true;
	},
	GetDepositItem: function() {
		//return $.LoadXml($.InitConfig.configpath + "/DepositItems.xml");
		var objXML;
		$.ajax({url:"../../Service/AjaxService.aspx",
		                async:false,
		                cache:false,
		                data:"gameid=DepositItems",
		                dataType:"xml",
		                success:function(data)
		                {
		                    objXML = data;
		                }
		             });
	    return objXML;
	},
	GetGameItem: function() {
		if (GameID == null || typeof GameID == "undefined") {
			return;
		}
		document.getElementById("GameID").value = GameID;
//		return $.LoadXml($.InitConfig.configpath + "/" + GameID + ".xml");
        var objXML;
		$.ajax({url:"../../Service/AjaxService.aspx",
		                async:false,
		                cache:false,
		                data:"gameid=" + GameID,
		                dataType:"xml",
		                success:function(data)
		                {
		                    objXML = data;
		                }
		             });
	    return objXML;
	},
	GetItemList: function() {
		//return $.LoadXml($.InitConfig.configpath + "/ItemsList.xml");
		var objXML;
		$.ajax({url:"../../Service/AjaxService.aspx",
		                async:false,
		                cache:false,
		                data:"gameid=ItemsList",
		                dataType:"xml",
		                success:function(data)
		                {
		                    objXML = data;
		                }
		             });
	    return objXML;
	},
	GetConsumeItem: function() {
		if (GameItemDom == null) {
			GameItemDom = this.GetGameItem();
		}
		return GameItemDom.selectNodes("//deposititem/consumes/consume");
	},
	GetArea: function() {
		if (GameItemDom == null || typeof GameItemDom == "undefined") {
			GameItemDom = this.GetGameItem();
		}
		return GameItemDom.selectNodes("//deposititem/areas/area");
	},
	GetAreaByConsume: function() {
		var _ = $("input[@name=DivConsume][@checked]").val();
		if (!ConsumeMode) {
			ConsumeMode = _;
		}
		var A = $.GetNodeText(GameItemDom, "//deposititem/consumes/consume[@id='" + ConsumeMode + "']/area");
		if (A) {
			return A.split(",");
		}
		return null;
	},
	GetServer: function($) {
		if (GameItemDom == null) {
			GameItemDom = this.GetGameItem();
		}
		return GameItemDom.selectNodes("//deposititem/areas/area[@id='" + $ + "']/groups/group");
	},
	GetPlayerType: function() {
		if (DepositItemsDom == null) {
			DepositItemsDom = this.GetDepositItem();
		}
		return DepositItemsDom.selectNodes("//items/item");
	},
	GetPayMethods: function() {
		if (DepositItemsDom == null) {
			DepositItemsDom = this.GetDepositItem();
		}
		return $.GetNodeText(DepositItemsDom, "//paymethods/paymethod[@id='" + $.InitConfig.paymethod + "']");
	},
	GetNotSupportArea: function() {
		if (GameItemDom == null) {
			GameItemDom = this.GetGameItem();
		}
		return $.GetNodeText(GameItemDom, "//deposititem/paymethods/paymethod[@id='" + $.InitConfig.paymethod + "']");
	},
	IsUnifiedArea: function(_) {
		if (DepositItemsDom == null) {
			DepositItemsDom = this.GetDepositItem();
		}
		if (_ == null || typeof _ == "undefined") {
			return false;
		}
		var A = $.GetXmlAttr(DepositItemsDom, "//items/item[@id='" + _ + "']", "unifiedarea");
		if (A == "0") {
			return false;
		}
		return true;
	},
	IsShowServer: function(A) {
		if (DepositItemsDom == null) {
			DepositItemsDom = this.GetDepositItem();
		}
		if (A == null || typeof A == "undefined") {
			return false;
		}
		var _ = $.GetXmlAttr(DepositItemsDom, "//items/item[@id='" + A + "']", "showserver");
		if (_ == "0") {
			return false;
		}
		return true;
	},
	IsValidConsume: function(A) {
		if (GameID == null || typeof GameID == "undefined") {
			return false;
		}
		var $ = this.GetConsumeItem();
		for (var _ = 0; _ < $.length; _++) {
			if ($[_].nodeType == "1" && $[_].getAttribute("id") == A) {
				return true;
			}
		}
		return false;
	},
	LineArityValue: function(B, A) {
		if (GameItemDom == null) {
			GameItemDom = this.GetGameItem();
		}
		if (A == "min") {
			A = "minparvalue";
		} else {
			A = "maxparvalue";
		}
		var _ = $.GetXmlAttr(GameItemDom, "//deposititem/consumes/consume[@id='" + B + "']", A);
		return _;
	}
},
PageRender = {
	index: new Array,
	index2: new Array,
	listcontent: new Array,
	block: new Array,
	listid: 0,
	PageInit: function() {
		if (DepositItemsDom == null) {
			DepositItemsDom = MyXml.GetDepositItem();
		}
		if (indexArray.length == 0) {
			var _ = DepositItemsDom.getElementsByTagName("item");
			for (var $ = 0; $ < _.length; $++) {
				indexArray[$] = _[$].getAttribute("spell");
				gameArray[$] = _[$].getAttribute("id");
				gameNameArray[$] = _[$].getAttribute("name");
			}
		}
		this.GetGlobalInfo();
	},
	setValue: function(_) {
		if (_ == "" || _ == null) {
			document.getElementById("inputGame").value = "---请选择游戏---";
			return;
		}
		if (isNaN(parseInt(_))) {
			GameID = MyXml.GetIdByName(_);
			Game = _;
		} else {
			GameID = _;
			var A = MyXml.GetNameById(_);
			Game = A;
		}
		this.GetGlobalInfo();
		$("#" + $.InitConfig.inputid).val(Game);
		$("#" + $.InitConfig.inputid).css({
			color: "#000"
		});
		$("#" + $.InitConfig.clickdiv).hide();
		$("#divPlayerType,#DivArea,#DivGroup, #DivConsume").empty();
		$("#trPlayerType, #trArea, #trGroup,#trConsume").hide();
		this.CreateDepositItem();
		lastGameID = GameID;
		if ($.InitConfig.CallBackEvent && typeof $.InitConfig.CallBackEvent == "function") {
			try {
				$.InitConfig.CallBackEvent(GameID);
			} catch(B) {}
		}
		$("#" + $.InitConfig.clickdiv + ",#" + $.InitConfig.selectdiv).hide();
		if (typeof SetCookie == "function") {
			SetCookie("GameID", GameID);
		}
	},
	CreateDepositItem: function() {
		if (GameID == null || typeof GameID == "undefined") {
			return;
		}
		this.CreatePlayerType();
		this.CreateConsume();
		if ($.InitConfig.isBindArea) {
			this.CreateArea();
		}
		this.ExtraMethod();
	},
	CreatePlayerType: function() {
		var _ = new StringBuilder();
		if (UUIDList != null && ("," + UUIDList.join(",") + ",").indexOf("," + GameID + ",") > -1) {
			_.append("<input id='divPlayerType_1' type='radio' name='divPlayerType' value='1'checked='checked' />");
			_.append("<label for='divPlayerType_1'>\u76db\u5927\u901a\u884c\u8bc1</label>");
		}
		if (GameAccountList != null && ("," + GameAccountList.join(",") + ",").indexOf("," + GameID + ",") > -1) {
			_.append("<input id='divPlayerType_0' type='radio' name='divPlayerType' value='0' />");
			_.append("<label for='divPlayerType_0' style='color:#666666'>\u6e38\u620f\u5e10\u53f7</label>");
		}
		$("#divPlayerType").html(_.toString());
		if ($("input[@name=divPlayerType]").length > 1) {
			$("#trPlayerType").show();
		}
		$("#divPlayerType_0,#divPlayerType_1").attr("checked", true);
		if ($("input[@name=divPlayerType]").length == 1 || !PlayerType) {
			PlayerType = $("input[@name=divPlayerType][@checked]").val();
		}
		if (typeof $.InitConfig.PlayerTypeEvent == "function") {
			$("#divPlayerType_0, #divPlayerType_1").bind("click",
			function() {
				$.InitConfig.PlayerTypeEvent();
			});
		} else {
			$("#divPlayerType_0, #divPlayerType_1").bind("click",
			function() {
				PageRender.Refresh();
			});
		}
		return true;
	},
	CreateConsume: function() {
		if ($.InitConfig.ConsumeEvent && typeof $.InitConfig.ConsumeEvent == "function") {
			$.InitConfig.ConsumeEvent();
			return;
		}
		var A = MyXml.GetConsumeItem(),
		B = new StringBuilder();
		for (var _ = 0; _ < A.length; _++) {
			B.append("<input id='DivConsume_" + _ + "' type=radio name='DivConsume' onclick='PageRender.Refresh();' value='" + A[_].getAttribute("id") + "' /><label id='lblDivConsume_" + _ + "' for='DivConsume_" + _ + "'>" + A[_].getAttribute("name") + "</label>");
		}
		$("#DivConsume").html(B.toString());
		if ($("input[@name=DivConsume]").length > 0) {
			$("input[@name=DivConsume]").get(0).checked = true;
		}
		if ($("input[@name=DivConsume]").length > 1) {
			$("#trConsume").show();
		}
		if (!MyXml.IsValidConsume(ConsumeMode) || !ConsumeMode) {
			ConsumeMode = $("input[@name=DivConsume][@checked]").val();
		}
		IsLineArity = MyXml.IsLineArity(ConsumeMode);
	},
	CreateArea: function() {
		if ($("#selectArea").length == 0) {
			$("#DivArea").html("<select id='selectArea' reg='\\d+' onchange='selectGateWay(this.options[selectedIndex].text);PageRender.CreateGroup();' style='width: 138px;' errortip=''><option value=''>\u8bf7\u9009\u62e9</option></select>");
		}
		if (!this.CheckDepositArea()) {
			return;
		}
		var A = MyXml.GetArea(),
		C,
		B = 0,
		D = new StringBuilder();
		D.append("<option value='a'>\u8bf7\u9009\u62e9</option>");
		for (var _ = 0; _ < A.length; _++) {
			C = $.trim(A[_].getAttribute("id"));
			if (this.IsAddArea(C)) {
				D.append("<option value=\"" + C + "\">" + A[_].getAttribute("name") + "</option>");
				B++;
			}
		}
		if (B >= 1) {
			$("#selectArea").html(D.toString());
			if (B == 1 && $("#selectArea").get(0)) {
				$("#selectArea").get(0).selectedIndex = 0;
			}
			$("#trArea").show();
		} else {
			$("#trArea").hide();
			return false;
		}
		this.CreateGroup();
		return true;
	},
	CreateGroup: function() {
		if (GameID == null || GameID == "") {
			return;
		}
		if ($("#selectGroup").length == 0) {
			$("#DivGroup").html("<select id='selectGroup' onchange='selectGateWayServer(this.options[selectedIndex].text);' reg='\\d+' style='width: 138px;'><option value=''>\u8bf7\u9009\u62e9</option></select>");
		}
		if (!this.CheckDepositServer()) {
			return;
		} else {
			$("#trGroup").show();
		}
		if (GameItemDom == null) {
			GameItemDom = MyXml.GetGameItem();
		}
		var A = MyXml.GetServer($("#selectArea").val()),
		B = new StringBuilder();
		B.append("<option value='a'>\u8bf7\u9009\u62e9</option>");
		for (var _ = 0; _ < A.length; _++) {
			B.append("<option value=\"" + A[_].getAttribute("id") + "\">" + A[_].getAttribute("name") + "</option>");
		}
		$("#selectGroup").html(B.toString());
		if (A.length > 0) {
			$("#trGroup").show();
			if (A.length == 1 && $("#selectGroup").get(0)) {
				$("#selectGroup").get(0).selectedIndex = 0;
			}
		} else {
			$("#trGroup").hide();
			return false;
		}
		return true;
	},
	Refresh: function() {
		$("#trArea, #trGroup").hide();
		PlayerType = $("input[@name=divPlayerType][@checked]").val();
		ConsumeMode = $("input[@name=DivConsume][@checked]").val();
		ParValue = null;
		this.CreateArea();
		IsLineArity = MyXml.IsLineArity(ConsumeMode);
		if ($.InitConfig.paymethod == 60) {
			if (typeof BankDeposit != "undefined") {
				BankDeposit.SetPrice();
			}
			if (typeof SubmitOrder != "undefined") {
				SubmitOrder.SetPrice();
			}
		}
		if ($.InitConfig.paytype = "ptbpayment") {
			if (typeof PTBPayMent != "undefined") {
				PTBPayMent.SetPrice();
			}
		}
	},
	AutoIframe: function() {
		if (parent == self) {
			return;
		}
		if (typeof parent.setAutoHeight == "function") {
			parent.setAutoHeight();
		}
		return;
		var $ = parent.document.getElementById("MainFrmTd");
		if ($ != null) {
			$.style.height = document.body.scrollHeight + 20;
		}
	},
	GetGlobalInfo: function() {
		if (DepositItemsDom == null) {
			DepositItemsDom = MyXml.GetDepositItem();
		}
		if (lastGameID != GameID) {
			UUIDList.length = 0;
			GameAccountList.length = 0;
			GameItemDom = MyXml.GetGameItem();
			if (lastGameID != -1) {
				ConsumeMode = null;
				PlayerType = null;
			}
		}
		if (UUIDList == null || UUIDList.length == 0 || GameAccountList == null || GameAccountList.length == 0) {
			var C = MyXml.GetPlayerType();
			for (var A = 0; A < C.length; A++) {
				if (C[A].getAttribute("uuid") == "1") {
					UUIDList.push(C[A].getAttribute("id"));
				}
				if (C[A].getAttribute("playid") == "1") {
					GameAccountList.push(C[A].getAttribute("id"));
				}
			}
		}
		if ($.IsNull(PayMethodsList) || PayMethodsList.length == 0) {
			var B = MyXml.GetPayMethods();
			if (B) {
				var _ = B.split(",");
				for (A = 0; A < _.length; A++) {
					PayMethodsList.push(_[A]);
				}
			}
		}
		NotSupportArea = MyXml.GetNotSupportArea();
	},
	ResetSelect: function(_) {
		$("#" + _).empty();
		$("#" + _).html("<option value=''>\u8bf7\u9009\u62e9</option>");
	},
	DepositItemFilter: function(_) {
		var A = false;
		if ($.InitConfig.paymethod == 0 || ("," + PayMethodsList.join(",") + ",").indexOf("," + _ + ",") > -1) {
			A = true;
		}
		if (("," + $.InitConfig.DisableItem + ",").indexOf("," + _ + ",") > -1) {
			A = false;
		}
		return A;
	},
	CheckDepositArea: function() {
		if (MyXml.IsUnifiedArea(GameID) && PlayerType == "1") {
			if ($.InitConfig.paytype == "bindgame") {
				return false;
			}
			if (ConsumeMode == "2" || ConsumeMode == "3" || ConsumeMode == "13") {
				if ($("#selectArea option").length > 1) {
					this.ResetSelect("selectArea");
				}
				$("#trArea").hide();
				return false;
			}
		}
		return true;
	},
	CheckDepositServer: function() {
		if (!MyXml.IsShowServer(GameID)) {
			if ($("#selectGroup option").length > 1) {
				this.ResetSelect("selectGroup");
			}
			$("#trGroup").hide();
			return false;
		}
		return true;
	},
	IsAddArea: function(A) {
		if (NotSupportArea == null || ("," + NotSupportArea + ",").indexOf("," + A + ",") == -1) {
			if ($.InitConfig.paytype == "bindgame") {
				return true;
			}
			var _ = MyXml.GetAreaByConsume();
			if (_ == null || (_.length == 1 && _[0] == "-1")) {
				return true;
			}
			if (_.length == 1 && _[0] == "0") {
				return false;
			}
			if (("," + _.join(",") + ",").indexOf("," + A + ",") > -1) {
				return true;
			}
		}
		return false;
	},
	ExtraMethod: function() {
		this.AutoIframe();
		return;
	},
	createList: function() {
		if (ItemListDom == null) {
			ItemListDom = MyXml.GetItemList();
		}
		var B = ItemListDom.documentElement.getElementsByTagName("record"),
		D = new StringBuilder();
		D.append("<div id=\"setposition\"><div id=\"layout\"><div class=\"close\"></div><div id=\"index\">");
		var F = B.length,
		A, C = "<a href=\"javascript:void(0)\" class=\"{0}\" name=\"seleindex\" onclick=\"PageRender.setIndex(this)\">{1}</a>";
		for (var _ = 0; _ < F; _++) {
			var $ = B[_],
			E = $.getAttribute("type");
			if (_ == F - 1) {
				D.append(C.replace("{0}", "indextop").replace("{1}", E));
				break;
			}
			if (_ == 0) {
				D.append(C.replace("{0}", "indexselect").replace("{1}", E) + "|");
				A = $;
			} else {
				D.append(C.replace("{0}", "indextop").replace("{1}", E) + "|");
			}
		}
		D.append("</div>");
		D.append("<div id=\"records\">");
		D.append(this.buildRecord(A));
		D.append("<div></div></div>");
		return D.toString();
	},
	selectKeyDown: function(D) {
		var A, _, C, B = document.getElementById("listtb");
		if (window.event) {
			A = D.keyCode;
		} else {
			if (D.which) {
				A = D.which;
			}
		}
		if (A == 40 || A == 38) {
			$("#listtb tr").removeClass("stlineov");
			if (A == 40) {
				this.listid = this.listid + 1;
				if (this.listid == $("#listtb tr").length) {
					this.listid = 0;
				}
			} else {
				this.listid = this.listid - 1;
				if (this.listid == -1) {
					this.listid = $("#listtb tr").length - 1;
				}
			}
			$($("#listtb tr").get(this.listid)).addClass("stlineov");
		} else {
			if (A == 13 || A == 32) {
				$("#" + $.InitConfig.selectdiv).hide();
				this.setValue($.trim($($("#listtb tr").get(this.listid)).get(0).innerText));
			}
		}
		return false;
	},
	getFilterList: function(L) {
		var D, E = $("#" + $.InitConfig.inputid).val(),
		A,
		C = new Array(),
		F = new StringBuilder();
		F.append("<table width='135' border='0' cellpadding='0' cellspacing='1' id ='listtb'>");
		var K = new RegExp("^" + E.toLowerCase());
		for (var H = 0; H < indexArray.length; H++) {
			var _ = indexArray[H];
			if (!_) {
				continue;
			}
			var G = _.split(",");
			if (this.DepositItemFilter(gameArray[H])) {
				for (var I = 0; I < G.length; I++) {
					if (K.test(G[I].toLowerCase()) && ("," + C.join(",") + ",").indexOf("," + gameArray[H] + ",") == -1) {
						F.append("<tr>");
						F.append("<td class='selectItem' title='" + gameNameArray[H] + "' onmouseover=\"this.className='stlineov';this.listid = " + H + 1 + ";\" " + "onmouseout=\"this.className='stline'\" onclick=\"$.Reset();PageRender.setValue('" + gameNameArray[H] + "')\">" + gameNameArray[H] + "</td>");
						F.append("</tr>");
						C.push(gameArray[H]);
					}
				}
			}
		}
		F.append("</table>");
		$("#" + $.InitConfig.selectdiv).html(F.toString());
		var J = document.getElementById("listtb");
		if (window.event) {
			D = L.keyCode;
		} else {
			if (L.which) {
				D = L.which;
			}
		}
		if (D == 40 || D == 38) {
			document.getElementById($.InitConfig.selectdiv).focus();
			J.focus();
			if (D == 40) {
				$($("#listtb tr").get(0)).addClass("stlineov");
				this.listid = 0;
			} else {
				if (D == 38) {
					var B = $("#listtb tr").length;
					$($("#listtb tr").get(B - 1)).addClass("stlineov");
					this.listid = B - 1;
				}
			}
		}
	},
	setIndex: function(A) {
		A.blur();
		$("a[@name='seleindex']").removeClass("indexselect").addClass("indextop");
		A.className = "indexselect";
		var D = document.getElementsByName(A.name),
		C = document.getElementById("records"),
		B = A.firstChild.nodeValue,
		_ = ItemListDom.selectNodes("//records/record[@type='" + B + "']");
		if (_.length == 1) {
			C.innerHTML = this.buildRecord(_[0]);
		} else {
			C.innerHTML = "<p style=\"margin-top:60px; text-align:center; font-size:12px\">\u8be5\u5206\u7c7b\u6ca1\u4efb\u4f55\u9879\u76ee</p>";
		}
	},
	buildRecord: function(C) {
		var _ = C,
		L = _.childNodes,
		D = L.length,
		F = "<div id=" + _.getAttribute("type") + "><div id='index2'><ul>{0}</ul></div></div>",
		I = 0,
		A,
		E = new StringBuilder();
		if (D > 0) {
			for (var H = 0; H < D; H++) {
				if (!$.browser.msie && typeof L[H].getAttribute != "function") {
					continue;
				}
				I = 0;
				var G = "<li>";
				if (D > 1) {
					G += "<span style=\"display:block;float:left;height:20px; line-height:20px;\">" + L[H].getAttribute("type") + ":</span>";
				}
				var B = L[H].firstChild.nodeValue.split(",");
				for (var J = 0; J < B.length; J++) {
					B[J] = $.trim(B[J]);
					A = MyXml.GetNameById(B[J]);
					if (!A) {
						continue;
					}
					var K = "<a href=\"javascript:void(0)\" class=\"indexh\" name=\"context\" onclick=\"$.Reset();PageRender.setValue('" + B[J] + "')\">" + A + "</a>";
					if (this.DepositItemFilter(B[J])) {
						G += K;
						I++;
					}
				}
				if (I > 0) {
					E.append(G);
					E.append("<br class='clear'/></li>");
				}
			}
		}
		if (I > 0) {
			return F.replace("{0}", E.toString());
		}
		return F.replace("{0}", "<p style='margin-top:60px; text-align:center; font-size:12px'>\u8be5\u5206\u7c7b\u6ca1\u4efb\u4f55\u9879\u76ee</p>");
	}
};
