function txWebUpdate(p, o, q, m, c, d, l, e, g){
	/*
	p:{type:type,  text:text,  userid:in_reply_to_user_id,  replyid:in_reply_to_status_id,  lawless:1 or ''},
	o:function,
	q:msuccess(),
	m:noLogin(),
	c:repeat(),
	d:exception(),
	l:lawless(),
	e:audit(data.count),
	g:error(str)
	*/
	if ($.isFunction(o)) {
		o()
	}
	var b = p ? p : {}, i = b.type || 1, k = b.text || "", j = (b.userid != undefined ?b.userid:""), h = (b.replyid != undefined ?b.replyid:""), a = (b.cookieid != undefined ?b.cookieid:""), n;
	if (b.lawless == 1) {
		n = -2
	}
	else {
		n = 0
	}
	var f = "/status/ajax/addLekuData.php";
	if (k == "") {
		ye_msg.open("\u8bf7\u8f93\u5165\u5185\u5bb9\uff01", 1, 2);
		return
	}
	$.ajax({
		url: f,
		cache: false,
		dataType: "json",
		data: {
			type: i,
			text: k,
			in_reply_to_user_id: j,
			in_reply_to_status_id: h,
			cookieId: a,
			id: n
		},
		success: function(s){
			switch (s.result) {
				case "noLogin":
				ye_msg.open("\u8bf7\u5148\u767b\u5f55\uff01", 1, 2);
				if ($.isFunction(m)) {
					m()
				}
				break;
				case "success":
				case "msuccess":
				if ($.isFunction(q)) {
					q()
				}
				break;
				case "repeat":
				if ($.isFunction(c)) {
					c()
				}
				break;
				case "lawless":
				if ($.isFunction(l)) {
					l()
				}
				break;
				case "audit":
				if ($.isFunction(e)) {
					e(s.count)
				}
				break;
				case "exception":
				if ($.isFunction(d)) {
					d()
				}
				break;
				case "error":
				var r = "";
				switch (s.code) {
					case -4:
					r = '<p>\u4e0d\u597d\u610f\u601d\uff0c\u7531\u4e8e\u60a8\u6b64\u524d\u53d1\u9001\u7684\u4fe1\u606f\u6709\u53ef\u80fd\u4f1a\u5f71\u54cd\u5176\u5b83\u670b\u53cb\u6b63\u5e38\u4f7f\u7528\u7f51\u7ad9\uff0c\u6240\u4ee5\u4f60\u88ab\u6682\u65f6\u7981\u8a00\u4e86\u3002</p><p>\u5982\u6709\u7591\u95ee\u8bf7\u4e0e\u6211\u4eec\u7684\u5ba2\u670d\u8054\u7cfb\uff1a<a href="mailto:tongxue2009@gmail.com">tongxue2009@gmail.com</a></p>';
					break
				}
				if ($.isFunction(g)) {
					g(r)
				}
				break;
				case "fail":
				default:
				if ($.isFunction(m)) {
					m()
				}
				break
			}
		},
		type: "POST",
		error: function(r, v, t){
			if ($.isFunction(m)) {
				m()
			}
			try {
				setCookie("diguPostErr", "textStatus:" + v + "-ErrorThrown:" + t + "-status:" + r.status + "-statusText:" + r.statusText + "-rText:" + s(r.responseText))
			}
			catch (u) {
			}
			function s(w){
				if (/<title>(.*)<\/title>/i.test(w)) {
					var x = RegExp.$1;
					return x
				}
				return ""
			}
		},
		timeout: 20000
	})
}
//此方法被用于通过回复框发站内信。
function sendMessageData(b, c){
    var a = "/k/inbox/ajax/inbox_ajax.php?aid=sendMessage";
    $.ajaxSetup({
        cache: false
    });
    $.getJSON(a, {
        receiveUid: b,
        updateTextarea: c
    }, function(d){
        if (d.result == "success") {
            ye_msg.open("\u53d1\u9001\u6210\u529f\uff01", 1, 1);
			/**
			*删除跳转。
			*/
            //window.setTimeout("window.location.href='/k/inbox/index.php?aid=sendbox'", 1000)
			ye_dialog.close()
        }
        else {
            if (d.result == "fail") {
                ye_msg.open("\u53d1\u9001\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2)
            }
            else {
                if (d.result == "noLogin") {
                    ye_msg.open("\u5bf9\u4e0d\u8d77\uff0c\u4f60\u5df2\u5904\u4e8e\u672a\u767b\u5f55\u72b6\u6001\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\uff01", 1, 2);
                    window.setTimeout(window.location = "/k/inbox/index.php?aid=login&backActionId=inbox", 1000)
                }
                else {
                    ye_msg.open("\u53d1\u9001\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2)
                }
            }
        }
    })
}

function showRediMsgForm(b){//(b:{twId:tid, userName:nickname})
	if (txweb.user.isLogin == false) {
		window.location.href = txweb.user.loginURL;
		return false
	}
	var a = b.twId;
	var c = b.userName;
	ye_dialog.openUrl("/status/ajax/replyDialog2.php?tid=" + a + "&nickname=" + encodeURI(c));
	return false
}
function showReportMsgForm(b,u){//举报
	if (txweb.user.isLogin == false) {
		window.location.href = txweb.user.loginURL;
		return false
	}
	ye_dialog.openUrl("/status/ajax/report.php?user_id=" + b + "&url=" + u);
	return false

}
function showVideoMsgForm(){//首页贴视频按钮
	if (txweb.user.isLogin == false) {
		window.location.href = txweb.user.loginURL;
		return false
	}
	ye_dialog.openUrl("/status/ajax/k/show_video.php");
	return false

}

function showVideoMsgFromForScreen(screen_id){
	if (txweb.user.isLogin == false) {
		window.location.href = txweb.user.loginURL;
		return false
	}
	ye_dialog.openUrl("/status/ajax/k/show_video.php?screen_id="+screen_id);
	return false
}
function delStatus(d, a, c){//(d:status_id,a:the li for container of this, c:type)
	if (window.confirm("\u786e\u5b9a\u5220\u9664\u8fd9\u6761\u6d88\u606f\uff1f")) {
		if (!d) {
			return false
		}
		if (!c) {
			c = 1
		}
		ye_msg_2.open("\u5220\u9664\u4e2d\uff0c\u8bf7\u7a0d\u5019", 60, 2);
		var b = "/status/ajax/delLekuData.php";
		$.getJSON(b, {
			status_id: d,
			type: c
		}, function(e){
			switch (e.result) {
				case "success":
				ye_msg.open("\u5220\u9664\u6210\u529f\uff01", 1, 1);
				ye_msg_2.closer(1);
				$("#updateCounter").text(parseInt($("#updateCounter").text()) - 1);
				if (a) {
					a.css("background-color", "#FFC").fadeOut(500, function(){
						$(this).remove()
					})
				}
				break;
				case "updateSuccess":
				ye_msg.open("\u8be5\u6d88\u606f\u4e0d\u4f1a\u51fa\u73b0\u5728\u516c\u5171\u533a\u4e86\uff01", 1, 1);
				ye_msg_2.closer(1);
				if (a) {
					a.css("background-color", "#FFC").fadeOut(500, function(){
						$(this).remove()
					})
				}
				break;
				case "noLogin":
				ye_msg.open("\u8bf7\u5148\u767b\u5f55\uff01", 1, 2);
				ye_msg_2.closer(1);
				break;
				case "fail":
				default:
				ye_msg.open("\u5220\u9664\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2);
				ye_msg_2.closer(1);
				break
			}
		})
	}
	return false
}

var favoriteStatus = {
	process: function(a, b){//(a:id of btn,b:status_id)
		if (txweb.user.isLogin == false) {
			window.location.href = txweb.user.loginURL;
			return false
		}
		if (!b/*||isNaN(b)*/) {
			//ye_msg.open("\u53d1\u751f\u9519\u8bef\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5", 1, 2);
			return false
		}
		if (a == null || a == "") {
			this.btn = null
		}
		else {
			this.btn = a
		}
		this.id = b;
		if ($("#" + this.btn).html() != "\u8f6c\u53d1") {
			ye_msg_2.open("\u53d6\u6d88\u4e2d\uff0c\u8bf7\u7a0d\u5019", 60, 2);
			this.destroyFavorite()
		}
		else {//转发
			ye_msg_2.open("\u8f6c\u53d1\u4e2d\uff0c\u8bf7\u7a0d\u5019", 60, 2);
			this.createFavorite()
		}
		return false
	},
	createFavorite: function(){
		var b = this;
		var a = "/favorite/addFavoriteData.php?status_id=" + this.id;
		$.getJSON(a, {
			tId: this.id
		}, function(c){
			switch (c.result) {
				case "noLogin":
				window.location = "/login.php?aid=login&backActionId=lekuRecent" + b.id;
				break;
				case "success":
				if (b.btn != null) {
					var btn = $("#" + b.btn);
					btn.attr("title", "\u70b9\u51fb\u53d6\u6d88\u8f6c\u53d1");
					btn.html('\u53d6\u6d88\u8f6c\u53d1');
				}
				if ((typeof timeline) == "object" /*&& timeline.currentPage == 1*/) {
					timeline.update('repear');//repear 当转发的时使用该参数
				}else{
					ye_msg.open('\u8f6c\u53d1\u6210\u529f\uff01', 1, 1);
					ye_msg_2.closer(1);
				}
				break;
				case "fail":
				default:
				ye_msg.open('\u8f6c\u53d1\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u65b0\u64cd\u4f5c\uff01', 1, 2);
				ye_msg_2.closer(1);
				break
			}
		})/*ye_dialog.openUrl("/space_v1/addfav.jsp?tId="+this.id+"&btn="+this.btn,300,150,"\u8f6c\u53d1")*/
	},
	destroyFavorite: function(){
		var b = this;
		var a = "/favorite/delFavoriteData.php";
		$.getJSON(a, {
			tId: this.id
		}, function(c){
			switch (c.result) {
				case "noLogin":
				window.location = "/login.php?aid=login&backActionId=detail%26twId%3D" + b.id;
				break;
				case "success":
				ye_msg.open("\u53d6\u6d88\u8f6c\u53d1\u6210\u529f\uff01", 1, 1);
				ye_msg_2.closer(1);
				if (b.btn != null) {
					$("#" + b.btn).attr("title", "\u8f6c\u53d1\u6b64\u6d88\u606f");
					$("#" + b.btn).html("\u8f6c\u53d1")
				}
				
				break;
				case "fail":
				default:
				ye_msg.open("\u53d6\u6d88\u8f6c\u53d1\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2);
				ye_msg_2.closer(1);
				break
			}
		})
	}
};
function chkAllNewMsg(d, e){//(d:htmlElement for message,e:htmlElement for replies)
	if (!d && !e) {
		return
	}
	var a = $("#replyShortcut");
	var c = 0;
	function b(){
		$.ajaxSetup({
			cache: false
		});
		$.getJSON("/k/ajax/getSysMsgData.php", function(g){
			if (g.message > 0) {
				$("#" + d).html(g.message)
			}
			if (g.replies > 0) {
				$("#" + e).html(g.replies);
				if (!a.timerHandle) {
					f()
				}
			}
			if (g.notice > 0) {
				$("#noticeCount").html(g.notice)
			}
		})
	}
	function f(){
		if (c == 0) {
			a.css("background-image", "none")
		}
		else {
			a.css("background-image", "url(http://site.tongxueimg.com/v4/k/images/ico_side.png)")
		}
		c = c == 0 ? 1 : 0;
		a.timerHandle = window.setTimeout(f, 300)
	}
	b();
	window.setInterval(b, 60000)
}

function createGroup(a){//(a:userId)
	if (txweb.user.isLogin == false) {
		ye_msg.open("\u8bf7\u5148\u767b\u5f55\uff01", 1, 2);
		return false
	}
	if (!a || isNaN(a)) {
		ye_msg.open("\u53d1\u751f\u9519\u8bef\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5", 1, 2);
		return false
	}
	ye_dialog.openUrl("/focus_group/addGroupUser_v2.jsp?userId=" + a, 475, 240, "\u5173\u6ce8\u6210\u529f\uff01")
}

function delGroupUser(c, b){//(c:userId, b:groupId)
	var d = this;
	var a = "/focus_group/delFollowerToGroup_ajax.jsp";
	$.getJSON(a, {
		userId: c,
		groupId: b
	}, function(e){
		switch (e.result) {
			case "noLogin":
			window.location = "/login.php?aid=login";
			break;
			case "success":
			ye_msg.open("\u5df2\u7ecf\u79fb\u51fa\u8be5\u5206\u7ec4\uff01", 1, 1);
			if ($("#tips" + c).length > 0) {
				$("#tips" + c).hide()
			}
			else {
				parent.location.reload()
			}
			break;
			case "fail":
			default:
			ye_msg.open("\u79fb\u9664\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2);
			break
		}
	})
}

function showReplyMsgForm(a){//(a:{twId:,userId:,userName:})
	if (txweb.user.isLogin == false) {
		window.location.href = txweb.user.loginURL;
		return false
	}
	
	return replyDialog.open(a.twId, a.userId, a.userName)
}

var replyDialog = function(){
	var h = '<table id="replyFaceTable" cellspacing="0" cellpadding="0" class="replyFaceTable"><tbody><tr><td><img src="http://site.tongxueimg.com/v4/k/emotion/24.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/01.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/02.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/03.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/04.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/05.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/06.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/07.gif" alt=""/></td></tr><tr><td><img src="http://site.tongxueimg.com/v4/k/emotion/09.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/10.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/11.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/12.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/13.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/14.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/15.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/16.gif" alt=""/></td></tr><tr><td><img src="http://site.tongxueimg.com/v4/k/emotion/18.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/19.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/20.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/21.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/22.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/23.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/08.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/17.gif" alt=""/></td></tr><tr><td><img src="http://site.tongxueimg.com/v4/k/emotion/25.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/26.gif" alt=""/></td><td><img src="http://site.tongxueimg.com/v4/k/emotion/27.gif" alt=""/></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>';
	var b = '<div class="replyDialog"><div id="replyFaceDiv" style="display:none"></div><div class="toolbar"><div class="replyMeta"><span id="replyInputCount" class="conTinge">\u8fd8\u53ef\u4ee5\u8f93\u5165140\u5b57</span></div></div><div class="replyForm"><form id="replyDialogForm" method="post"><textarea id="replyTextarea" class="uTextarea"></textarea><span style="float: left;"><input type="checkbox" id="sendInbox" style="vertical-align:middle; margin-right:3px"/>\u6084\u6084\u8bdd\uff08\u52fe\u9009\u5373\u4e3a\u79c1\u4fe1\u53d1\u9001\uff0c\u53ea\u80fd\u53d1\u7ed9\u5173\u6ce8\u81ea\u5df1\u7684\u4eba\uff09</span><button id="replySubmit" class="btn w3" type="submit" title="ctrl+enter">\u53d1\u9001</button></form></div></div>';
	var b2 = '<div class="replyDialog"><div id="replyFaceDiv" style="display:none"></div><div class="toolbar"><div class="replyMeta"><span id="replyInputCount" class="conTinge">\u8fd8\u53ef\u4ee5\u8f93\u5165140\u5b57</span></div></div><div class="replyForm"><form id="replyDialogForm" method="post"><textarea id="replyTextarea" class="uTextarea"></textarea><button id="replySubmit" class="btn w3" type="submit" title="ctrl+enter">\u53d1\u9001</button></form></div></div>';

	var l, m, a;
	var e, j;
	var k = 0;
	function f(){
		var n = $("#replySubmit");
		var u = j.val();
		var q = 2;
		var si = $("#sendInbox");
		if (n.attr("disabled") == true) {
			return false
		}
		if (u == "") {
			ye_msg.open("\u8bf7\u8f93\u5165\u5185\u5bb9\uff01", 1, 2);
			o();
			return false
		}
		if(si.attr('checked')==true){
			sendMessageData(m,u);
			return false			
		}
		txWebUpdate({
			type: q,
			text: u,
			userid: m,
			replyid: l,
			cookieid: txweb.user.id,
			lawless: k
		}, w, t, r, y, s, v, z, p);
		function t(){
			ye_msg.open("\u53d1\u9001\u6210\u529f\uff01", 1, 1);
			$("#lastUpdate").html('<strong class="tips3">\u4e0a\u6b21\u66f4\u65b0 (\u521a\u521a)\uff1a</strong>' + i(u).substring(0, 18));
			o();
			x();
			k = 0
		}
		function p(A){
			var B = '<div style="text-align:left;font-size:14px;padding:15px;">' + A + "</div>";
			ye_dialog.openHtml(B, "@" + txweb.user.name, 420, 130);
			o()
		}
		function v(){
			var A = $(".replyForm .msgBox");
			if (A.length > 0) {
				A.show()
			}
			else {
				A = $('<div class="msgBox"><strong>\u4e0d\u8981\u53d1\u5e03\u653f\u6cbb\u3001\u53cd\u52a8\u3001\u53cd\u793e\u4f1a\u8a00\u8bba\uff0c\u8bf7\u91cd\u65b0\u4fee\u6539\u4f60\u7684\u5185\u5bb9\u3002</strong><br/>(\u6076\u610f\u53d1\u9001\u5c06\u4f1a\u7981\u8a00\uff0c\u5220\u9664\u5e10\u53f7)</div>');
				A.append($('<span class="msgBoxCloseBtn"></span>').click(function(){
					A.hide()
				}));
				$(".replyForm").append(A)
			}
			k = 1;
			o()
		}
		function z(A){
			if (isNaN(A)) {
				A = 0
			}
			if (A > 0) {
				$("#tkyou").html("\u4f60\u521a\u521a\u53d1\u7684" + A + "\u4e2a\u65b0\u6d88\u606f\u6b63\u5728\u8fdb\u884c\u654f\u611f\u5185\u5bb9\u5ba1\u6838\uff0c\u5ba1\u6838\u901a\u8fc7\u540e\u5c31\u4f1a\u53d1\u51fa\uff0c\u8bf7\u7a0d\u7b49\u3002");
				$("#tkyou").show()
			}
			k = 0;
			o();
			x()
		}
		function r(){
			ye_msg.open("\u53d1\u9001\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\uff01", 1, 2);
			o()
		}
		function y(){
			ye_msg.open("\u62b1\u6b49\uff0c\u8bf7\u4e0d\u8981\u8fde\u7eed\u53d1\u9001\u91cd\u590d\u7684\u5185\u5bb9\uff01", 1, 4);
			o()
		}
		function s(){
			ye_msg.open("\u7f51\u7edc\u5f02\u5e38\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5\uff01", 1, 4);
			o();
			x()
		}
		function o(){
			n.attr("disabled", false).removeClass("posting").html("\u53d1\u9001!")
		}
		function w(){
			n.attr("disabled", true).addClass("posting").html("")
		}
		function x(){
			if ((typeof timeline) == "object" && timeline.currentPage == 1) {
				timeline.update()
			}
			ye_dialog.close()
		}
		return false
	}
	function i(o){
		if (o) {
			var n = /(\[:\d*\]){1}/g;
			o = o.replace(n, "")
		}
		return o
	}
	function d(){
		j.focus();
		if ($("#replyFaceTable").length < 1) {
			e.html(h);
			var o = $("#replyFaceTable").find("td");
			var n = $("#replyFaceTable").find("img");
			o.hover(function(){
				$(this).css("background-color", "#EEE")
			}, function(){
				$(this).css("background-color", "#FFF")
			});
			n.click(function(){
				j.focus();
				var p;
				var r = "";
				var q = $(this).attr("src");
				p = /\/(\d+).gif/.exec(q);
				if (p && p.length > 0) {
					r = "[:" + p[1] + "]"
				}
				j.focus().val(j.val() + r)
			})
		}
		if (e.css("display") == "none") {
			c(420, 354);
			e.show()
		}
		else {
			c(420, 163);
			e.hide()
		}
	}
	function c(n, o){
		ye_dialog.resize(n, o)
	}
	function g(n){
		if (n.ctrlKey && n.keyCode == 13) {
			f()
		}
		window.setTimeout(function(){
			var o = j.val().length;
			if (o > 140) {
				$("#replyInputCount").css("color", "#f00").html("\u5df2\u8d85\u51fa" + (o - 140) + "\u5b57")
			}
			else {
				$("#replyInputCount").css("color", "#999").html("\u8fd8\u53ef\u4ee5\u8f93\u5165" + (140 - o) + "\u5b57")
			}
		}, 0)
	}
	return {
		open: function(p, n, o){
			if (!n || !o) {
				return false
			}
			if (!p) {
				p = 0
			}
			//是否显示悄悄话
			
			l = p;
			m = n;
			a = unescape(o);
			len2 = 140 - a.length - 2;
			//b2 = '<div class="replyDialog"><div id="replyFaceDiv" style="display:none"></div><div class="toolbar"><div class="replyMeta"><span id="replyInputCount" class="conTinge">\u8fd8\u53ef\u4ee5\u8f93\u5165' + len2 + '\u5b57</span></div></div><div class="replyForm"><form id="replyDialogForm" method="post"><textarea id="replyTextarea" class="uTextarea">@' + a + ' </textarea><button id="replySubmit" class="btn w3" type="submit" title="ctrl+enter">\u53d1\u9001</button></form></div></div>';
			//是否显示悄悄话选项
			if(n){
				$.get("/status/ajax/k/is_follower.php?id="+n, function(data){ 
					if(data==0){
						ye_dialog.openHtml(b2, "@" + a, 420, 163, function(){
							e = $("#replyFaceDiv");
							j = $("#replyTextarea");
							$("#replyfaceBtn").click(d);
							j.keydown(g).focus();
							$("#replyDialogForm").submit(f)
						})
					}else if(data==1){
						ye_dialog.openHtml(b, "@" + a, 420, 163, function(){
							e = $("#replyFaceDiv");
							j = $("#replyTextarea");
							$("#replyfaceBtn").click(d);
							j.keydown(g).focus();
							$("#replyDialogForm").submit(f)
						})
					}
				});

			}
			;
			return false
		}
	}
}();
var clickmePopVisible;
function clickme(i, a){
	if (!a) {
		return false
	}
	var i = i || window.event;
	if (i.stopPropagation) {
		i.stopPropagation()
	}
	i.cancelBubble = true;
	var b;
	var c = 20;
	var f = 1;
	var j = 30;
	var g;
	var d = false;
	if (document.getElementById("clickmepop" + a) == null) {
		$("body").append('<div class="clickmepop" id="clickmepop' + a + '"></div>')
	}
	b = $("#clickmepop" + a);
	k();
	function k(){
		var e = $("#clickme" + a).offset();
		b.css({
			left: e.left - 194,
			top: e.top - 88
		})
	}
	$(document).unbind("click", h);
	if (b.css("display") == "none") {
		if (clickmePopVisible) {
			clickmePopVisible.hide()
		}
		clickmePopVisible = b;
		b.html("").show();
		g = function(){
			b.css("background-position", "0 -" + (f * 110) + "px");
			f++;
			if (f < c) {
				window.setTimeout(function(){
					g()
				}, j)
			}
			else {
				b.html('<a onclick="return shareDiguDialog(' + a + ')" href="#" class="share">\u5206\u4eab</a><a onclick="return showRediMsgForm({userName:\'\',twId:' + a + '});" href="#" class="redi">\u8f6c\u8f7d</a><a href="/login.php?aid=hall_3&from=clickme" class="interestingP">\u6709\u8da3\u6d88\u606f</a><a href="/login.php?aid=hall_interest&from=clickme" class="interestingD">\u6709\u8da3\u5154\u53cb</a><a onclick="return commendFriends(' + a + ')" href="#" class="commend">\u63a8\u8350</a><a onclick="return openReport(' + a + ')" href="#" class="report">\u4e3e\u62a5</a><a href="/login.php?aid=infriends&from=clickme" class="inviteF">\u9080\u8bf7</a>');
				$(document).bind("click", h)
			}
		}
	}
	else {
		g = function(){
			b.html("");
			clickmePopVisible = null;
			f = --c;
			b.css("background-position", "0 -" + (f * 110) + "px");
			if (f == 0) {
				b.hide()
			}
			if (f > 0) {
				window.setTimeout(function(){
					g()
				}, j)
			}
		}
	}
	function h(){
		if (clickmePopVisible) {
			clickmePopVisible.hide();
			clickmePopVisible = null
		}
		$(document).unbind("click", h)
	}
	g();
	return false
}

function shareDiguDialog(b){
	var a = '<div style="padding:0 0 10px 10px;text-align:left;font-size:14px;">\u4e0b\u9762\u662f\u8fd9\u6761\u6d88\u606f\u7684\u94fe\u63a5\u5730\u5740\uff0c\u590d\u5236\u4e0b\u6765\uff0c\u7528QQ\u6216MSN\u53d1\u7ed9\u670b\u53cb\u4eec\u5427\uff1a<br/><textarea id="shareDiguContent" onclick="$(this).select()" style="width:440px;height:50px;border:1px solid #999;">http://tongxue.com/login.php?aid=detail&twId=' + b + '</textarea></div><div><button class="btn w4" onclick="copyText($(\'#shareDiguContent\').val())">\u590d\u5236\u94fe\u63a5</button> <button class="btn w2" onclick="ye_dialog.close()">\u53d6\u6d88</button></div>';
	ye_dialog.openHtml(a, "\u5206\u4eab", 460, 132);
	$("#shareDiguContent").select();
	return false
}

function commendFriends(b){
	var a = '<div style="padding:10px;text-align:left;">\u63a8\u8350\uff1a<input type="radio" name="commendDigu" value="1" checked="checked" />\u6709\u8da3\u5154\u53cb <input type="radio" name="commendDigu" value="2" />\u6709\u8da3\u5600\u53cb</div><div style="padding:10px;text-align:left;">\u7406\u7531(\u5fc5\u586b)\uff1a<input class="txt" type="text" id="commendReason" value="" /></div><div><button class="btn w2" onclick="addcommendFriendData(' + b + ')">\u63d0\u4ea4</button> <button class="btn w2" onclick="ye_dialog.close()">\u53d6\u6d88</button></div>';
	ye_dialog.openHtml(a, "\u5411\u5927\u5bb6\u63a8\u8350\u6709\u8da3\u7684\u6d88\u606f/\u5154\u53cb", 310, 150);
	return false
}

function openReport(b){
	var a = '<div style="padding:10px;text-align:left;"><span style="float:left;display:block;height:40px;">\u4e3e\u62a5\u539f\u56e0\uff1a</span><input type="checkbox" name="reportOption" value="0" style="padding-left:5px;" /> \u9a9a\u6270\u8bc8\u9a97 <input type="checkbox" name="reportOption" value="1" style="padding-left:5px;" /> \u8272\u60c5\u5185\u5bb9 <input type="checkbox" name="reportOption" value="2" style="padding-left:5px;" /> \u53cd\u52a8\u8a00\u8bba<br /><input type="checkbox" name="reportOption" value="3" style="padding-left:5px;" /> \u5f20\u8d34\u5e7f\u544a <input type="checkbox" name="reportOption" value="4" style="padding-left:5px;" /> \u5176\u5b83\u95ee\u9898</div><div style="padding:0 10px 10px;text-align:left;">\u9644\u52a0\u8bf4\u660e\uff1a<textarea id="addReport" class="txt" style="height:40px;color:#999;" onclick="if(this.value==\'\u60a8\u53ef\u4ee5\u8be6\u7ec6\u63cf\u8ff0\u6076\u610f\u884c\u4e3a(\u5982\u5bf9\u65b9\u53d1\u9001\u56fe\u7247\u4e2d\u7684\u4e0d\u826f\u4fe1\u606f)\'){this.value=\'\';this.style.color=\'#000\'}">\u60a8\u53ef\u4ee5\u8be6\u7ec6\u63cf\u8ff0\u6076\u610f\u884c\u4e3a(\u5982\u5bf9\u65b9\u53d1\u9001\u56fe\u7247\u4e2d\u7684\u4e0d\u826f\u4fe1\u606f)</textarea></div><div><button class="btn w2" onclick="addReportData(' + b + ')">\u63d0\u4ea4</button> <button class="btn w2" onclick="ye_dialog.close()">\u53d6\u6d88</button></div>';
	ye_dialog.openHtml(a, "\u4e3e\u62a5\u6076\u610f\u6d88\u606f", 340, 190);
	return false
}

function addcommendFriendData(d){
	var a = "/ajaxData/commendFriendData.jsp";
	var b = $("#commendReason").val() || "";
	var c = $("input[type='radio']:checked").val() || "";
	b = trim(b);
	if (b == "") {
		ye_msg.open("\u8bf7\u586b\u5199\u63a8\u8350\u7406\u7531\uff01", 1, 3);
		return
	}
	$.ajaxSetup({
		cache: false
	});
	$.getJSON(a, {
		commendReason: b,
		selectValue: c,
		diguId: d
	}, function(e){
		ye_dialog.close();
		if (e.result == "success") {
			ye_msg.open("\u63d0\u4ea4\u6210\u529f\uff01", 1, 1)
		}
		else {
			if (e.result == "noLogin") {
				window.location.href = txweb.user.loginURL
			}
			else {
				ye_msg.open("\u63d0\u4ea4\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2)
			}
		}
	})
}

function addReportData(d){
	var a = "/ajaxData/reportData.jsp";
	var c = $("#addReport").val() || "";
	var b = "";
	$("input[name='reportOption']:checked").each(function(){
		b += $(this).val()
	});
	c = trim(c);
	if (c == "\u60a8\u53ef\u4ee5\u8be6\u7ec6\u63cf\u8ff0\u6076\u610f\u884c\u4e3a(\u5982\u5bf9\u65b9\u53d1\u9001\u56fe\u7247\u4e2d\u7684\u4e0d\u826f\u4fe1\u606f)") {
		c = ""
	}
	if (b == "") {
		ye_msg.open("\u8bf7\u9009\u62e9\u4e3e\u62a5\u7684\u539f\u56e0\uff01", 1, 3);
		return
	}
	$.ajaxSetup({
		cache: false
	});
	$.getJSON(a, {
		addContent: c,
		selectValue: b,
		diguId: d
	}, function(e){
		ye_dialog.close();
		if (e.result == "success") {
			ye_msg.open("\u63d0\u4ea4\u6210\u529f\uff01", 1, 1)
		}
		else {
			if (e.result == "noLogin") {
				window.location.href = txweb.user.loginURL
			}
			else {
				ye_msg.open("\u63d0\u4ea4\u5931\u8d25\uff0c\u8bf7\u91cd\u65b0\u64cd\u4f5c\uff01", 1, 2)
			}
		}
	})
}

function copyText(a){
	if (a == null || a == "") {
		ye_msg.open("\u8bf7\u9009\u62e9\u8981\u590d\u5236\u7684\u5185\u5bb9\uff01", 1, 3)
	}
	if (window.clipboardData) {
		window.clipboardData.setData("Text", a);
		ye_msg.open("\u590d\u5236\u6210\u529f\uff01", 1, 1)
	}
	else {
		ye_msg.open("\u60a8\u4f7f\u7528\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6b64\u590d\u5236\u529f\u80fd\u3002<br/>\u8bf7\u4f7f\u7528Ctrl+C\u590d\u5236\u6b64\u94fe\u63a5\u3002", 3, 3)
	}
}

function ltrim(a){
	return a.replace(/(^\s*)/g, "")
}

function rtrim(a){
	return a.replace(/(\s*$)/g, "")
}

function trim(a){
	return rtrim(ltrim(a))
};
