window.qike = window.qike || {
	version: "beta 0.1"
};
qike.utils = qike.utils || {};
qike.ui = qike.ui || {};
qike.ui = qike.ui || {};
qike.utils.random = qike.utils.random ||
function(b, a) {
	return Math.floor(b + Math.random() * (a - b))
};
qike.utils.addFavorite = qike.utils.addFavorite ||
function(b, a) {
	try {
		window.external.addFavorite(b, a)
	} catch (c) {
		try {
			window.sidebar.addPanel(a, b, "")
		} catch (c) {
			alert("加入收藏失败，请使用Ctrl+D进行添加")
		}
	}
};
qike.utils.getUserId = qike.utils.getUserId ||
function() {
	return this.cookie.get("userid") || false
};
(function() {
	function a() {}
	a.trim = function(b) {
		return b.replace(/(^\s*)|(\s*$)/g, "")
	};
	a.trimLeft = function(b) {
		return b.replace(/^\s*/, "")
	};
	a.trimRight = function(b) {
		return b.replace(/\s*$/, "")
	};
	a.isNotNullOrEmpty = function(b) {
		return b != null && b.length > 0
	};
	a.getLength = function(d) {
		var b = 0;
		for (var c = 0, e = d.length; c < e; c++) {
			if (d.charCodeAt(c) >= 19968 && d.charCodeAt(c) <= 40869) {
				b += 2
			} else {
				b += 1
			}
		}
		return b
	};
	a.equalsIgnoreCase = function(c, b) {
		return c.toUpperCase() == b.toUpperCase()
	};
	a.isChinese = function(b) {
		return /^[\u4E00-\uFA29]*$/.test(b) && (!/^[\uE7C7-\uE7F3]*$/.test(b.replace(/(^\s*)|(\s*$)/g, "")))
	};
	a.isEmail = function(b) {
		return /^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/i.exec(b) != null
	};
	a.isPost = function(b) {
		return /^[a-zA-Z0-9 ]{3,12}$/.test(b)
	};
	a.isImg = function(b) {
		return new RegExp("[.]+(jpg|jpeg|png|bmp|gif)$", "gi").test(b)
	};
	a.isMobile = function(b) {
		return /^(?:13\d|15[89])-?\d{5}(\d{3}|\*{3})$/.test(b)
	};
	qike.utils.string = qike.utils.string || a
})();
(function() {
	function a() {}
	a.isSame = function(d, c) {
		if (d == null && c == null) {
			return true
		}
		if (d == null || c == null) {
			return false
		}
		if (d.length != c.length) {
			return false
		}
		for (var e = 0, b = d.length; e < b; e++) {
			if (d[e] != c[e]) {
				return false
			}
		}
		return true
	};
	a.filter = function(b, f, e) {
		var c = b.slice();
		for (var d = 0; d < c.length; d++) {
			if (c[d][f] === e) {
				alert("i " + d);
				c.splice(d, 1);
				d--
			}
		}
		return c
	};
	a.del = function(c, f, e) {
		for (var d = 0, b = c.length; d < b; d++) {
			if (c[d][f] === e) {
				c.splice(d, 1);
				d--
			}
		}
	};
	a.isIn = function(c, g, f) {
		var d = c.slice();
		for (var e = 0, b = d.length; e < b; e++) {
			if (d[e][g] === f) {
				return true
			}
		}
		return false
	};
	a.findAll = function(c, g, f) {
		var d = [];
		for (var e = 0, b = c.length; e < b; e++) {
			if (c[e][g] != null && c[e][g] === f) {
				d.push(c[e])
			}
		}
		return d
	};
	a.toArray = function(d) {
		var b = [],
			c;
		for (c = 0, len = d.length; c < len; c++) {
			b.push(d[c])
		}
		return b
	};
	qike.utils.array = qike.utils.array || a
})();
(function() {
	var a = encodeURIComponent,
		b = decodeURIComponent;
	qike.utils.cookie = qike.utils.cookie || {
		set: function(h, d, e, c, i, g) {
			var f = new Date();
			e = e || -1;
			f.setDate(f.getDate() + e);
			return (document.cookie = [a(h), "=", c ? a(d.toString()) : d.toString(), "; expires=" + f.toUTCString(), "; path=/", "; domain=." + (g ? g : "7k7k.com"), i ? "; secure" : ""].join(""))
		},
		get: function(e, c) {
			var d;
			return (d = new RegExp("(?:^|; )" + a(e) + "=([^;]*)").exec(document.cookie)) ? (c ? b(d[1]) : d[1]) : null
		}
	}
})();
(function() {
	var a = qike.utils.cookie;

	function b() {}
	b.quit = function() {
		var d = ["userid", "username", "kk", "nickname"],
			c;
		for (c in d) {
			a.set(d[c], "")
		}
		qike.utils.subscribeModel.fire("utils-user-quited")
	};
	b.isLogin = function(d) {
		var d = d || ["userid"],
			c = d.length,
			e = 0;
		for (e; e < c; e++) {
			if (a.get(d[e]) === null) {
				return 0
			}
		}
		return 1
	};
	qike.utils.login = qike.utils.login || b
})();
(function() {
	var a = {};
	a.event = a.event || {};
	a.subscribe = function(g, f) {
		var b = a,
			d, c, e;
		if (typeof g !== "string") {
			return 1
		}
		if (typeof f !== "function") {
			return 2
		}
		d = g.split(".");
		c = d[0];
		e = d[1];
		b.event = b.event || {};
		if (b.event[c] === undefined) {
			b.event[c] = []
		}
		if (e === undefined) {
			b.event[c].push(f)
		} else {
			b.event[c].push([e, f])
		}
		return 0
	};
	a.unSubscribe = function(g, d) {
		var e = a,
			c, h, j, k, b, f;
		if (typeof g !== "string") {
			return 1
		}
		k = g.split(".");
		b = k[0];
		f = k[1];
		e.event = e.event || {};
		if (e.event[b] === undefined) {
			return 3
		}
		c = e.event[b];
		if (f === undefined) {
			if (typeof d === "undefined") {
				e.event[b] = undefined;
				return 3
			}
			for (h = 0, j = c.length; h < j; h++) {
				if (c[h] instanceof Array && c[h][1] === d) {
					c.splice(h, 1);
					continue
				}
				if (c[h] == d) {
					c.splice(h, 1)
				}
			}
		} else {
			if (typeof d === "undefined") {
				for (h = 0, j = c.length; h < j; h++) {
					if (c[h] instanceof Array && c[h][0] === f) {
						c.splice(h, 1)
					}
				}
			} else {
				for (h = 0, j = c.length; h < j; h++) {
					if (c[h] instanceof Array && c[h][0] === f) {
						if (c[h] === d) {
							c.splice(h, 1)
						}
					}
				}
			}
		}
		return 0
	};
	a.fire = function(g, e) {
		var c = a,
			d = 0,
			b, f;
		f = c.event[g];
		if (f) {
			for (d = 0, b = f.length; d < b; d++) {
				if (f[d] instanceof Array) {
					f[d][1](e, g);
					continue
				}
				f[d](e)
			}
		}
	};
	qike.utils.subscribeModel = a
})();
(function() {
	function a(d, c, b) {
		var e = this;
		e.element = d;
		e.groupSelect = c;
		e.slideCount = 1;
		e.options = b || {};
		$.extend(e, e.options);
		e.waitTime = e.waitTime || 3000;
		e.slideTime = e.slideTime || 100;
		e.pause = false;
		e.loop = true;
		e.style = e.style || "h";
		e.mappings = {
			h: {
				scroll: "scrollLeft",
				len: "outerWidth",
				_len: "width"
			},
			v: {
				scroll: "scrollTop",
				len: "outerHeight",
				_len: "height"
			}
		};
		e.currentClass = e.currentClass || "current";
		e.speed = e.speed || 1;
		e._regEvent();
		if (e.auto) {
			window.setInterval(function() {
				e.nextSlide()
			}, e.waitTime)
		}
	}
	a.prototype._regEvent = function() {
		var c = this,
			b = $(c.groupSelect);
		b.hover(function() {
			c.stop = true
		}, function() {
			c.stop = false
		});
		if (c.prevButton) {
			c.prevButton.click(function() {
				if (c.animate == true) {
					return false
				}
				c.prevSlide();
				c.lazyload && c._lazyload()
			})
		}
		if (c.nextButton) {
			if (c.animate == true) {
				return false
			}
			c.nextButton.click(function() {
				if (c.animate == true) {
					return false
				}
				c.nextSlide();
				c.lazyload && c._lazyload()
			})
		}
	};
	a.prototype.prevSlide = function(j, e, d) {
		var i = this,
			l = i.element,
			k = $(i.groupSelect),
			f = 0,
			c, h = 0,
			j = j || i.slideCount,
			e = e || i.speed,
			d = d || 2,
			b = i.mappings[i.style];

		function g() {
			if (i.stop) {
				return false
			}
			f = f + e;
			i.animate = true;
			l[b.scroll](f);
			var m = (k.eq(0)[b.len])(true);
			if (f >= m) {
				f = 0;
				($(i.groupSelect).eq(k.length - 1)).after($(i.groupSelect).eq(0));
				l[b.scroll](0);
				h++;
				if (h < j) {
					g()
				} else {
					clearInterval(c);
					if (d == 2) {
						i.afterPrevSlide && i.afterPrevSlide()
					}
					i.finishNextSlide && i.finishNextSlide();
					i.animate = false
				}
			}
		}
		c = setInterval(g, i.slideTime)
	};
	a.prototype.nextSlide = function(k, e, d) {
		var i = this,
			m = i.element,
			l = $(i.groupSelect),
			b = i.mappings[i.style],
			f = l.eq(0)[b.len](true),
			j = 0,
			h = 0,
			d = d || 2,
			c, k = k || i.slideCount,
			e = e || i.speed;
		$(i.groupSelect).eq(0).before($(i.groupSelect).eq(l.length - 1));

		function g() {
			if (i.stop) {
				return false
			}
			f = f - e;
			j = j + e;
			i.animate = true;
			m[b.scroll](f);
			var n = (l.eq(0)[b.len])(true);
			if (j >= n) {
				h++;
				if (h < k) {
					f = l.eq(0)[b.len](true);
					j = 0, $(i.groupSelect).eq(0).before($(i.groupSelect).eq(l.length - 1));
					g()
				} else {
					clearInterval(c);
					if (d == 2) {
						i.afterNextSlide && i.afterNextSlide()
					}
					i.finishNextSlide && i.finishNextSlide();
					i.animate = false
				}
			}
		}
		c = setInterval(g, i.slideTime)
	};
	a.prototype._lazyload = function(f, d) {
		var h = this,
			c = [],
			l = $(h.groupSelect),
			b = h.slideCount,
			g = l.length;
		for (var f = 0; f < g; f++) {
			var j = l.eq(f);
			var e = j.find("img");
			e.each(function() {
				$(this).attr("src", $(this).attr("_src"))
			})
		}
	};
	qike.ui.carousel = a;
	qike.ui.Carousel = a
})();
(function() {
	function a(e, d, b) {
		var c = this;
		c.titles = e;
		c.contents = d || [];
		c.options = b || {};
		$.extend(c, c.options);
		c.currentClass = c.currentClass || "tabs-curr";
		c.eventType = c.eventType || "mouseover";
		c.index = c.index || 0;
		c.time = c.time || 5000;
		c.isAbleChange = true
	}
	a.prototype._setTab = function(d, c) {
		var b = this;
		d.addClass(b.currentClass);
		d.show();
		c.show();
		if (b.lazyload && c.attr("lazyload") != "ok") {
			var e = c.find("img");
			e.each(function() {
				$(this).attr("src", $(this).attr("_src"))
			});
			c.attr("lazyload", "ok")
		}
		if (b.mores) {
			b.mores.each(function() {
				$(this).hide()
			});
			b.mores.eq(b.index).show()
		}
	};
	a.prototype.regEvent = function() {
		var b = this;
		(b.titles[b.eventType])(function() {
			var c = null;
			if (b.contents.length > 0) {
				c = b.contents.eq(b.titles.index(this))
			}
			b._selectTab($(this), c);
			b.isAbleChange = false
		});
		b.titles.mouseout(function() {
			b.isAbleChange = true
		})
	};
	a.prototype.create = function() {
		var b = this;
		b.regEvent();
		if (b.isAuto) {
			b.auto()
		}
		if (b.index > 0) {
			b.selectByIndex(b.index)
		}
	};
	a.prototype.selectByIndex = function(b) {
		var d = this,
			e = d.titles.eq(b),
			c = null;
		if (b >= 0 && b < d.titles.length) {
			d.contents.length > 0 && (c = d.contents.eq(b));
			d._selectTab(e, c)
		}
	};
	a.prototype.next = function() {
		var b = this;
		b.selectByIndex(b.index + 1)
	};
	a.prototype.prev = function() {
		var b = this;
		b.selectByIndex(b.index - 1)
	};
	a.prototype.auto = function() {
		var b = this;
		window.setTimeout(function() {
			b.autoId = window.setInterval(function() {
				if (b.isAbleChange) {
					b.next();
					if (b.index == (b.titles.length - 1)) {
						b.index = -1
					}
				}
			}, b.time)
		}, b.time)
	};
	a.prototype._selectTab = function(d, c) {
		var b = this;
		b.titles.each(function() {
			$(this).removeClass(b.currentClass)
		});
		b.contents.each(function() {
			$(this).hide()
		});
		b.index = b.titles.index(d);
		b._setTab(d, c);
		b.select && b.select({
			title: d,
			content: c,
			index: b.index
		})
	};
	qike.ui.TabSet = a
})();
(function() {
	function a(b, c) {
		var d = this;
		d.container = b;
		d.options = c || {};
		$.extend(d, d.options);
		d.closeBtn = d.closeBtn || d.container.find(".close");
		d.parent = d.parent || $(window)
	}
	a.prototype.create = function() {
		var g = this,
			e = null,
			d = g.container;
		var f = d.find("iframe");
		d.css("z-index", 1001);
		e = f[1] || f[0];
		if (e) {
			var h = $(e).attr("_src"),
				b = "hdcallback_" + new Date().getTime(),
				c = h.indexOf("?") != -1 ? "&" : "?",
				h = h + c + "callback=" + b;
			window[b] = g.callback;
			$(e).attr("allowtransparency", "true");
			$(e).attr("src", h)
		}
		g.closeBtn.click(function() {
			g.close()
		});
		g.isCreat = true
	};
	a.prototype._createMask = function() {
		var d = this,
			c = d.container,
			e = $(window);
		$(document.body).append('<iframe  id="hd_ui_dialog_mask" src="about:blank" frameborder="no" style="display:block"></iframe>');
		var b = $("#hd_ui_dialog_mask");
		d.mask = b;
		b.width(e.width());
		b.height(e.height() + e.scrollTop());
		e.bind("scroll resize", function() {
			b.height($(document).height());
			b.width($(document).width())
		})
	};
	a.prototype._openMask = function() {
		var b = this;
		if (!b.mask) {
			b._createMask()
		}
		b.mask.show();
		$("select").css("visibility", "hidden");
		qike.utils.subscribeModel.fire("dialog-mask-open", b.mask)
	};
	a.prototype._closeMask = function() {
		var b = this;
		b.mask.hide();
		$("select").css("visibility", "visible")
	};
	a.prototype.center = function() {
		var g = this,
			f = g.parent,
			i = f.height(),
			e = f.width(),
			c = g.container,
			d = c.height(),
			b = c.width();
		c.css("left", (e - b) / 2);
		c.css("top", (i - d) / 2 + f.scrollTop())
	};
	a.prototype.open = function() {
		var b = this;
		if (!b.isCreat) {
			b.create()
		}
		b.isCenter && b.center();
		b.container.show();
		b.hasMask && b._openMask();
		qike.utils.subscribeModel.fire("dialog-open")
	};
	a.prototype.close = function() {
		var b = this;
		if (b.beforeClose) {
			if (!b.beforeClose()) {
				return false
			}
		}
		b.container.hide();
		b.hasMask && b._closeMask();
		b.afterClose && b.afterClose();
		qike.utils.subscribeModel.fire("dialog-close")
	};
	qike.ui.dialog = a
})();
(function() {
	function b(c, d) {
		var e = this;
		e.input = c;
		e.input.attr("autocomplete", "off");
		e.options = d || {};
		$.extend(e, e.options);
		e.currentClass = e.currentClass || "current";
		e.index = -1;
		e.cache = {};
		e.url = e.url || "";
		e.count = 0;
		e.parentSelect = e.parentSelect || ".sug-wrap";
		e.form = e.form || document.forms.header_so
	}
	b.prototype.init = function() {
		var c = this;
		c.regEvent()
	};
	b.prototype.close = function() {
		var c = this;
		c.ul && (c.ul.parent().hide());
		c.afterClose && c.afterClose()
	};
	b.prototype.regEvent = function() {
		var c = this;
		c.input.keydown(function(d) {
			if (d.which == 38) {
				c.prev()
			} else {
				if (d.which == 40) {
					c.next()
				} else {
					if (d.which == 13) {
						c.close()
					}
				}
			}
		});
		c.input.keyup(function(d) {
			if (d.which == 38 || d.which == 40 || d.which == 37 || d.which == 39) {
				return false
			}
			if (c.input.val() == "") {
				c.ul && c.ul.parent().hide();
				return false
			} else {
				c.openSuggestion()
			}
		});
		$(document).click(function() {
			c.close()
		});
		$(c.select).click(function(d) {
			d.stopPropagation()
		})
	};

	function a(d, e) {
		var c = document.createElement("script");
		c.type = "text/javascript";
		if (e) {
			c.onload = c.onreadystatechange = function() {
				if (c.readyState && c.readyState != "loaded" && c.readyState != "complete") {
					return
				}
				c.onreadystatechange = c.onload = null;
				e()
			}
		}
		c.src = d;
		document.getElementsByTagName("head")[0].appendChild(c)
	}
	b.prototype._createWrapper = function() {
		var d = this,
			e = "<iframe  id='sug-iframe' scrolling='no' frameborder='0' marginwidth='0' marginheight='0' tabindex='-1'class='sug-iframe'></iframe>";
		$("<div class='sug-auto-complete'><ul class='sug-auto-list'></ul></div>").appendTo(d.parentSelect);
		var c = $(".sug-auto-list");
		return c
	};
	b.prototype._fillData = function(g) {
		var f = this;
		ul = f.ul, tagArray = [], normalArray = [], strs = [];
		ul.html("");
		for (var d = 0, c = g.length; d < c; d++) {
			if (g[d].type == 2) {
				tagArray.push(g[d])
			} else {
				normalArray.push(g[d])
			}
		}
		function e(l) {
			for (var j = 0, h = l.length; j < h; j++) {
				var k = l[j];
				strs.push("<li><a target='_self'");
				strs.push("href='#' ");
				strs.push("keyword='" + k.name + "' ");
				strs.push("kid='" + k.id + "'");
				strs.push("index='" + j + "'");
				strs.push("ktype='" + k.type + "' ");
				strs.push(" >");
				strs.push(k.name);
				strs.push("</a></li>")
			}
		}
		e(normalArray);
		e(tagArray);
		ul.html(strs.join(""));
		$(".sug-auto-list a").hover(function() {
			f._select($(this)[0])
		}, function() {
			return false
		});
		$(".sug-auto-list a").click(function() {
			f.form.submit()
		});
		f.ul.parent().show()
	};
	b.prototype.openSuggestion = function() {
		var d = this,
			c = d.cache[d.input.val()];
		d.index = -1;
		if (d.count > 300) {
			d.cache = {}
		}
		d.ul = d.ul || d._createWrapper();
		window._suggestionAjax = function(e) {
			if (e.list.length > 0) {
				d._fillData(e.list);
				d.cache[d.input.val()] = e.list;
				d.count++
			} else {
				d.close()
			}
		};
		if (typeof(c) == "undefined") {
			a("http://so.7k7k.com/index.htm?t=getJson&k=" + d.input.val() + "&callback=_suggestionAjax&rnd=" + new Date().getTime())
		} else {
			d._fillData(c)
		}
		d.input.attr("defaultValue", d.input.val());
		d.afterOpen && d.afterOpen()
	};
	b.prototype._select = function(c) {
		var e = this,
			d = e.input;
		e.oldLi && (e.oldLi.className = "");
		if (c) {
			c.className = e.currentClass;
			d.val(c.getAttribute("keyword"));
			e.oldLi = c;
			e.index = parseInt(c.getAttribute("index"))
		} else {
			d.val(d.attr("defaultValue"))
		}
	};
	b.prototype.prev = function() {
		var d = this,
			c = d.ul[0].getElementsByTagName("a");
		if (d.index - 1 == -2) {
			d.index = c.length
		}
		d.index = d.index - 1;
		d._select(c[d.index])
	};
	b.prototype.next = function() {
		var d = this,
			c = d.ul[0].getElementsByTagName("a");
		if (d.index == c.length) {
			d.index = -1
		}
		d.index = d.index + 1;
		d._select(c[d.index])
	};
	qike.ui.suggestion = b
})();
$(function() {
	var e = "opacity:.6";
	if ($.browser.mozilla) {
		e = ""
	}
	var f = [".ui-mini-passport{position:absolute}", ".ui-mini-passport{font:normal 12px/1.5 arial;width:420px;_font-family:simsun}", ".ui-mini-passport *{margin:0;padding:0}", ".ui-mini-passport a{color:#666;text-decoration:none}", ".ui-mini-passport a:hover{color:red;text-decoration:underline}", ".ui-mini-passport input{vertical-align:middle}", ".ui-mini-passport ul,.ui-mini-passport li,.ui-mini-passport ol{list-style:none}", '.ui-ml-header{width:100%;height:63px;overflow:hidden;zoom:1;background:url(http://www.7k7kjs.cn/css/passport/201308051958/img/header2-bg.png) no-repeat;_background:0;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.7k7kjs.cn/css/passport/201308051958/img/header2-bg.png");}', ".ui-ml-header .closebtn{position:relative; zoom: 1;display:inline;float:right;margin-top:4px;width:30px;height:30px;line-height:18px;background:url(http://www.7k7kjs.cn/css/passport/201308051958/img/ico-close.png) no-repeat center;cursor:pointer;}", ".ui-ml-header ul{display:inline;float:left;margin-left:171px;overflow:hidden;zoom:1;}", ".ui-ml-header ul li{position:relative; zoom: 1;display:inline;float:left;padding-top:18px;margin:0 16px;width:62px;height:43px;font:normal 18px/41px microsoft yahei;text-align:center;color:#5f5f5f;cursor:pointer;}", ".ui-ml-header ul li.current{background:url(http://www.7k7kjs.cn/css/passport/201308051958/img/current2.png) no-repeat center bottom;}", '.ui-ml-footer-bg{height:8px;overflow:hidden;background:url(http://www.7k7kjs.cn/css/passport/201308051958/img/footer2-bg.png);_background:0;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="http://www.7k7kjs.cn/css/passport/201308051958/img/footer2-bg.png");}', "#hd_ui_dialog_mask {display:none;position:absolute;left:0;top:0;background:black;z-index:1000;" + e + ";filter:alpha(opacity=60);}"];
	var d = ['<div class="ui-mini-passport" id="J-mini-passport" style="display:none;">', '<iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;margin-left:8px;" frameborder="0" width="96%" height="98%" src="about:blank" allowtransparency="true"></iframe>', '<div class="ui-ml-header" id="uiheader"> <span class="closebtn"></span>', "<ul>", '<li class="current" id="login" target="login">\u767B\u5F55</li>', '<li class="" target="register" id="register">\u6CE8\u518C</li>', "</ul>", "</div><!-- ui-ml-header -->", '<iframe width="100%" scrolling="no" height="233" frameborder="0" allowtransparency="true" style="vertical-align: middle;" id="minilogin_iframe" _src="http://zc.7k7k.com/minilogin"></iframe>', '<div class="ui-ml-footer-bg"></div></div>'];
	//$("head").append('<style type="text/css">' + f.join("") + "</style>");
	//$(d.join("")).appendTo($(document.body));
	$("#J-mini-passport .ui-ml-header ul li").eq(0).text("\u767B\u5F55");
	$("#J-mini-passport .ui-ml-header ul li").eq(1).text("\u6CE8\u518C");
	var c = new qike.ui.dialog($("#J-mini-passport"), {
		closeBtn: $(".closebtn"),
		isCenter: true,
		hasMask: true,
		afterClose: function(g) {
			c.afterclose && c.afterclose()
		},
		callback: function(g, h) {
			var i;
			if (g === "logon") {
				if (h.success) {
					qike.utils.subscribeModel.fire("login-success", {
						task: g,
						data: h
					});
					c.close()
				} else {
					h = h.data || {};
					qike.utils.subscribeModel.fire("login-failure", {
						task: g,
						data: h
					});
					c.close();
					i = h.timeout ? "操作超时，请稍后重试" : h.message || "服务器忙，请稍后重试";
					alert(i)
				}
			} else {
				if (g === "error") {
					if (!h.success) {
						alert("status: " + h[0].status + "\n" + h[1] + " " + h[2] + "\n请刷新页面重试")
					}
				} else {
					if (g === "confirm-reg") {
						c.close();
						window.location.reload()
					} else {
						if (g === "register") {
							if (!h.success) {
								h = h.data || {};
								qike.utils.subscribeModel.fire("reg-failure", {
									task: g,
									data: h
								});
								c.close();
								i = h.timeout ? "操作超时，请稍后重试" : h.message || "服务器忙，请稍后重试";
								alert(i)
							} else {
								qike.utils.subscribeModel.fire("reg-success", {
									task: g,
									data: h
								})
							}
						}
					}
				}
			}
		}
	});
	qike.loginDialog = c;
	var b = function(g) {
			this.init(g)
		};

	function a(h, g) {
		var i = (g || window.location.search).match(new RegExp("[?&]" + h + "=([^&]*)(&?)", "i"));
		return i ? i[1] : i
	}
	b.prototype = {
		tablist: {
			login: {
				id: "#login",
				target: "login",
				url: "http://zc.7k7k.com/minilogin"
			},
			register: {
				id: "#register",
				target: "register",
				url: "http://zc.7k7k.com/minireg"
			}
		},
		defaultTag: "login",
		init: function(g) {
			var i = this;
			$.extend(i, g);
			i.tabs = [];
			for (var h in i.tablist) {
				i.tabs.push($(i.tablist[h].id))
			}
			i.bindEvent()
		},
		bindEvent: function() {
			var j = this,
				k, l;
			for (var g = 0, h; h = j.tabs[g++];) {
				$(h).bind("click", function() {
					var i = $(this).attr("target");
					j.hideTab();
					$(this).addClass("current");
					l = $("#minilogin_iframe");
					k = a("callback", l.attr("src"));
					if (k !== null) {
						l.attr("src", j.tablist[i].url + "?callback=" + k)
					} else {
						l.attr("src", j.tablist[i].url)
					}
				})
			}
		},
		hideTab: function() {
			for (var g = 0, h; h = this.tabs[g++];) {
				$(h).removeClass("current")
			}
		}
	};
	window.mini = new b({})
});

