define("navigator", [], function() {
	function e() {
		if (qike.utils.cookie.get("userid")) {
			var e = qike.utils.cookie,
				t = e.get("userid"),
				n = e.get("kk"),
				r = e.get("nickname"),
				i = $(".user-area .user-name a:eq(0)"),
				s;
			r = n ? r ? decodeURI(r) : n : "", s = ['<img class="photo" width="16" height="16" data-align="bc-tc" data-uid="' + t + '" title="' + r + '" src="">', ' <span data-uid="' + t + '" class="qk_vip_name">', r, "</span>"], i.html(s.join("")), $("#login-in .qk_vip_mark").length != 0 && $("#login-in .qk_vip_mark").remove(), i.after('<span data-uid="' + t + '" class="qk_vip_mark"></span>'), $("#login-out").hide(), $("#login-in").show()
		} else $("#login-out").show(), $("#login-in").hide()
	}
	function t(e, t) {
		if (t == "play" && e.find(".J-my-if").length == 0) {
			e.append('<iframe class="J-my-if" frameborder="0" scrolling="no" style="position:absolute;z-index:-1;top:0;background:#fff;opacity:0;filter:alpha(opacity=0);"></iframe>');
			var n = e.innerWidth(),
				r = e.innerHeight();
			e.find(".J-my-if").css({
				width: n + "px",
				height: r + "px"
			})
		}
	}
	function n() {
		typeof Qk_Vip != "undefined" && typeof Qk_Vip.setVip == "function" && Qk_Vip.setVip({
			name: "#login-in .qk_vip_name",
			mark: "#login-in .qk_vip_mark"
		}, function() {
			$("#login-in .qk_vip_mark a").css({
				margin: "5px",
				padding: 0,
				height: "20px",
				"vertical-align": "top"
			})
		})
	}
	function r(e) {
		$(".skin-link").css("display", "none"), $(".skin-link" + e).css("display", "block")
	}
	function i() {
		var e = qike.utils.cookie.get("current_decorate"),
			t;
		if (e) {
			var n = e.split("|");
			t = n[0]
		} else t = window.dec_id;
		return t
	}
	return {
		init: function(s) {
			(new qike.ui.TabSet($(".mobile-game .ui-tabs ul li"), $(".mobile-game .box-bd div"), {
				lazyload: !0,
				currentClass: "current",
				eventType: "click"
			})).create();
			var o = this,
				u = qike.utils.cookie,
				a = qike.utils.subscribeModel,
				f;
			Qk_Vip && Qk_Vip.getRank && Qk_Vip.getRank(function(e) {
				f = e
			}), qike.template = qike.template || {}, qike.template.quitLogin = function() {
				u.get("gs") && u.set("gs", ""), qike.template.afterQuitLogin && qike.template.afterQuitLogin(), qike.utils.login.quit()
			}, a.subscribe("login-success", function(e) {
				o.setUserInfo(), n(), Qk_Vip && Qk_Vip.getRank && Qk_Vip.getRank(function(e) {
					f = e
				}), r(i())
			}), $("#login-btn").click(function(e) {
				qike.loginDialog.open(), e.stopPropagation()
			}), $("#login-quit").click(function(e) {
				qike.template.quitLogin(), o.setUserInfo(), $("#user-name-menu").hide(), a.fire("after-user-quit");
				if (f > 0) {
					var n = $("#login-out").outerHeight(!0),
						r = $("#login-out").outerWidth(!0) - $("#login-out .first").outerWidth(!0);
					$(".vip-login-tips").css({
						top: n + "px",
						right: r + "px"
					}), $(".vip-login-tips").show(), t($(".vip-login-tips"), s)
				}
				e.preventDefault()
			}), $("#login-in .user-nav li").click(function(e) {
				$("#login-in .user-name .menu-box").hide()
			}), qike.utils.subscribeModel.subscribe("dialog-mask-open", function(e) {
				$.browser.msie ? $("html").css("overflow", "hidden") : $("body").css("overflow", "hidden"), $("#hd_ui_dialog_mask").height($(window).height() + $(window).scrollTop()), $("#hd_ui_dialog_mask").width($(window).width() + $(window).scrollLeft());
				if (s == "play" && /\.html/.test(window._gamepath)) {
					var t = $(document.getElementById("gameobj").contentWindow.document.body);
					t.find("#player").css("visibility", "hidden")
				}
				r(i())
			}), qike.utils.subscribeModel.subscribe("dialog-close", function() {
				$.browser.msie ? $("html").css("overflow", "") : $("body").css("overflow", "");
				if (s == "play" && /\.html/.test(window._gamepath)) {
					var e = $(document.getElementById("gameobj").contentWindow.document.body);
					e.find("#player").css("visibility", "visible")
				}
				r(i())
			}), e(), n();
			var l;
			s != "play" && $(function() {
				var e = "http://www.7k7k.com/2014/guoqing/",
					t = "http://www.7k7k.com/2014/guoqing/",
					n = "http://touch.7k7k.com/?bg",
					i = "http://csbh.7k7k.com/?bg",
					s = ['<div class="skin-link skin-link006" data-id="006"><a href="' + n + '" target="_blank" class="skin-Rlink"></a><a href="' + n + '" target="_blank" class="skin-Llink"></a></div>', '<div class="skin-link skin-link007" data-id="007"><a href="' + i + '" target="_blank" class="skin-Rlink"></a><a href="' + i + '" target="_blank" class="skin-Llink"></a></div>'];
				l = $(s.join("")), $(".page").append(l), r(window.dec_id)
			})
		},
		setUserNav: function(e) {
			var n, r = $("#login-in .first"),
				i = $("#user-name-menu"),
				s, o, u = "hide",
				a = !1;
			r.hover(function(n) {
				t(i, e), $("#login-in .user-name").addClass("active"), i.css("width", r.innerWidth());
				var f = $("#login-in .nav-history"),
					l = $("#login-in .nav-collection"),
					c = $("#login-in .decorate"),
					h = f.outerWidth(!0) + l.outerWidth(!0) + c.outerWidth(!0);
				h -= 1, $.browser.msie && $.browser.version == "6.0" && (h -= 1), i.css("right", h + "px"), a = !0, u == "hide" && (u = "preshow", s = setTimeout(function() {
					i.show(), $("#user-name-menu .J-my-if").length != 0 && $("#user-name-menu .J-my-if").width($("#user-name-menu").innerWidth()), u = "show"
				}, 300)), u == "prehide" && (clearTimeout(o), o = null, u = "show")
			}, function(e) {
				a = !1, u == "preshow" && (clearTimeout(s), s = null, u = "hide", $("#login-in .user-name").removeClass("active")), u == "show" && (o = setTimeout(function() {
					i.hide(), $("#login-in .user-name").removeClass("active"), u = "hide"
				}, 300))
			}), i.hover(function(e) {
				clearTimeout(o), o = null
			}, function(e) {
				setTimeout(function() {
					a || (i.hide(), $("#login-in .user-name").removeClass("active"), u = "hide")
				}, 300)
			})
		},
		setUserInfo: function() {
			e(), qike.utils.subscribeModel.fire("set-user-card")
		},
		setMyPlayed: function(e) {
			function v(e) {
				var t, n = r.get("gs"),
					i = r.get("userid");
				s.getLocalGames(["prev_user_playedgames_small", "unlogin_playedgames_small", "prev_user_playedgames_community"], o, function(r) {
					value1 = r.prev_user_playedgames_small || [], value2 = r.unlogin_playedgames_small || [], value3 = r.prev_user_playedgames_community || [], !n && i ? s.getServerGames([1], i, function(n) {
						if (n.status == 1) {
							var r = n.data,
								i = s.mergeGames([value2, r]);
							s.addLocalGames("prev_user_playedgames_small", i, o), t = s.mergeGames([value1, value3, i]), typeof e == "function" && e(t)
						} else s.addLocalGames("prev_user_playedgames_small", value2, o), t = s.mergeGames([value1, value2, value3]), typeof e == "function" && e(t)
					}) : (t = s.mergeGames([value1, value2, value3]), typeof e == "function" && e(t))
				})
			}
			function m() {
				var e = u.attr("data-recommend"),
					t = e.split(","),
					n = 0,
					r = t.length;
				for (; n < r; n++) {
					var i = t[n].split("|"),
						s = {};
					s.gametype = "", s.gameid = i[0], s.gamename = i[1], s.gameurl = i[2], t[n] = s
				}
				return t
			}
			function g() {
				v(function(n) {
					var r = [],
						i, o, u, f = m();
					if (!n || n.length == 0) n = [];
					if (!f || f.length == 0) f = [];
					for (var l = 0, c = n.length; l < c; l++) {
						var d = n[l];
						for (j = 0, len2 = f.length; j < len2; j++) {
							var v = f[j];
							if (d.gameid == v.gameid) {
								f.splice(j, 1);
								break
							}
						}
					}
					n = s.sortGamesByPlayedTime(n), n.length == 0 ? a.find(".his-nothing-tip").show() : a.find(".his-nothing-tip").hide();
					if (n.length >= p) n.splice(p, n.length - p), f = [];
					else {
						var g = n.length,
							w = f.length;
						g + w > p && (f = f.slice(0, p - g))
					}
					var E = [].concat(y(n), y(f)),
						r = [],
						l = 0,
						S = E.length;
					for (; l < S; l++) l == 0 && r.push('<ul class="ui-img-list span7" lazyload>'), l != 0 && l % h == 0 && r.push('</ul><ul class="ui-img-list span7" style="display:none" lazyload>'), r.push(E[l]);
					r.push("</ul>"), a.find(".ui-img-list").remove(), a.find(".his-nothing-tip").after(r.join("")), b(), a.find(".ui-img-list li").unbind().hover(function(e) {
						$(this).find(".i-del").attr("data-gametype") && $(this).find(".i-del").show()
					}, function(e) {
						$(this).find(".i-del").hide()
					}), t(a, e), a.show(), a.find(".J-my-if").height(a.height() + "px")
				})
			}
			function y(e) {
				if (!e || e.length == 0) return [];
				var t = 0,
					n = e.length,
					r, i, s, o, u, a, f = [];
				for (t; t < n; t++) r = e[t], o = r.gameid, i = r.gamename, a = r.gametype, s = /\/swf\//.test(r.gameurl) ? "http://www.7k7k.com/flash/" + o + ".htm" : r.gameurl, u = "http://i" + qike.utils.random(1, 5) + ".7k7kimg.cn/gameico/" + parseInt(parseInt(o) / 1e4) + "/" + o + ".jpg", f[t] = '<li><a href="' + s + '" target="_blank" title="' + i + '"><img _src="' + u + '" alt="" class="pic" width="76" height="77"><span class="' + (a ? "ui-li-name" : "ui-li-name ui-li-name-rec") + '">' + i + '</span><i class="icon i-del" style="display:none" data-gameid="' + o + '" data-gametype="' + a + '"></i></a></li>';
				return f
			}
			function b() {
				d ? (d.titles = $("#cont-played .ui-slide-trigger2 li"), d.contents = $("#cont-played .ui-img-list")) : (d = new qike.ui.TabSet($("#cont-played .ui-slide-trigger2 li"), $("#cont-played .ui-img-list"), {
					lazyload: !0,
					currentClass: "current",
					eventType: "click"
				}), d.create(), $("#cont-played .func-area .ui-slide-btn-left").click(function() {
					d.index == 0 ? d.selectByIndex(d.contents.length - 1) : d.prev()
				}), $("#cont-played .func-area .ui-slide-btn-right").click(function() {
					d.index == d.contents.length - 1 ? d.selectByIndex(0) : d.next()
				})), d.selectByIndex(0)
			}
			$("#cont-played .func-area .fr a:eq(1)").unbind("click").click(function(e) {
				qike.loginDialog.open(), e.preventDefault()
			});
			var n = this,
				r = qike.utils.cookie,
				i = r.get("userid"),
				s = qike.playedgame.PlayedGame,
				o = "http://www.7k7k.com",
				u, a = $("#cont-played"),
				f, l, c = [1],
				h = 9,
				p = 27,
				d;
			t(a, e), $("#cont-played").click(function(e) {
				var t = $(e.target);
				if (t.hasClass("i-del")) {
					var n = t.attr("data-gameid"),
						i = t.attr("data-gametype");
					if (n && i) {
						s.deleteLocalGames("prev_user_playedgames_small", [n], o), s.deleteLocalGames("unlogin_playedgames_small", [n], o), s.deleteLocalGames("prev_user_playedgames_community", [n], o);
						var u = r.get("userid");
						u && s.deleteServerGames(u, i, n, function() {}), g()
					}
					e.preventDefault()
				}
			});
			var w, E, S = "hide",
				x = !1;
			$("#btn-played,#btn-played-unlogin").hover(function(e) {
				qike.utils.login.isLogin() ? ($("#cont-played .func-area .fr a:eq(0)").show(), $("#cont-played .func-area .fr a:eq(1)").hide()) : ($("#cont-played .func-area .fr a:eq(0)").hide(), $("#cont-played .func-area .fr a:eq(1)").show()), u = $(this), x = !0, u.addClass("active"), S == "hide" && (S = "preshow", w = setTimeout(function() {
					g(), S = "show"
				}, 300)), S == "prehide" && (clearTimeout(E), E = null, S = "show")
			}, function(e) {
				x = !1, S == "preshow" && (clearTimeout(w), w = null, S = "hide", u.removeClass("active")), S == "show" && (S = "prehide", E = setTimeout(function(e) {
					a.hide(), u.removeClass("active"), S = "hide"
				}, 500))
			}), a.hover(function(e) {
				clearTimeout(E), E = null
			}, function(e) {
				setTimeout(function() {
					x || (a.hide(), u.removeClass("active"), S = "hide")
				}, 300)
			})
		},
		setDecorate: function(e) {
			function m() {
				$.browser.msie ? $("html").css("overflow", "hidden") : $("body").css("overflow", "hidden"), $("#decorate-mask").height($(window).height() + $(window).scrollTop()), $("#decorate-mask").width($(window).width() + $(window).scrollLeft());
				if (e == "play" && /\.html/.test(window._gamepath)) {
					var t = $(document.getElementById("gameobj").contentWindow.document.body);
					t.find("#player").css("visibility", "hidden")
				}
			}
			function g() {
				$.browser.msie ? $("html").css("overflow", "") : $("body").css("overflow", "");
				if (e == "play" && /\.html/.test(window._gamepath)) {
					var t = $(document.getElementById("gameobj").contentWindow.document.body);
					t.find("#player").css("visibility", "visible")
				}
			}
			function y() {
				$(".ui-slide1").each(function() {
					$(this).find(".ui-slide-trigger2 li:eq(0)").trigger("click")
				})
			}
			function b() {
				var e = d.get("current_decorate");
				if (e) {
					var t = e.split("|"),
						r = t[1];
					v = t[0] || window.dec_id
				}
				var i = n.find(".decorate-tabs-panel .ui-img-list li[data-id=" + v + "]");
				w(i)
			}
			function w(e) {
				var t = p.find("a.active"),
					n = e.find("a");
				t.find(".i-select").remove(), t.removeClass("active"), n.addClass("active").children(".skin-pic").append('<i class="i-select"></i>')
			}
			function E(e) {
				var t = "games/box/tpl/css/body_bg/" + e + ".css",
					n = $("#dec-css");
				n.length != 0 ? n.attr("href") != t && n.attr("href", t) : $("link[rel=stylesheet]").last().after('<link id="dec-css" rel="stylesheet" href="' + t + '">')
			}
			function x(e) {
				var t, n, r, i, s, o, u = 0,
					a = e.length;
				for (; u < a; u++) s = e[u], t = s[0], n = s[1], r = s[2], i = s[3], o = new qike.ui.TabSet(n, r, i), o.create()
			}
			var n = $("#cont-decorate"),
				i = '<div id="decorate-mask" style="position:absolute;top:0;left:0;width:100%;background:#000;opacity:0.3;filter:Alpha(opacity=30);z-index:999;"></div>',
				s, o, u, a = "http://www.7k7k.com/",
				f = "7",
				l = "hide",
				c = !1,
				h = new qike.ui.TabSet($("#cont-decorate .decorate-tabs ul li"), $("#cont-decorate .decorate-tabs-panel .decorate-outer"), {
					lazyload: !0,
					currentClass: "current",
					eventType: "click"
				});
			h.create();
			var p = n.find(".decorate-tabs-panel .ui-img-list li"),
				d = qike.utils.cookie,
				v = window.dec_id;
			new_id = window.dec_id, $("#login-in .decorate,#login-out .decorate").click(function(r) {
				b(), $("#decorate-mask").length > 0 ? $("#decorate-mask").show() : $("body").append(i), m(), t(n, e), e == "play" && ($("#J-my-if").length < 1 && $("body").append('<iframe id="J-my-if" frameborder="0" scrolling="no" style="position:absolute;z-index:998;top:0;background:#fff;opacity:0;filter:alpha(opacity=0);top:0;left:0;"></iframe>'), $("#J-my-if").css({
					width: $(window).width(),
					height: $(document).height()
				})), s = $("#decorate-mask"), n.show().css({
					top: $(document).scrollTop() + $(window).height() / 2 - n.height() / 2
				}), r.preventDefault()
			}), p.click(function(e) {
				var t = $(this);
				if (t.hasClass("please-wait")) return;
				new_id = t.attr("data-id"), w(n.find(".decorate-tabs-panel .ui-img-list li[data-id=" + new_id + "]")), E(new_id), r(new_id), e.preventDefault()
			}), n.find(".btn-save").click(function(t) {
				if (new_id) {
					if (parseInt(new_id, 10) > 99) {
						if (!d.get("userid")) return $(".decorate-tabs ul li:eq(0)").trigger("click"), n.hide(), s.hide(), e == "play" && $("#J-my-if").remove(), E(v), qike.loginDialog.open(), r(v), !1;
						if (!parseInt(Qk_Vip.getRank(), 10)) {
							n.hide(), $("body").append('<div id="vip_tip" class="ui-dialog ui-dialog-col" style="z-index: 1000;"><div class="ui-dialog-bd"><span class="tip-cat"></span><p class="tip-text"></p></div><div class="ui-dialog-ft"><a target="_self" href="javascript:void(0);" class="v-close">关闭</a></div><a href="javascript:void(0);" target="_self" class="ui-icon-close">关闭</a></div>');
							var i = $("#vip_tip");
							return i.css({
								top: $(document).scrollTop() + $(window).height() / 2 - i.height() / 2,
								left: $(window).width() / 2 - i.width() / 2
							}), i.find(".ui-icon-close").live("click", function() {
								i.remove(), s.hide(), E(v), e == "play" && $("#J-my-if").remove()
							}), !1
						}
					}
					v = new_id;
					var o = (new Date).getTime() + f * 24 * 60 * 60 * 1e3;
					d.set("current_decorate", [v, o].join("|"), 7)
				}
				$(".decorate-tabs ul li:eq(0)").trigger("click"), y(), n.hide(), s.hide(), g(), e == "play" && $("#J-my-if").remove(), t.preventDefault(), r(v)
			}), $("body").delegate(".btn-cancle,.decorate-close,#vip_tip a", "click", function() {
				E($('.decorate-close').attr('data-k')), w(n.find(".decorate-tabs-panel .ui-img-list li[data-id=" + v + "]")), $(".decorate-tabs ul li:eq(0)").trigger("click"), n.hide(), s.hide(), e == "play" && $("#J-my-if").remove(), $(".decorate-tabs ul li:eq(0)").trigger("click"), $("#vip_tip").remove(), y(), g(), r(v)
			});
			var S = [
				["rec", $(".decorate-rec .ui-slide-trigger2 li"), $(".decorate-rec .wrap-ul .ui-img-list"),
				{
					lazyload: !0,
					currentClass: "current",
					eventType: "click"
				}],
				["free", $(".decorate-free .ui-slide-trigger2 li"), $(".decorate-free .wrap-ul .ui-img-list"),
				{
					lazyload: !0,
					currentClass: "current",
					eventType: "click"
				}],
				["vip", $(".decorate-vip .ui-slide-trigger2 li"), $(".decorate-vip .wrap-ul .ui-img-list"),
				{
					lazyload: !0,
					currentClass: "current",
					eventType: "click"
				}]
			];
			x(S), $("#cont-decorate").find(".ui-slide-btn-left").click(function() {
				var e = $(this).siblings(".ui-slide-trigger2"),
					t = e.children(".current").index();
				t != 0 && e.children("li").eq(t - 1).trigger("click")
			}), $("#cont-decorate").find(".ui-slide-btn-right").click(function() {
				var e = $(this).siblings(".ui-slide-trigger2"),
					t = e.children(".current").index(),
					n = e.children("li"),
					r = n.length;
				t != r - 1 && n.eq(t + 1).trigger("click")
			})
		},
		setNavList: function(e) {
			var n = $("#btn-nav-list"),
				r = $("#cont-nav-list"),
				i, s, o = "hide",
				u = !1,
				a = $("#nav-wrap").find(".site-link:eq(0)").outerWidth(!0),
				f, l = $("#cont-nav-list").outerWidth(),
				c;
			n.hover(function(h) {
				t(r, e), u = !0, n.addClass("active"), f || (f = $("#nav-wrap").find(".site-link:eq(1)").outerWidth(!0), c = a + f - l, $.browser.msie && ($.browser.version == "6.0" && (c += 1), ($.browser.version == "8.0" || $.browser.version == "7.0") && e == "play" && (c -= 1)), r.css("left", c + "px")), o == "hide" && (o = "preshow", i = setTimeout(function() {
					r.show(), o = "show"
				}, 300)), o == "prehide" && (clearTimeout(s), s = null, o = "show")
			}, function(e) {
				u = !1, o == "preshow" && (clearTimeout(i), i = null, o = "hide", n.removeClass("active")), o == "show" && (o = "prehide", s = setTimeout(function() {
					r.hide(), o = "hide", n.removeClass("active")
				}, 300))
			}), r.hover(function(e) {
				clearTimeout(s), s = null
			}, function(e) {
				s = setTimeout(function() {
					u || (r.hide(), n.removeClass("active"), o = "hide")
				}, 300)
			})
		}
	}
}), define("suggestion", [], function() {
	function e(e, t) {
		var n = this;
		n.input = e, n.input.attr("autocomplete", "off"), n.options = t || {}, $.extend(n, n.options), n.currentClass = n.currentClass || "cur", n.index = -1, n.lineClass = n.lineClass || ".sugdd", n.parentClass = n.parentClass || ".sug-auto-complete", n.submitParent = n.submitParent || ".s-submit-wrap", n.lineAClass = n.lineAClass || ".s-name", n.historyClass = n.historyClass || ".sug-history", n.hotClass = n.hotClass || ".sug-hot", n.resultClass = n.resultClass || ".s-result", n.localStorageDomain = n.localStorageDomain || "http://www.7k7k.com/", n.closeClass = n.closeClass || ".s-close", n.mywords = n.mywords || ".mywords", n.time = n.time || 300, n.inputColor = n.inputColor || "#5f5f5f", n.defaultColor = n.defaultColor || "#ccc", n.hasIframe = n.hasIframe || !1
	}
	return e.prototype.init = function() {
		var e = this,
			t = e.input;
		e.parentSelect = t.siblings(e.parentClass), e.submit = t.siblings(e.submitParent).children(".s-submit"), e.history = e.parentSelect.find(e.historyClass), e.hot = e.parentSelect.find(e.hotClass), e.result = e.parentSelect.find(e.resultClass), e.words = e.parentSelect.find(e.mywords), e.regEvent(), e.hasIframe && (e.input.parent().append('<iframe id="searchIframe" style="position:absolute;left:0;background:#fff;filter:Alpha(opacity=0);z-index:10;border:none;display:none;"></iframe>'), e.searchIframe = $("#searchIframe"))
	}, e.prototype.close = function() {
		var e = this;
		e.parentSelect.find(e.lineClass).remove(), e.history.hide(), e.hot.show(), e.result.find("li").remove(), e.result.hide(), e.parentSelect.hide(), e.hasIframe && e.searchIframe.hide()
	}, e.prototype.regEvent = function() {
		var e = this;
		e.input.click(function(t) {
			t.stopPropagation(), e.input.val(""), e.parentSelect.show().width(e.input.parents(".search").width() - e.submit.width());
			if (e.parentSelect.find(e.lineClass).length != 0) return;
			e.filloption(), e.fillLocalStorage(), e.hasIframe && (e.searchIframe.show(), e.iframe())
		}), e.input.keydown(function(t) {
			t.keyCode == 38 ? e.pre() : t.keyCode == 40 ? e.next() : t.keyCode == 13 && e.submit.trigger("click")
		}), e.input.keyup(function(t) {
			if (t.keyCode == 38 || t.keyCode == 40 || t.keyCode == 37 || t.keyCode == 39) return !1;
			if ($.trim(e.input.val()) == "") {
				e.hot.show(), e.words.text(""), e.result.find("li").remove(), e.result.hide();
				if (e.parentSelect.find(e.lineClass).length != 0) return;
				e.filloption(), e.fillLocalStorage()
			} else e.history.hide(), e.hot.hide(), e.input.css("color", e.inputColor), e.openSuggestion();
			e.hasIframe && e.iframe()
		}), e.history.delegate(e.closeClass, "click", function() {
			var t = $(this),
				n, r = t.siblings(e.lineAClass),
				i = r.text() + ",";
			qike.localStorage.getItem("nearSearch", e.localStorageDomain, function(r) {
				n = r.replace(i, "");
				if (n == "") {
					t.parent().remove(), e.history.hide(), qike.localStorage.removeItem("nearSearch", e.localStorageDomain);
					return
				}
				qike.localStorage.setItem("nearSearch", n, e.localStorageDomain, function() {
					t.parent().remove()
				})
			}), e.hasIframe && e.iframe()
		}), e.submit.click(function() {
			var t = $.trim(e.input.val());
			qike.localStorage.getItem("nearSearch", e.localStorageDomain, function(n) {
				if (!n) qike.localStorage.setItem("nearSearch", t + ",", e.localStorageDomain);
				else {
					if (n.match(t) != null) return;
					var r = n.split(",");
					r.length > 5 ? (r = r.slice(1, 5), r.push(t), t = r.join(",") + ",") : t = n + t + ",", qike.localStorage.setItem("nearSearch", t, e.localStorageDomain)
				}
			})
		}), $(document).click(function() {
			e.input.css("color", e.defaultColor), e.close()
		}), e.parentSelect.click(function(e) {
			e.stopPropagation()
		})
	}, e.prototype.fillLocalStorage = function() {
		var e = this;
		qike.localStorage.getItem("nearSearch", e.localStorageDomain, function(t) {
			e.parentSelect.show();
			if (!t) e.history.hide();
			else {
				var n = t.split(","),
					r = [];
				nstLen = n.length;
				for (var i = 0; i < nstLen; i++) {
					if (n[i] == "") continue;
					r.push('<dd class="sugdd"><a class="s-name" href="http://so.7k7k.com/game/' + n[i] + '.htm" target="_blank">' + n[i] + '</a><a href="javascript:void(0);" class="s-close"></a>')
				}
				e.history.show().append(r.join(""))
			}
		})
	}, e.prototype.filloption = function() {
		var e = this,
			t = options.hot.split(","),
			n, r = [];
		for (var i = 0; i < t.length; i++) n = t[i].split("|"), r.push('<dd class="sugdd"><a class="s-name" href="' + n[1] + '" target="_blank">' + n[0] + "</a></dd>");
		e.hot.append(r.join(""))
	}, e.prototype.openSuggestion = function() {
		var e = this;
		e.parentSelect.show().find("dd").remove(), e.result.show(), e.parentSelect.css("z-index", 100), e.result.find(e.mywords).text(e.input.val()), e.result.find("a").attr("href", "http://so.7k7k.com/game/" + e.input.val() + ".htm"), clearTimeout(e.timer), e.timer = setTimeout(function() {
			e.filldata()
		}, e.time)
	}, e.prototype.filldata = function() {
		var e = this;
		$.ajax({
			url: "http://so.7k7k.com/index.htm?t=getJson&k=" + e.input.val() + "&rnd=" + (new Date).getTime(),
			type: "GET",
			dataType: "jsonp",
			success: function(t) {
				if (t.list.length > 0) {
					var n = t.list.length,
						r = [];
					n > 5 ? n = 5 : n = n;
					for (var i = 0; i < n; i++) t.list[i].type == 2 ? r.push('<li class="sugdd"><a href="http://www.7k7k.com/tag/' + t.list[i].id + '/" target="_blank" class="s-name">' + t.list[i].name + "</a></li>") : t.list[i].type == 1 ? r.push('<li class="sugdd"><a href="http://www.7k7k.com/flash_fl/' + t.list[i].id + '_1.htm" target="_blank" class="s-name">' + t.list[i].name + "</a></li>") : r.push('<li class="sugdd"><a target="_blank" class="pic" href="http://www.7k7k.com/flash/' + t.list[i].id + '.htm"><img src="http://i' + qike.utils.random(1, 5) + ".7k7kimg.cn/gameico/" + parseInt(parseInt(t.list[i].id) / 1e4) + "/" + t.list[i].id + '.jpg" width="60" height="63" alt="' + t.list[i].name + '"></a><h3><a class="s-name" href="http://www.7k7k.com/flash/' + t.list[i].id + '.htm" target="_blank">' + t.list[i].name + "</a></h3></li>");
					e.result.find("ul").empty().append(r.join("")), e.hasIframe && e.iframe()
				} else e.result.find("ul").empty().append("<li>暂时没有您搜索的数据</li>")
			}
		})
	}, e.prototype._select = function(e) {
		var t = this;
		t.lineSelect.removeClass(t.currentClass).eq(e).addClass(t.currentClass), t.input.val(t.lineSelect.eq(e).find(t.lineAClass).text())
	}, e.prototype.pre = function() {
		var e = this;
		e.lineSelect = e.parentSelect.find(e.lineClass), e.len = e.lineSelect.length, e.index < 0 && (e.index = e.len), e.index -= 1, e._select(e.index)
	}, e.prototype.next = function() {
		var e = this;
		e.lineSelect = e.parentSelect.find(e.lineClass), e.len = e.lineSelect.length, e.index == e.len - 1 && (e.index = -1), e.index += 1, e._select(e.index)
	}, e.prototype.iframe = function() {
		var e = this,
			t = $("#searchIframe"),
			n = e.parentSelect;
		t.css({
			height: n.height() - 8,
			width: n.width(),
			top: n.css("top")
		})
	}, {
		init: function(t, n) {
			(new e(t, n)).init()
		}
	}
}), require.config({
	paths: {
		qike: "js3",
		navigator: "../modules/navigator",
		suggestion: "../modules/suggestion"
	},
	waitSeconds: 90
}), require(["qike", "navigator", "suggestion"], function(e, t, n) {
	function s(e) {
		var t, n, r, s, o, u, a = 0,
			f = e.length;
		for (; a < f; a++) o = e[a], t = o[0], n = o[1], r = o[2], s = o[3], u = new qike.ui.TabSet(n, r, s), u.create(), i[t] = u
	}
	function a(e) {
		var t, n, r, i, s, o, a = 0,
			f = e.length;
		for (; a < f; a++) s = e[a], t = s[0], n = s[1], r = s[2], i = s[3], o = new qike.ui.carousel(n, r, i), u[t] = o, o.groupSelect && $(o.groupSelect).unbind("hover")
	}
	function b() {
		f.getLocalGames(["prev_user_playedgames_small", "unlogin_playedgames_small", "prev_user_playedgames_community"], y, function(e) {
			p = e.prev_user_playedgames_small || [], h = e.unlogin_playedgames_small || [], d = e.prev_user_playedgames_community || [];
			var t = f.mergeGames([p, h, d]);
			w(t);
			if (qike.utils.login.isLogin()) {
				$("#tab-played .btn-del").css("visibility", "hidden");
				if (!l.get("gs")) {
					var n = l.get("userid");
					f.addServerGames(n, h), f.getServerGames(v, n, function(e) {
						if (e.status == 1) {
							var t = e.data,
								r = f.mergeGames([t, h]);
							f.addLocalGames("prev_user_playedgames_small", r, y);
							var t = f.mergeGames([p, r]);
							w(t)
						} else e.status == 2 ? setTimeout(function() {
							f.getServerGames(v, n, function(e) {
								if (e.status == 1) {
									var t = e.data,
										n = f.mergeGames([t, h]);
									f.addLocalGames("prev_user_playedgames_small", n, y);
									var t = f.mergeGames([p, n]);
									w(t)
								} else f.addLocalGames("prev_user_playedgames_small", h, y)
							})
						}, 2e3) : f.addLocalGames("prev_user_playedgames_small", h, y)
					})
				}
			}
		})
	}
	function w(e) {
		var t = e,
			n = E();
		if (!t || t.length == 0) t = [];
		if (!n || n.length == 0) n = [];
		for (var r = 0, s = t.length; r < s; r++) {
			var o = t[r];
			for (j = 0, len2 = n.length; j < len2; j++) {
				var u = n[j];
				if (o.gameid == u.gameid) {
					n.splice(j, 1);
					break
				}
			}
		}
		t = f.sortGamesByPlayedTime(t);
		if (t.length >= m) t.splice(m, t.length - m), n = [];
		else {
			var a = t.length,
				l = n.length;
			a + l > m && n.splice(m - a, l + a - m)
		}
		var c = [].concat(S(t), S(n)),
			h = [],
			r = 0,
			p = c.length;
		for (; r < p; r++) r == 0 && h.push('<ul class="ui-img-list span7 alignleft" style="display:none">'), r != 0 && r % g == 0 && h.push('</ul><ul class="ui-img-list span7 alignleft" style="display:none" lazyload>'), h.push(c[r]);
		h.push("</ul>"), $("#tab-played .all-mygame").empty().append(h.join("")), i.played.titles = $("#tab-played .ui-slide-trigger2 li"), i.played.contents = $("#tab-played .ui-img-list"), i.played.selectByIndex(0), $("#tab-played .all-mygame li").unbind().hover(function(e) {
			var t = $(this).find(".i-del");
			t.attr("data-gametype") && t.show()
		}, function(e) {
			$(this).find(".i-del").hide()
		}), qike.utils.login.isLogin() || $("#tab-played .logout").unbind("click").bind("click", function(e) {
			qike.loginDialog.open(), e.preventDefault()
		})
	}
	function E() {
		var e = $("#tab-played .all-mygame").attr("data-recommend"),
			t = e.split(","),
			n = 0,
			r = t.length;
		for (; n < r; n++) {
			var i = t[n].split("|"),
				s = {};
			s.gameid = i[0], s.gamename = i[1], s.gameurl = i[2], s.gametype = "", t[n] = s
		}
		return t
	}
	function S(e) {
		if (!e || e.length == 0) return [];
		var t = 0,
			n = e.length,
			r, i, s, o, u, a, f = [];
		for (t; t < n; t++) r = e[t], o = r.gameid, i = r.gamename, a = r.gametype, s = /\/swf\//.test(r.gameurl) ? "http://www.7k7k.com/flash/" + o + ".htm" : r.gameurl, u = "http://i" + qike.utils.random(1, 5) + ".7kimg.cn/gameico/" + parseInt(parseInt(o) / 1e4) + "/" + o + ".jpg", f[t] = '<li><a href="' + s + '" target="_blank" title="' + i + '"><img _src="' + u + '" alt="" class="pic" width="76" height="77"><span class="' + (a ? "ui-li-name" : "ui-li-name ui-li-name-rec") + '">' + i + '</span><i class="icon i-del" style="display:none" data-gameid="' + o + '" data-gametype="' + a + '"></i></a></li>';
		return f
	}
	function T() {
		x = setInterval(function() {
			if ($(".friend-link .fr-cont li").length <= 1) return;
			$(".friend-link .fr-cont").animate({
				marginTop: "-20px"
			}, 500, function() {
				$(".friend-link .fr-cont li:eq(0)").appendTo($(".friend-link .fr-cont")), $(".friend-link .fr-cont").css("margin-top", "0")
			})
		}, 2e3)
	}
	function N() {
		var e = $(window),
			t = $(".backTop"),
			n = $(".ui-btn-feedback"),
			r = e.width() - 980 - t.width() * 2;
		e.scrollTop() > 100 ? t.css("display", "block") : t.hide(), r > 0 ? (t.css("margin-left", e.width() / 2 - t.width()), n.css("margin-left", e.width() / 2 - t.width())) : (t.css("margin-left", 490), n.css("margin-left", 490)), n.css("visibility", "visible")
	}
	t.init(), t.setUserNav(), t.setMyPlayed(), t.setDecorate(), n.init($(".header .search .s-text"), {}), qike.utils.login.isLogin()

	var r = [
		["played", $("#tab-played .ui-slide-trigger2 li"), $("#tab-played .ui-img-list"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}],
		["tj", $("#tab-tj .ui-tabs li"), $("#tab-tj .ui-img-cont"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}],
		["zt", $("#tab-zt .ui-tabs li"), $("#tab-zt .ui-img-list"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}],
		["star", $("#tab-star .ui-tabs li"), $("#tab-star .ui-img-list"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}],
		["7ktj-t", $("#tab-7ktj-t .ui-slide-trigger2 li"), $("#tab-7ktj-t .rec-focus li"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}],
		["7ktj-b", $("#tab-7ktj-b .rec-tabs-nav li"), $("#tab-7ktj-b .ui-img-text"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "hover"
		}],
		["ios", $(".mobile-block .col2-left .bd-tabs a"), $(".mobile-block .col2-left .bd-all-tabs .bd-tabs-con"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}],
		["android", $(".mobile-block .col2-right .bd-tabs a"), $(".mobile-block .col2-right .bd-all-tabs .bd-tabs-con"),
		{
			lazyload: !0,
			currentClass: "current",
			eventType: "click"
		}]
	],
		i = {};
	s(r), $("#tab-played .ui-slide-btn-left").click(function() {
		var e = i.played;
		e.index == 0 ? e.selectByIndex(e.contents.length - 1) : e.prev()
	}), $("#tab-played .ui-slide-btn-right").click(function(e) {
		var t = i.played;
		t.index == t.contents.length - 1 ? t.selectByIndex(0) : t.next()
	}), i.zt.url_pre = "http://www.7k7k.com/ztgame/", i.zt.select = function(e) {
		if (e.title.attr("has-load") === "yes") return;
		var t = e.title,
			n = e.content,
			r = t.attr("data-id"),
			i = this.url_pre + r + ".htm";
		$.get(i, function(e) {
			n.html(e), t.attr("has-load", "yes")
		})
	}, i.star.url_pre1 = "http://www.7k7k.com/startgame/", i.star.url_pre2 = "http://www.7k7k.com/top/", i.star.maxCount = 3, i.star.select = function(e) {
		var t = i.star,
			n = e.title,
			r = e.content,
			s = n.attr("data-id"),
			o = n.attr("data-count");
		t.currentObj = e, o == 0 && $.get(t.url_pre1 + s + "_1.htm", function(e) {
			r.append(e), n.attr("data-count", 1)
		}), o < t.maxCount ? ($("#tab-star .more-area a").attr("href", "#bottom").attr("target", "_self").html("<span class='kkmao'></span><i class='icon i-more'></i>显示更多"), $("#tab-star .more-area").show()) : $("#tab-star .more-area").hide()
	}, $("#tab-star .more-area a").click(function(e) {
		var t = i.star.currentObj && i.star.currentObj.title || i.star.titles.first(),
			n = i.star.currentObj && i.star.currentObj.content || i.star.contents.first(),
			r = t.attr("data-id"),
			s = parseInt(t.attr("data-count"));
		s++, s <= i.star.maxCount && ($.get(i.star.url_pre1 + r + "_" + s + ".htm", function(e) {
			n.append(e), t.attr("data-count", s)
		}), s == i["star"].maxCount && ($("#tab-star .more-area").hide(), e.preventDefault()))
	}), $("#tab-7ktj-t .ui-slide-btn-left").click(function(e) {
		var t = i["7ktj-t"];
		t.index == 0 ? t.selectByIndex(t.contents.length - 1) : t.prev()
	}), $("#tab-7ktj-t .ui-slide-btn-right").click(function(e) {
		var t = i["7ktj-t"];
		t.index == t.contents.length - 1 ? t.selectByIndex(0) : t.next()
	});
	var o = [
		["mg", $("#c-mg"), "#c-mg ul li",
		{
			slideTime: 1,
			slideCount: 6,
			lazyload: !0,
			speed: 18,
			widthElement: $("#c-mg ul"),
			nextButton: $("#c-mgl"),
			prevButton: $("#c-mgr")
		}],
		["zq", $("#c-zq"), "#c-zq ul li",
		{
			slideTime: 1,
			slideCount: 12,
			lazyload: !0,
			speed: 33,
			widthElement: $("#c-zq ul"),
			nextButton: $("#c-zql"),
			prevButton: $("#c-zqr")
		}],
		["tj", $("#c-tj"), "#c-tj ul li",
		{
			slideTime: 1,
			slideCount: 12,
			lazyload: !0,
			speed: 33,
			widthElement: $("#c-tj ul"),
			nextButton: $("#c-tjl"),
			prevButton: $("#c-tjr")
		}]
	],
		u = {};
	a(o);
	var f = qike.playedgame.PlayedGame,
		l = qike.utils.cookie,
		c = qike.utils.subscribeModel,
		h, p, d, v = [1],
		m = 18,
		g = 6,
		y = "http://www.7k7k.com";
	b(), $("#tab-played .all-mygame").click(function(e) {
		var t = $(e.target);
		if (t.hasClass("i-del")) {
			var n = t.attr("data-gameid"),
				r = t.attr("data-gametype");
			if (n && r) {
				f.deleteLocalGames("prev_user_playedgames_small", [n], y), f.deleteLocalGames("unlogin_playedgames_small", [n], y), f.deleteLocalGames("prev_user_playedgames_community", [n], y);
				var i = l.get("userid");
				i && f.deleteServerGames(i, r, n, function() {}), b()
			}
			e.preventDefault()
		}
	}), $("#tab-played .btn-del").click(function() {
		f.emptyLocalGames(["prev_user_playedgames_small", "unlogin_playedgames_small", "prev_user_playedgames_community"], y, function() {
			b()
		})
	}), c.subscribe("login-success", function() {
		$("#tab-played .btn-del").css("visibility", "hidden");
		var e = qike.utils.cookie;
		f.emptyLocalGames(["prev_user_playedgames_small", "prev_user_playedgames_community"], y, function() {
			f.getLocalGames(["unlogin_playedgames_small"], y, function(t) {
				h = t.unlogin_playedgames_small || [];
				var n = e.get("userid");
				h && f.addServerGames(n, h), f.getServerGames(v, n, function(e) {
					if (e.status == 1) {
						var t = e.data,
							r = f.mergeGames([t, h]);
						f.addLocalGames("prev_user_playedgames_small", r, y), w(r)
					} else e.status == 2 ? setTimeout(function() {
						f.getServerGames(v, n, function(e) {
							if (e.status == 1) {
								var t = e.data,
									n = f.mergeGames([t, h]);
								f.addLocalGames("prev_user_playedgames_small", n, y), w(n)
							} else f.addLocalGames("prev_user_playedgames_small", h, y), w(h)
						})
					}, 2e3) : (f.addLocalGames("prev_user_playedgames_small", h, y), w(h))
				})
			})
		})
	}), c.subscribe("after-user-quit", function() {
		l.set("gs", ""), $("#tab-played .btn-del").css("visibility", "visible"), b()
	}), $("#my-sc").click(function(e) {
		qike.utils.login.isLogin() || (qike.loginDialog.open(), e.preventDefault())
	});
	var x;
	$(".friend-link .fr-cont li").length > 1 && $(".friend-link .fr-cont-wrap").hover(function() {
		clearInterval(x), x = null
	}, function() {
		T()
	}), T(), $(function() {
		N()
	}), $(window).scroll(function() {
		N()
	}), $(window).resize(function(e) {
		N()
	}), $(".backTop").on("click", function() {
		$("html, body").animate({
			scrollTop: 0
		}, 500), $(this).fadeOut("slow")
	})
}), define("index", function() {});