function setHeight(a) {
	$("#minilogin_iframe").attr("height", a);
	qike.loginDialog.center()
}
function toggleTab(a) {
	$(mini.tablist[a].id).trigger("click")
}(function() {
	qike.utils = qike.utils || {};
	qike.utils.md5 = function(r) {
		var y = function(b, a) {
				return (b << a) | (b >>> (32 - a))
			};
		var K = function(k, b) {
				var F, a, d, x, c;
				d = (k & 2147483648);
				x = (b & 2147483648);
				F = (k & 1073741824);
				a = (b & 1073741824);
				c = (k & 1073741823) + (b & 1073741823);
				if (F & a) {
					return (c ^ 2147483648 ^ d ^ x)
				}
				if (F | a) {
					if (c & 1073741824) {
						return (c ^ 3221225472 ^ d ^ x)
					} else {
						return (c ^ 1073741824 ^ d ^ x)
					}
				} else {
					return (c ^ d ^ x)
				}
			};
		var q = function(a, c, b) {
				return (a & c) | ((~a) & b)
			};
		var p = function(a, c, b) {
				return (a & b) | (c & (~b))
			};
		var o = function(a, c, b) {
				return (a ^ c ^ b)
			};
		var m = function(a, c, b) {
				return (c ^ (a | (~b)))
			};
		var v = function(G, F, aa, Z, k, H, I) {
				G = K(G, K(K(q(F, aa, Z), k), I));
				return K(y(G, H), F)
			};
		var f = function(G, F, aa, Z, k, H, I) {
				G = K(G, K(K(p(F, aa, Z), k), I));
				return K(y(G, H), F)
			};
		var E = function(G, F, aa, Z, k, H, I) {
				G = K(G, K(K(o(F, aa, Z), k), I));
				return K(y(G, H), F)
			};
		var u = function(G, F, aa, Z, k, H, I) {
				G = K(G, K(K(m(F, aa, Z), k), I));
				return K(y(G, H), F)
			};
		var e = function(d) {
				var G;
				var c = d.length;
				var b = c + 8;
				var F = (b - (b % 64)) / 64;
				var x = (F + 1) * 16;
				var H = Array(x - 1);
				var a = 0;
				var k = 0;
				while (k < c) {
					G = (k - (k % 4)) / 4;
					a = (k % 4) * 8;
					H[G] = (H[G] | (d.charCodeAt(k) << a));
					k++
				}
				G = (k - (k % 4)) / 4;
				a = (k % 4) * 8;
				H[G] = H[G] | (128 << a);
				H[x - 2] = c << 3;
				H[x - 1] = c >>> 29;
				return H
			};
		var t = function(d) {
				var c = "",
					a = "",
					k, b;
				for (b = 0; b <= 3; b++) {
					k = (d >>> (b * 8)) & 255;
					a = "0" + k.toString(16);
					c = c + a.substr(a.length - 2, 2)
				}
				return c
			};
		var s = function(b) {
				b = b.replace(/\x0d\x0a/g, "\x0a");
				var a = "";
				for (var k = 0; k < b.length; k++) {
					var d = b.charCodeAt(k);
					if (d < 128) {
						a += String.fromCharCode(d)
					} else {
						if ((d > 127) && (d < 2048)) {
							a += String.fromCharCode((d >> 6) | 192);
							a += String.fromCharCode((d & 63) | 128)
						} else {
							a += String.fromCharCode((d >> 12) | 224);
							a += String.fromCharCode(((d >> 6) & 63) | 128);
							a += String.fromCharCode((d & 63) | 128)
						}
					}
				}
				return a
			};
		var D = Array();
		var O, h, J, w, g, Y, X, W, V;
		var R = 7,
			P = 12,
			M = 17,
			L = 22;
		var C = 5,
			B = 9,
			A = 14,
			z = 20;
		var n = 4,
			l = 11,
			j = 16,
			i = 23;
		var T = 6,
			S = 10,
			Q = 15,
			N = 21;
		r = s(r);
		D = e(r);
		Y = 1732584193;
		X = 4023233417;
		W = 2562383102;
		V = 271733878;
		for (O = 0; O < D.length; O += 16) {
			h = Y;
			J = X;
			w = W;
			g = V;
			Y = v(Y, X, W, V, D[O + 0], R, 3614090360);
			V = v(V, Y, X, W, D[O + 1], P, 3905402710);
			W = v(W, V, Y, X, D[O + 2], M, 606105819);
			X = v(X, W, V, Y, D[O + 3], L, 3250441966);
			Y = v(Y, X, W, V, D[O + 4], R, 4118548399);
			V = v(V, Y, X, W, D[O + 5], P, 1200080426);
			W = v(W, V, Y, X, D[O + 6], M, 2821735955);
			X = v(X, W, V, Y, D[O + 7], L, 4249261313);
			Y = v(Y, X, W, V, D[O + 8], R, 1770035416);
			V = v(V, Y, X, W, D[O + 9], P, 2336552879);
			W = v(W, V, Y, X, D[O + 10], M, 4294925233);
			X = v(X, W, V, Y, D[O + 11], L, 2304563134);
			Y = v(Y, X, W, V, D[O + 12], R, 1804603682);
			V = v(V, Y, X, W, D[O + 13], P, 4254626195);
			W = v(W, V, Y, X, D[O + 14], M, 2792965006);
			X = v(X, W, V, Y, D[O + 15], L, 1236535329);
			Y = f(Y, X, W, V, D[O + 1], C, 4129170786);
			V = f(V, Y, X, W, D[O + 6], B, 3225465664);
			W = f(W, V, Y, X, D[O + 11], A, 643717713);
			X = f(X, W, V, Y, D[O + 0], z, 3921069994);
			Y = f(Y, X, W, V, D[O + 5], C, 3593408605);
			V = f(V, Y, X, W, D[O + 10], B, 38016083);
			W = f(W, V, Y, X, D[O + 15], A, 3634488961);
			X = f(X, W, V, Y, D[O + 4], z, 3889429448);
			Y = f(Y, X, W, V, D[O + 9], C, 568446438);
			V = f(V, Y, X, W, D[O + 14], B, 3275163606);
			W = f(W, V, Y, X, D[O + 3], A, 4107603335);
			X = f(X, W, V, Y, D[O + 8], z, 1163531501);
			Y = f(Y, X, W, V, D[O + 13], C, 2850285829);
			V = f(V, Y, X, W, D[O + 2], B, 4243563512);
			W = f(W, V, Y, X, D[O + 7], A, 1735328473);
			X = f(X, W, V, Y, D[O + 12], z, 2368359562);
			Y = E(Y, X, W, V, D[O + 5], n, 4294588738);
			V = E(V, Y, X, W, D[O + 8], l, 2272392833);
			W = E(W, V, Y, X, D[O + 11], j, 1839030562);
			X = E(X, W, V, Y, D[O + 14], i, 4259657740);
			Y = E(Y, X, W, V, D[O + 1], n, 2763975236);
			V = E(V, Y, X, W, D[O + 4], l, 1272893353);
			W = E(W, V, Y, X, D[O + 7], j, 4139469664);
			X = E(X, W, V, Y, D[O + 10], i, 3200236656);
			Y = E(Y, X, W, V, D[O + 13], n, 681279174);
			V = E(V, Y, X, W, D[O + 0], l, 3936430074);
			W = E(W, V, Y, X, D[O + 3], j, 3572445317);
			X = E(X, W, V, Y, D[O + 6], i, 76029189);
			Y = E(Y, X, W, V, D[O + 9], n, 3654602809);
			V = E(V, Y, X, W, D[O + 12], l, 3873151461);
			W = E(W, V, Y, X, D[O + 15], j, 530742520);
			X = E(X, W, V, Y, D[O + 2], i, 3299628645);
			Y = u(Y, X, W, V, D[O + 0], T, 4096336452);
			V = u(V, Y, X, W, D[O + 7], S, 1126891415);
			W = u(W, V, Y, X, D[O + 14], Q, 2878612391);
			X = u(X, W, V, Y, D[O + 5], N, 4237533241);
			Y = u(Y, X, W, V, D[O + 12], T, 1700485571);
			V = u(V, Y, X, W, D[O + 3], S, 2399980690);
			W = u(W, V, Y, X, D[O + 10], Q, 4293915773);
			X = u(X, W, V, Y, D[O + 1], N, 2240044497);
			Y = u(Y, X, W, V, D[O + 8], T, 1873313359);
			V = u(V, Y, X, W, D[O + 15], S, 4264355552);
			W = u(W, V, Y, X, D[O + 6], Q, 2734768916);
			X = u(X, W, V, Y, D[O + 13], N, 1309151649);
			Y = u(Y, X, W, V, D[O + 4], T, 4149444226);
			V = u(V, Y, X, W, D[O + 11], S, 3174756917);
			W = u(W, V, Y, X, D[O + 2], Q, 718787259);
			X = u(X, W, V, Y, D[O + 9], N, 3951481745);
			Y = K(Y, h);
			X = K(X, J);
			W = K(W, w);
			V = K(V, g)
		}
		var U = t(Y) + t(X) + t(W) + t(V);
		return U.toLowerCase()
	}
})();
window.qike = window.qike || {};
window.qike.localStorage = {};
window.qike.localStorage.isIE = /*@cc_on !@*/
false;
window.qike.localStorage.baseHtmlUrl = "localStorage.html";
window.qike.localStorage.baseFlashUrl = "localStorage.swf";
window.qike.localStorage.isSupportLocalStorage = (function() {
	var a = this;
	try {
		return "localStorage" in window && window.localStorage !== null
	} catch (b) {
		return false
	}
})();
qike.localStorage.loadIframe = function(c, e) {
	var a = this,
		f = document,
		b;
	a[c] = {};
	a[c].actionArr = [];
	a[c].actionArr.push(e);
	a[c].isLoading = 1;
	b = f.createElement("iframe");
	b.width = "0";
	b.height = "0";
	b.frameBorder = "0";
	b.src = c + a.baseHtmlUrl;
	b.style.display = "none";
	a[c].dom = b;
	f.getElementsByTagName("body")[0].appendChild(b);
	if (window.addEventListener) {
		b.addEventListener("load", function(d) {
			g()
		})
	} else {
		b.attachEvent("onload", function() {
			g()
		})
	}
	function g() {
		var h = a[c].actionArr,
			d = h.length,
			k = 0,
			m, l, j;
		a[c].isLoading = 2;
		iframeLocalStorage = a[c].iframeLocalStorage = b.contentWindow.localStorage;
		for (k; k < d; k++) {
			l = h[k];
			if (l.action === "getItem") {
				j = iframeLocalStorage[l.action](l.key);
				if (j == null) {
					j = null
				}
			} else {
				if (l.action === "removeItem") {
					j = iframeLocalStorage[l.action](l.key)
				} else {
					if (l.action === "setItem") {
						j = iframeLocalStorage.key(l.key, l.value)
					} else {
						if (l.action === "key") {
							j = iframeLocalStorage.key(l.key)
						} else {
							if (l.action === "clear") {
								j = iframeLocalStorage.clear()
							}
						}
					}
				}
			}
			typeof l.callback === "function" && l.callback(j, l)
		}
	}
};
qike.localStorage.loadFlash = function(f, g) {
	var a = this,
		h = document,
		i, c, e, b;
	a[f] = {};
	a[f].actionArr = [];
	a[f].actionArr.push(g);
	a[f].isLoading = 1;
	i = h.createElement("div");
	h.body.appendChild(i);
	i.style.position = "absolute";
	i.style.top = "-2000px";
	i.style.left = "-2000px";
	e = "SwfStore_" + (new Date().valueOf());
	b = "domain=" + f + "&amp;callback=qike.localStorage.flashCallback";
	swfUrl = f + a.baseFlashUrl;
	//i.innerHTML = '<object height="100" width="500" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="' + e + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">        <param value="' + swfUrl + '" name="movie">        <param value="' + b + '" name="FlashVars">        <param value="always" name="allowScriptAccess">        <embed height="375" align="middle" width="500" pluginspage="https://www.macromedia.com/go/getflashplayer" flashvars="' + b + '" type="application/x-shockwave-flash" allowscriptaccess="always" quality="high" loop="false" play="true" name="' + e + '" bgcolor="#ffffff" src="' + swfUrl + '"></object>';
	a[f].swf = document[e] || window[e]
};
qike.localStorage.flashCallback = function(f) {
	var c = this,
		b = c[f].actionArr,
		a, e = 0,
		h, g, d;
	setTimeout(function() {
		a = b.length;
		c[f].isLoading = 2;
		flashLocalStorage = c[f].swf;
		flashLocalStorage.setItem("__flashBugFix", "1");
		for (e; e < a; e++) {
			g = b[e];
			if (g.action === "getItem") {
				d = flashLocalStorage.getItem(g.key)
			} else {
				if (g.action === "setItem") {
					d = flashLocalStorage.setItem(g.key, g.value)
				} else {
					if (g.action === "removeItem") {
						d = flashLocalStorage.removeItem(g.key)
					} else {
						if (g.action === "key") {
							d = flashLocalStorage.key(g.index)
						} else {
							if (g.action === "clear") {
								d = flashLocalStorage.clear()
							}
						}
					}
				}
			}
			typeof g.callback === "function" && g.callback(d, g)
		}
	}, 1)
};
qike.localStorage.currDomain = location.protocol + "//" + location.hostname + (location.port && ":" + location.port) + "/";
qike.localStorage.commonAction = function(e) {
	var a = this,
		c, b, d;
	switch (e.action) {
	case "getItem":
		b = [e.key];
		break;
	case "setItem":
		b = [e.key, e.value];
		break;
	case "removeItem":
		b = [e.key];
		break;
	case "key":
		b = [e.index];
		break;
	case "clear":
		b = [];
		break
	}
	d = a.formatDomain(e.domain);
	if (a.isSupportLocalStorage) {
		if (d === a.currDomain) {
			c = localStorage[e.action].apply(localStorage, b);
			typeof e.callback === "function" && e.callback.call(window, c, e);
			return c
		} else {
			if (a[d] === undefined) {
				a[d] = {}
			}
			switch (a[d].isLoading) {
			case 1:
				a[d].actionArr.push(e);
				return;
			case 2:
				c = a[d].iframeLocalStorage[e.action].apply(a[d].iframeLocalStorage, b);
				typeof e.callback === "function" && e.callback.call(window, c, e);
				return c;
			default:
				//a.loadIframe(d, e);
				return
			}
		}
	}
	if (!a.isSupportLocalStorage) {
		if (a[d] === undefined) {
			a[d] = {}
		}
		switch (a[d].isLoading) {
		case 1:
			a[d].actionArr.push(e);
			return;
		case 2:
			c = a[d].swf[e.action].apply(a[d].swf, b);
			typeof e.callback === "function" && e.callback.call(window, c, e);
			return c;
		default:
			a.loadFlash(d, e);
			return
		}
	}
};
qike.localStorage.getItem = function(b, c, d) {
	var a = this;
	a.commonAction({
		action: "getItem",
		key: b,
		domain: c,
		callback: d
	})
};
qike.localStorage.setItem = function(b, d, c, e) {
	var a = this;
	a.commonAction({
		action: "setItem",
		key: b,
		value: d,
		domain: c,
		callback: e
	})
};
qike.localStorage.removeItem = function(b, c, d) {
	var a = this;
	a.commonAction({
		action: "removeItem",
		key: b,
		domain: c,
		callback: d
	})
};
qike.localStorage.key = function(b, c, d) {
	var a = this;
	a.commonAction({
		action: "key",
		index: b,
		domain: c,
		callback: d
	})
};
qike.localStorage.clear = function(b, c) {
	var a = this;
	a.commonAction({
		action: "clear",
		domain: b,
		callback: c
	})
};
qike.localStorage.formatDomain = function(b) {
	var a = this;
	if (!b) {
		b = a.currDomain
	}
	if (!b.match(/https?/)) {
		b = "http://" + b
	}
	if (!b.match(/\/$/)) {
		b = b + "/"
	}
	return b.toLowerCase()
};
(function() {
	var g = {},
		e = qike.utils.md5,
		c = qike.localStorage,
		f = qike.utils.subscribeModel;
	g.salt = "Played_Game";
	g.loginState_imgSrc_Pre = "http://stat.app.7k7k.com/played_game/r.gif";
	g.unloginState_imgSrc_Pre = "http://stat.app.7k7k.com/played_game/r0.gif";
	g.gameListUrl = "http://api.pg.7k7k.com/played_game/gameList";
	g.gameListByPageUrl = "http://api.pg.7k7k.com/played_game/gameListByPage";
	g.deletePlayedGameUrl = "http://api.pg.7k7k.com/played_game/deletePlayedGame";
	g.getLocalGames = function(q, h, p) {
		if (!q || q && q.length == 0) {
			return []
		}
		h = h ? h : null;
		var k = 0,
			j = q.length,
			m = 0,
			o = {},
			l = "get-local-games-finished-" + (new Date().getTime());
		f.subscribe(l, function() {
			if (m == j) {
				typeof p === "function" && p(o);
				f.unSubscribe(l)
			}
		});
		for (; k < j; k++) {
			var n = q[k];
			c.getItem(n, h, function(t, u) {
				var i;
				if (t) {
					i = t.split(",");
					var s = 0,
						r = i.length;
					for (; s < r; s++) {
						i[s] = i[s].split("|");
						i[s] = {
							gametype: i[s][0],
							gameid: i[s][1],
							gamename: i[s][2],
							played_time: i[s][3],
							gameurl: i[s][4],
							gamepic: i[s][5]
						}
					}
					o[u.key] = i;
					m++
				} else {
					o[u, n] = [];
					m++
				}
				f.fire(l)
			})
		}
	};
	g.addLocalGames = function(h, k, j) {
		if (!k || k.length == 0) {
			return
		}
		var k = k.slice(0);
		var i = this;
		i.getLocalGames([h], j, function(u) {
			var t = u[h];
			if (!t || t.length == 0) {
				t = k
			} else {
				var q = 0,
					o = k.length,
					v, r = [];
				for (; q < o; q++) {
					v = k[q];
					for (var p = 0, n = t.length; p < n; p++) {
						var s = t[p];
						if (s.gameid == v.gameid) {
							if (s.played_time < v.played_time) {
								t.splice(p, 1);
								t.unshift(v)
							}
							break
						}
						if (p == n - 1 && s.gameid != v.gameid) {
							t.unshift(v)
						}
					}
				}
			}
			for (var m = 0, l = t.length; m < l; m++) {
				var v = t[m];
				t[m] = [v.gametype, "|", v.gameid, "|", v.gamename, "|", v.played_time, "|", v.gameurl, "|", v.gamepic].join("")
			}
			t = t.join(",");
			c.setItem(h, t, j)
		})
	};
	g.deleteLocalGames = function(h, i, k) {
		if (!i || i.length == 0) {
			return
		}
		var i = i.slice(0);
		var j = this;
		j.getLocalGames([h], k, function(v) {
			var u = v[h];
			if (!u || u.length == 0) {
				return
			}
			var r = 0,
				p = i.length,
				l, s = [];
			for (; r < p; r++) {
				l = i[r];
				for (var q = 0, o = u.length; q < o; q++) {
					var t = u[q];
					if (t.gameid == l) {
						u.splice(q, 1);
						break
					}
					if (u.length == 0) {
						return
					}
				}
			}
			for (var n = 0, m = u.length; n < m; n++) {
				var w = u[n];
				u[n] = [w.gametype, "|", w.gameid, "|", w.gamename, "|", w.played_time, "|", w.gameurl, "|", w.gamepic].join("")
			}
			u = u.join(",");
			c.setItem(h, u, k)
		})
	};
	g.emptyLocalGames = function(q, h, p) {
		if (q && q.length == 0) {
			return
		}
		var n = this,
			j = 0,
			m = q.length,
			l = 0,
			k = "empty-local-games-finished-" + (new Date().getTime());
		f.subscribe(k, function() {
			if (l == m) {
				typeof p === "function" && p();
				f.unSubscribe(k)
			}
		});
		for (; j < m; j++) {
			var o = q[j];
			c.removeItem(o, h, function() {
				l++;
				f.fire(k)
			})
		}
	};
	g.getServerGames = function(j, i, l) {
		if (!j || !i || j.length == 0) {
			return
		}
		var k = {},
			h = this.gameListUrl;
		k.uid = i;
		k.ts = ("" + new Date().getTime()).substr(0, 10);
		k.t = e(i + "," + this.salt + "," + k.ts);
		k.game_type = j.join();
		$.ajax({
			url: h,
			type: "GET",
			dataType: "jsonp",
			data: k,
			success: function(m) {
				typeof l === "function" && l(m)
			}
		})
	};
	g.getServerGamesByPage = function(j, l, i, m) {
		if (!l || !i || !j) {
			return
		}
		var k = {},
			h = this.gameListByPageUrl;
		k.ts = ("" + new Date().getTime()).substr(0, 10);
		k.t = e(j + "," + this.salt + "," + k.ts);
		k.page = l;
		k.pagesize = i;
		$.ajax({
			url: h,
			type: "GET",
			dataType: "jsonp",
			data: k,
			success: function(n) {
				typeof m === "function" && m(n)
			}
		})
	};
	g.addServerGames = function(l, n) {
		if (!n || n.length == 0) {
			return
		}
		var n = n.slice(0);
		if (n.length == 1) {
			var j = new Image(),
				m;
			if (l) {
				m = this.loginState_imgSrc_Pre + "?uid=" + l + "&game_type=" + n[0].gametype + "&gameid=" + n[0].gameid + "&played_time=" + ("" + new Date().getTime()).substr(0, 10)
			} else {
				m = this.unloginState_imgSrc_Pre + "?game_type=" + n[0].gametype + "&gameid=" + n[0].gameid + "&played_time=" + ("" + new Date().getTime()).substr(0, 10)
			}
			j.src = m
		} else {
			if (n.length > 1) {
				if (!l) {
					return
				}
				var j = new Image(),
					m;
				for (var k = 0, h = n.length; k < h; k++) {
					n[k] = [n[k].gametype, "|", n[k].gameid, "|", ("" + new Date().getTime()).substr(0, 10)].join("")
				}
				m = this.loginState_imgSrc_Pre + "?uid=" + l + "&games=" + n.join(",");
				j.src = m
			}
		}
	};
	g.deleteServerGames = function(j, k, h, m) {
		if (!k || !h) {
			return
		}
		var l = {},
			i = this.deletePlayedGameUrl;
		l.ts = ("" + new Date().getTime()).substr(0, 10);
		l.t = e(j + "," + this.salt + "," + l.ts);
		l.game_type = k;
		l.game_id = h;
		$.ajax({
			url: i,
			type: "GET",
			dataType: "jsonp",
			data: l,
			success: function(n) {
				typeof m === "function" && m(n)
			}
		})
	};
	g.sortGamesByPlayedTime = function(h) {
		if (!h || h.length == 0) {
			return []
		}
		h.sort(a);
		return h
	};

	function a(i, h) {
		return (parseInt(h.played_time) - parseInt(i.played_time))
	}
	g.mergeGames = function(r) {
		if (!r || r.length == 0) {
			return []
		}
		var m = [];
		for (var n = 0, j = r.length; n < j; n++) {
			if (!r[n] || r[n].length == 0) {
				continue
			}
			m.push(r[n].slice(0))
		}
		var o = 0,
			h = m.length,
			q = m[0] || [],
			p;
		for (; o < h - 1; o++) {
			p = m[o + 1];
			q = d(q, p)
		}
		if (q && q.length) {
			return q
		} else {
			return []
		}
	};

	function b(h) {
		var i = this;
		$.extend(true, i, h);
		i.init()
	}
	b.prototype = {
		localStorageType: ["unlogin_playedgames_small", "unlogin_playedgames_web", "unlogin_playedgames_child", "unlogin_playedgames_community", "prev_user_playedgames_small", "prev_user_playedgames_web", "prev_user_playedgames_child", "prev_user_playedgames_community"],
		localStorageTypeNums: 4,
		localStorageDomain: "http://www.7k7k.com/",
		init: function() {
			var h = this;
			h.playedGame = qike.playedgame.PlayedGame;
			h.updateRecord()
		},
		updateRecord: function() {
			var i = this,
				l = i.playedGame,
				k = [{
					gametype: i.game_type,
					gameid: i.game_id,
					gamename: i.game_name,
					played_time: i.game_time,
					gameurl: i.game_href,
					gamepic: i.game_src
				}],
				j = i.loginState ? ((i.localStorageTypeNums - 1) + i.game_type) : (i.game_type - 1),
				h = i.localStorageType[j];
			l.addLocalGames(h, k, i.localStorageDomain);
			l.addServerGames(i.uid, k)
		},
		loginStateChange: function(h) {
			var i = this;
			if (h) {
				i.uid = h;
				i.loginState = 1
			} else {
				i.uid = null;
				i.loginState = 0
			}
			this.updateRecord()
		}
	};

	function d(o, n) {
		if (!(o && n) || (o.length == 0 && n.length == 0)) {
			return []
		}
		if (o.length == 0 && n.length > 0) {
			return n
		}
		if (n.length == 0 && o.length > 0) {
			return o
		}
		var m = 0,
			l = o.length;
		for (; m < l; m++) {
			var q = o[m],
				k = 0,
				h = n.length;
			for (; k < h; k++) {
				var p = n[k];
				if (q.gameid == p.gameid) {
					if (q.played_time > p.played_time) {
						n.splice(k, 1);
						n.unshift(q)
					}
					break
				}
				if (k == h - 1 && q.gameid != p.gameid) {
					n.unshift(q)
				}
			}
		}
		return n
	}
	g.GameLog = b;
	window.qike = window.qike || {};
	window.qike.playedgame = qike.playedgame || {};
	window.qike.playedgame.PlayedGame = g
})();
(function(a, b, c) {
	b.fn.lazyload = function(d) {
		var e = {
			threshold: 0,
			failurelimit: 3,
			event: "scroll",
			effect: "show",
			container: a
		};
		if (d) {
			b.extend(e, d)
		}
		var f = this;
		if ("scroll" == e.event) {
			b(e.container).bind("scroll resize", function(i) {
				var g = 0,
					h = arguments.callee;
				f.each(function() {
					if (b.abovethetop(this, e) || b.leftofbegin(this, e)) {} else {
						if (!b.belowthefold(this, e) && !b.rightoffold(this, e)) {
							b(this).trigger("appear")
						} else {
							if (g++ > e.failurelimit) {
								return false
							}
						}
					}
				});
				if (!f.length) {
					b(e.container).unbind("scroll resize", h)
				}
			})
		}
		this.each(function() {
			var g = this;
			g.loaded = false;
			b(g).one("appear", function() {
				if (!this.loaded) {
					b(g).find("[lz_src]").each(function() {
						var i = b(this),
							j = i.attr("lz_src");
						i.attr("src", j)
					});
					g.loaded = true
				}
				var h = b.grep(f, function(i) {
					return !i.loaded
				});
				f = b(h)
			});
			if ("scroll" != e.event) {
				b(g).bind(e.event, function(h) {
					if (!g.loaded) {
						b(g).trigger("appear")
					}
				})
			}
		});
		b(e.container).trigger(e.event);
		return this
	};
	b.belowthefold = function(e, f) {
		if (f.container === c || f.container === a) {
			var d = b(a).height() + b(a).scrollTop()
		} else {
			var d = b(f.container).offset().top + b(f.container).height()
		}
		return d <= b(e).offset().top - f.threshold
	};
	b.rightoffold = function(e, f) {
		if (f.container === c || f.container === a) {
			var d = b(a).width() + b(a).scrollLeft()
		} else {
			var d = b(f.container).offset().left + b(f.container).width()
		}
		return d <= b(e).offset().left - f.threshold
	};
	b.abovethetop = function(e, f) {
		if (f.container === c || f.container === a) {
			var d = b(a).scrollTop()
		} else {
			var d = b(f.container).offset().top
		}
		return d >= b(e).offset().top + f.threshold + b(e).height()
	};
	b.leftofbegin = function(e, f) {
		if (f.container === c || f.container === a) {
			var d = b(a).scrollLeft()
		} else {
			var d = b(f.container).offset().left
		}
		return d >= b(e).offset().left + f.threshold + b(e).width()
	};
	b(".lazyload-part").lazyload({
		threshold: 100
	});
	b(".lazyload-part-r").lazyload({
		threshold: 100
	})
})(window, jQuery);