var staticroot = SITE_URL.static;

function postNewMsg(tqEditorId, msgListBoxId) {
	if (wordsOverFlow) {
		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">内容已超出字数限制</div></div>', {title: '提示', type:'alert'});
		return false;
	}
	jq = jQuery('#'+tqEditorId);
	var msg = jq.find('textarea[name=msg]').attr('value');
	var rmid = jq.find('input[name=rmid]').attr('value');
	var imgid = jq.find('input[name=imgid]').attr('value');
	var imgurl = jq.find('input[name=imgurl]').attr('value');
	var goodsurl = jq.find('input[name=goodsurl]').attr('value');
	var talkid = jq.find('input[name=talkid]').attr('value');
	var talkqmid = jq.find('input[name=talkqmid]').attr('value');
	var isgrid = jq.find('input[name=isgrid]').attr('value');
	var defaultcontent = jq.find('#TQE_defaultcontent').html();
	if (!defaultcontent || defaultcontent == undefined) defaultcontent = '';
	var pubbtn = jq.find('.TQ_msgpubbtn').attr('onclick');
	
	if (countStr(msg) > 280) {
		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">内容已超出字数限制</div></div>', {title: '提示', type:'alert'});
		return false;
	}
	
	if (!msg && !imgid && !imgurl && !goodsurl && !rmid) {
		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">你还没有录入任何内容！</div></div>', {title: '提示', type:'alert'});
		return false;
	}
	
	jq.find('#TQ_msgsubmit').attr('disabled', 'disabled');
	jq.find('.TQ_msgpubbtn').removeAttr('onclick');
	
	var submitOption = {
		dataType : 'json', 
		url : makeurl('tq','post',{'isajax':1}),
		success : function(res) {
		if (checkHiError(res)) return;
    	if (res['status']) {
    		if (talkid || rmid || tqEditorId == 'TQ_rtForm') jq.html('<div class="bangtrue"><div class="l1">发布成功！</div></div>');
    		else jQuery.weeboxs.open('<div class="bangtrue"><div class="l1">发布成功！</div></div>', {title: '提示', type:'alert'});
    		if (!msgListBoxId || msgListBoxId == undefined) msgListBoxId = 'TQ_msglist';
    		jQuery('#TQ_nothing').remove();
    		if (!talkqmid) jQuery('#'+msgListBoxId).prepend(res['message']);
    		jq.find('textarea[name=msg]').attr('value', defaultcontent);
    		jq.find('input[name=imgid]').attr('value', '');
    		jq.find('#TQ_imgbox').html('').hide();
    		jq.find('input[name=goodsurl]').attr('value', '');
    		jq.find('#TQ_goodsbox').html('').hide();
    		jq.find('#TQ_msgsubmit').removeAttr('disabled');
    		jq.find('.TQ_msgpubbtn').attr('onclick', pubbtn);
    		jq.find('.TQE_mediabox').html('');
    		jq.find('#xtqetags').val('');
    		jq.find('.TQE_tags a').removeAttr('class');
    		
    		if (rmid) {
    			var rtnumspan = $('.rtnum_'+rmid);
        		var rtnum = rtnumspan.html();
        		if (rtnum || rtnum === '0') rtnumspan.html(parseInt(rtnum)+1);
    		}
    		
    		colseWeeBox();
    		if (msgListBoxId == 'msgwall' && isgrid > 1) resetwall();
    		else if (msgListBoxId == 'wallbox' && isgrid) masonry_prepend();
    	} else {
    		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">'+res['message']+'</div></div>', {title: '提示', type:'alert'});
    		jq.find('#TQ_msgsubmit').removeAttr('disabled');
    	}
		}
	};
	
	jq.find('form').ajaxSubmit(submitOption);
}

function rtMsgForm(mid) {
	var ajaxurl = makeurl('tq','getRtForm',{'mid':mid});
	$.weeboxs.open(ajaxurl, {title:'转发', width:560, contentType:'ajax'});
}

function reMsgForm(mid, rmid) {
	$.get(makeurl('tq','getuid'), '', function(uid) {
		if (!uid) {
			alert('请先登录！');
			return false;
		}
		var commentFormHtml = getCommentForm(mid, rmid);
		jQuery.weeboxs.open('<div class="TQ_commentformblk" style="padding:15px; background:#fff;">'+commentFormHtml+'</div>', {title:'评论', width:520, type:'alert'});
	});
}

function postNewComment(obj, mid, style) {
	var cblk = $(obj).closest('.TQ_commentblk');
	var commentblk = $(obj).closest('.TQ_commentformblk');
	var mcontent = commentblk.find('textarea[name=mcontent]').attr('value');
	var rmcid = commentblk.find('input[name=rmcid]').attr('value');
	
	if (!mcontent) {
		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">你还没有录入任何内容！</div></div>', {title: '提示', type:'alert'});
		return false;
	}
	
	if (countStr(mcontent) > 280) {
		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">内容已超出字数限制，最多输入140字</div></div>', {title: '提示', type:'alert'});
		return false;
	}
	if (mcontent) {
		mcontent = mcontent.replace(/\+/g, "%2B");
		mcontent = mcontent.replace(/\&/g, "%26");
	}
	
	var ajaxurl=makeurl('tq','comment');
	var datastr = 'mid='+mid+'&content='+mcontent+'&rmcid='+rmcid+'&isajax=1';
	if (style) datastr += '&style='+style;
	if (commentblk.find('input[name=sync]').attr('checked')) datastr += '&sync=1';
	if (commentblk.find('input[name=sync2]').attr('checked')) datastr += '&sync2=1';
	if (commentblk.find('input[name=sina]').attr('checked')) datastr += '&sina=1';
	commentblk.find('textarea[name=mcontent]').attr('value', '');
	$.post(ajaxurl, datastr, function(res){
    	res = eval('('+res+')');
    	if (checkHiError(res)) return;
    	if (res['status']) {
    		colseWeeBox(0);
    		$.weeboxs.open('<div class="bangtrue"><div class="l1">发布成功！</div></div>', {title: '提示', type:'alert'});
    		cblk.find('.TQ_commentlist').prepend(res['message']);
    		var respan = cblk.closest('.TQ_msgblk').find('.TQ_commentNum');
    		var renum = respan.html();
    		if (renum == '' || renum == 'undefined' || renum == undefined) {
    			respan = $('#TQ_commentNum');
    			renum = respan.html();
    		}
    		respan.html(parseInt(renum)+1);
    		var renumspan = $('.renum_'+mid);
    		renum = renumspan.html();
    		if (renum || renum === '0') renumspan.html(parseInt(renum)+1);
    		colseWeeBox();
    	} else {
    		$.weeboxs.open('<div class="bangfalse"><div class="lauto">'+res['message']+'</div></div>', {title: '提示', type:'alert'});
    	}
    });
}

function chkSyncRT(obj) {
	var TQ_commentsync = $(obj).closest('.TQ_commentchk').find('.TQ_commentsync');
	if ($(obj).attr('checked')) {
		TQ_commentsync.show();
	} else {
		TQ_commentsync.hide();
	}
}

function getCommentForm(mid, rmid, rmcid) {
	var cfhtml = '<table border="0" style="margin-top:4px;"><tr>';
	cfhtml += '<td valign="top"><a onclick="jQuery(this).showFaceTip({\'textId\':\'TQ_comTextArea\',\'tipboxId\':\'TQ_comFace\'});" href="javascript:;"><img src="'+SITE_URL.static+'/images/tq_tan.gif" /></a></td>';
	cfhtml += '<td><textarea name="mcontent" id="TQ_comTextArea" style="border:1px solid #ccc; width:390px; height:50px; resize:none;"></textarea></td>';
	cfhtml += '</tr></table>';
	cfhtml += '<table border="0" style="margin-left:32px;"><tr>';
	cfhtml += '<td align="left" width="320" class="TQ_commentchk">';
	cfhtml += '<input name="sync" value="1" type="checkbox" class="vm_input" onclick="chkSyncRT(this)">同时转发这条消息&nbsp;';
	if (rmid > 0) cfhtml += '<input name="sync2" value="1" type="checkbox" class="vm_input">同时评论给原文作者';
	cfhtml += '<input name="rmcid" value="'+rmcid+'" type="hidden" />';
	cfhtml += '<br /><span class="TQ_commentsync" style="display:none;"><input name="sina" value="1" type="checkbox" checked="checked" class="vm_input">同步(<a href="'+SITE_URL.sns+'/'+makeurl('setinfo','account')+'" target="_blank">设置</a>)</span>';
	cfhtml += '</td><td align="right">';
	cfhtml += '<a href="javascript:;" onclick="postNewComment(this, ' + mid + ', \'mini\')" class="anniu1"><font class="white">发评论</font></a>';
	cfhtml += '</td></tr></table>';
	return cfhtml;
}

function reMsg(obj, mid, rmid) {
	var msgblk = $(obj).closest('.TQ_msgblk');
	var commentblk = msgblk.find('.TQ_commentblk');
	var commentFormBox = msgblk.find('.TQ_commentbox');
	var commentList = msgblk.find('.TQ_commentlist');
	var commentHtml = commentFormBox.html();
	
	if (commentHtml) {
		commentblk.html('');
	} else {
		var commentFormHtml = getCommentForm(mid, rmid);
		commentblk.html('<div class="text_comment1"></div><div class="text_zhuan2 black"><div class="TQ_commentbox"></div><div class="TQ_commentlist"></div></div><div class="text_zhuan3"></div>');
		var commentFormBox = msgblk.find('.TQ_commentbox');
		var commentList = msgblk.find('.TQ_commentlist');
		$.get(makeurl('tq','getuid'), '', function(uid) {
			if (uid) commentFormBox.html(commentFormHtml);
			else commentFormBox.html('<div style="padding:10px 0; text-align:center;">登录后可发表评论 &nbsp; <a href="'+SITE_URL.passport+'/'+makeurl('login','default')+'">现在登录</a> | <a href="'+SITE_URL.passport+'/'+makeurl('regist','default')+'">注册新账号？</a></div>');
		});
		commentList.html('<div style="padding:30px;"><div class="loading">正在载入评论…</div><div>');
		var ajaxurl = makeurl('tq','getcommentsajax',{'mid':mid});
		commentList.load(ajaxurl);
	}
}

function favor(obj, mid) {
	var ajaxurl = makeurl('tq','favor',{'mid':mid,'isajax':1});
	$.get(ajaxurl, '', function(res) {
		if (res > '') {
			var favorbtn = $(obj).parent();
			favorbtn.css('color', '#999');
			favorbtn.html('已喜欢');
		} else {
			$.weeboxs.open('<div class="bangfalse"><div class="l1">喜欢失败，请稍后重试！</div></div>', {title: '提示', type:'alert'});
		}
    });
}

function delFavor(obj, mid) {
	var ajaxurl = makeurl('tq','delfavor',{'mid':mid,'isajax':1});
	$.get(ajaxurl, '', function(res) {
		if (res > '') {
			$(obj).closest('.TQ_msgblk').remove();
		} else {
			$.weeboxs.open('<div class="bangfalse"><div class="l1">取消喜欢失败，请稍后重试！</div></div>', {title: '提示', type:'alert'});
		}
    });
}

function delMsg(obj, mid) { del(obj, mid, 'msg'); }
function delComment(obj, mcid) { del(obj, mcid, 'comment'); }
function del(obj, id, type) {
	var delconfirm = confirm('确定需要删除吗？');
	if (!delconfirm) return false;
	if (type == 'msg') {
		var ajaxurl = makeurl('tq','del',{'mid':id, 'isajax':1});
		var jq = $(obj).closest('.TQ_msgblk');
	} else if (type == 'comment') {
		var ajaxurl = makeurl('tq','del',{'mcid':id, 'isajax':1});
		var jq = $(obj).closest('.TQ_comment');
	}
	$.getJSON(ajaxurl, '', function(res) {
		$.weeboxs.open('<div style="padding:30px;">'+res['errormessage']+'</div>', {title: '提示', type:'alert'});
		if (res && !res['errorid']) jq.remove();
		colseWeeBox();
    });
}

function reply(obj, rmcid, uname) {
	$.get(makeurl('tq','getuid'), '', function(uid) {
		if (!uid) {
			alert('请先登录！');
			return false;
		}
		var commentblk = $(obj).closest('.TQ_commentblk');
		if (commentblk.html() > '') {
			commentblk.find('input[name=rmcid]').attr('value', rmcid);
			commentblk.find('textarea[name=mcontent]').attr('value', '回复@'+uname+':');
			commentblk.find('textarea[name=mcontent]').focus();
		} else {
			var replyblk = $(obj).closest('.TQ_comment').find('.TQ_commentreply');
			if (replyblk.html()>'') {
				replyblk.html('');
			} else {
				var commentFormHtml = getCommentForm(0, 0, rmcid);
				replyblk.html('<div class="text_comment1"></div><div class="text_zhuan2 black"><div class="TQ_commentbox">'+commentFormHtml+'</div></div><div class="text_zhuan3"></div>');
				replyblk.find('textarea[name=mcontent]').attr('value', '回复@'+uname+':');
				replyblk.find('textarea[name=mcontent]').focus();
			}
		}
	});
}

function caldelMsg(obj, id) {
	$.getJSON(makeurl('tq','delcalmsg',{'id':id, 'isajax':1}), '', function(res) {
		$.weeboxs.open('<div style="padding:30px;">'+res['errormessage']+'</div>', {title: '提示', type:'alert'});
		if (res && !res['errorid']) $(obj).closest('.TQ_msgblk').remove();
		colseWeeBox();
	});
}

function calMsg(obj, mid, nocal) {
	if (!nocal) nocal = 0;
	$.weeboxs.open('<div style="padding:20px;" id="CAL_form">转到画报：<br /><br /><select name="magid"><option value="0">请选择</option></select>&nbsp;&nbsp;<a class="anniu1" href="javascript:;" id="CAL_submit"><font class="white">确定</font></a></div>', {title: '请选择', type:'alert'});
	$('#CAL_form select[name=magid]').load(makeurl('tq','getmagsoption',{'f0':"%E8%AF%B7%E9%80%89%E6%8B%A9", 'nocal':nocal}));
	$('#CAL_submit').click(function (){
		var magid = $('#CAL_form select[name=magid]').val();
		$.getJSON(makeurl('tq','add2cal',{'mid':mid, 'magid':magid, 'isajax':1}), '', function(res) {
			$('#CAL_form').html(res['errormessage']);
			colseWeeBox();
		});
	});
}

function sug2mag(obj, mid) {
	$.weeboxs.open('<div style="padding:20px;" id="MAGSUG_form">投稿到画报：<br /><br /><select name="magid"><option value="0">请选择</option></select>&nbsp;&nbsp;<a class="anniu1" href="javascript:;" id="MAGSUG_submit"><font class="white">确定</font></a></div>', {title: '请选择', type:'alert'});
	$('#MAGSUG_form select[name=magid]').load(makeurl('tq','getfavmagsoption'));
	$('#MAGSUG_submit').click(function (){
		var magid = $('#MAGSUG_form select[name=magid]').val();
		$.getJSON(makeurl('tq','sug2mag',{'mid':mid, 'magid':magid, 'isajax':1}), '', function(res) {
			$('#MAGSUG_form').html(res['errormessage']);
			colseWeeBox();
		});
	});
}

function delMagMsg(obj, magid, mid) {
	$.getJSON(makeurl('tq','delmagitem',{'magid':magid, 'mid':mid, 'isajax':1}), '', function(res) {
		$.weeboxs.open('<div style="padding:30px;">'+res['errormessage']+'</div>', {title: '提示', type:'alert'});
		if (res && !res['errorid']) $(obj).closest('.TQ_msgblk').remove();
		colseWeeBox();
	});
}

function hideDivs() {
	if ($('#Tq_editor')) {
		$('#Tq_editor #selbox').css('visibility', 'hidden');
		$('#Tq_editor #upimgbox').css('visibility', 'hidden');
	}
}

function showMedia(obj, murl, mtype, title, url, artist) {
	var mhtml;
	var box = $(obj).closest('.TQ_msgblk').find('.Tq_mediabox');
	var isRT = 0;
	if (box.find('.Tq_showmedia').attr('class') != 'Tq_showmedia rtShowBox') isRT = 1;
	var loadinghtml = '<div class="pad50"><div class="loading">载入中… &nbsp; <a href="javascript:;" onclick="hideMedia(this)">取消</a></div></div>';
	if (isRT) loadinghtml = shadowbg(loadinghtml);
	box.children('.Tq_mediainfo').hide();
	if (mtype == 'video') {
		var mtitle = '';
		if (title && url) mtitle = '<a href="'+url+'" target="_blank">'+title+'</a>';
		mhtml = '<a href="javascript:;" onclick="hideMedia(this)">收起</a> &nbsp; '+mtitle+' <br /><embed height="356" allowscriptaccess="always" pluginspage="http://get.adobe.com/cn/flashplayer/" flashvars="playMovie=true&amp;auto=1" width="440" allowfullscreen="true" quality="hight" src="'+murl+'" type="application/x-shockwave-flash" wmode="transparent">';
	} else if (mtype == 'mp3') {
		var flavars = 'songurl='+url+'&autoPlay=true&song='+title+'&singer='+artist+'&lang_loading=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E6%AD%8C%E6%9B%B2%E5%8A%A0%E8%BD%BD%E4%B8%AD%20%E8%AF%B7%E7%A8%8D%E5%80%99...&amp;lang_volume=%E9%9F%B3%E9%87%8F&amp;lang_play=%E6%92%AD%E6%94%BE&amp;lang_puase=%E6%9A%82%E5%81%9C&amp;lang_content_fail=%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E8%BF%9E%E6%8E%A5%E5%A4%B1%E8%B4%A5';
		mhtml = '<a href="javascript:;" onclick="hideMedia(this)">收起</a> &nbsp; '+title+' <br /><embed height="55" width="440" src="'+staticroot+'/js/tqeditor/common/simplePlayer.swf" quality="hight" bgcolor="#ffffff" wmode="transparent" type="application/x-shockwave-flash" allowfullscreen="true" flashvars="'+flavars+'" pluginspage="http://get.adobe.com/cn/flashplayer/" allowscriptaccess="sameDomain" />';
	} else if (mtype == 'poll') {
		box.children('.Tq_showmedia').html(loadinghtml);
		box.children('.Tq_showmedia').find('.firm_b').load(murl);
		return false;
	}
	if (isRT) mhtml = shadowbg(mhtml);
	box.children('.Tq_showmedia').html(mhtml);
}

function showPic(obj, url) {
	var box = $(obj).closest('.TQ_msgblk').find('.Tq_mediabox');
	box.children('.Tq_mediainfo').css('display', 'none');
	var mhtml = '<a href="javascript:;" onclick="hideMedia(this)">收起</a> &nbsp; <a href="'+url+'" target="_blank">查看大图</a> <br /><a href="javascript:;" onclick="hideMedia(this)"><img src="'+url+'" /></a>';
	box.children('.Tq_showmedia').html(mhtml);
}

function showListPic(obj, url, middle) {
	if (!middle) middle = url;
	var box = $(obj).closest('.TQ_msgblk').find('.Tq_mediabox');
	var isRT = 0;
	if (box.find('.Tq_showmedia').attr('class') != 'Tq_showmedia rtShowBox') isRT = 1;
	var loadinghtml = '<div class="pad50"><div class="loading">载入中… &nbsp; <a href="javascript:;" onclick="hideMedia(this)">取消</a></div></div>';
	if (isRT) loadinghtml = shadowbg(loadinghtml);
	box.find('.Tq_showmedia').html(loadinghtml);
	var img = new Image();
	$(img).load(function(){
		var width = '';
		if (this.width > 440) width = ' width="440"';
		var mhtml = '<a href="javascript:;" onclick="hideMedia(this)">收起</a> &nbsp; <a href="'+url+'" target="_blank">查看大图</a> <br /><a class="zoomIn" href="javascript:;" onclick="hideMedia(this)"><img src="'+middle+'"'+width+' /></a>';
		if (isRT) mhtml = shadowbg(mhtml);
		box.find('.Tq_showmedia').html(mhtml);
	}).attr("src", middle);
}

function hideMedia(obj) {
	var box = $(obj).closest('.TQ_msgblk').find('.Tq_mediabox');
	box.children('.Tq_showmedia').html('');
	box.children('.Tq_mediainfo').css('display', 'block');
}

function showAnn(aid) {
	var ajaxurl = makeurl('index', 'announce', {'aid':aid});
	$.getJSON(ajaxurl, '', function(res){
    	$.weeboxs.open('<div class="line21" style="padding:30px;">'+res['message']+'</div>', {title: '公告', type:'alert'});
    });
}

function selectAll(obj, chkboxname) {
	if ($(obj).attr('checked')) {
		var chkflag = 'checked';
	} else {
		var chkflag = false;
	}
	$('input[name='+chkboxname+']:checkbox').each(function() {
        $(this).attr('checked', chkflag);
    });
}

function colseWeeBox(sec) {
	if (sec === 0) {
		$(".weedialog").last().remove();
		$(".dialog-mask").last().remove();
	} else {
		if (!sec) sec = 3000;
		var weeIndex = $(".weedialog").last().css('z-index');
		setTimeout(function() {
			if ($(".weedialog").last().css('z-index') == weeIndex) {
				colseWeeBox(0);
			}
		}, sec);
	}
}

function shadowbg(mhtml) {
	return '<div class="firm"><div class="text_zhuan1"></div><div class="firm_b font12 black">'+mhtml+'</div><div class="text_zhuan3"></div></div>';
}

function chkPollNum(obj, max) {
	var thisform = $(obj);
	var chked = thisform.find('input:checked[type=radio]');
	if(chked.val()) return true;
	var chked = thisform.find('input:checked[type=checkbox]');
	if (chked.length < 1) {
		$.weeboxs.open('<div class="bangfalse"><div class="l1">请至少选择一个投票选项</div></div>', {title: '提示', type:'alert'});
		return false;
	}
	if (chked.length > max) {
		$.weeboxs.open('<div class="bangfalse"><div class="l1">最多选择'+max+'项</div></div>', {title: '提示', type:'alert'});
		return false;
	}
}

function addlikegoods(obj, goodsid){
	var diggnum = $(obj).parent().parent().find('.diggnum');
	var num = diggnum.html();
	num = parseInt(num) + 1;
	var infospan = $(obj).parent();
	var intxt = infospan.html();
	infospan.html('处理中…');
	var ajaxurl = makeurl('tq','addlikegoods',{'goodsid':goodsid});
	$.getJSON(ajaxurl, '', function(res){
		if (res['status']) {
			diggnum.html(num);
			infospan.html('您已经喜欢了这个宝贝');
			var facebox = $("#imgface");
			if (facebox.attr('class')=='show_zhan img_face') $.get(makeurl('goods','addface'),function(data){facebox.append(data);});
		} else {
			infospan.html(intxt);
			$.weeboxs.open('<div style="padding:30px;">'+res['message']+'</div>', {title: '提示', type:'alert'});
		}
    });
}

function showLoginAlert() {
	var logurl = SITE_URL.passport + '/' + makeurl('login','default');
	var regurl = SITE_URL.passport + '/' + makeurl('regist','default');
	$.weeboxs.open('<div style="padding:30px;text-align:center;"><a href="'+logurl+'">现在登录</a> | <a href="'+regurl+'">注册新账号？</a></div>', {title: '请先登录！', type:'alert'});
}

function follow(uid) {
	var ajaxurl = makeurl('tq','follow',{'uid':uid, 'isajax':1});
	$.getJSON(ajaxurl, '', function(res){
		if (res['message']) {
			jQuery.weeboxs.open('<div style="padding:30px;">'+res['message']+'</div>', {title: '提示', type:'alert'});
			colseWeeBox();
		}
	});
}

function defollow(uid) {
	if (confirm('你确定要取消关注Ta吗？')) {
		var ajaxurl = makeurl('tq','delfollow',{'uid':uid, 'isajax':1});
		$.getJSON(ajaxurl, '', function(res){
			if (res['message']) {
				jQuery.weeboxs.open('<div style="padding:30px;">'+res['message']+'</div>', {title: '提示', type:'alert'});
				colseWeeBox();
			}
		});
	}
}

function chkshowgoodsform() {
	var msg = $('textarea[name=message]').attr('value');
	if (countStr(msg) > 280) {
		jQuery.weeboxs.open('<div class="bangfalse"><div class="l1">评价内容已超出字数限制，最多输入140字！</div></div>', {title:'提示', width:500, type:'alert'});
		return false;
	}
	var catid = $('select[name=catid]').val();
	if (catid < 1 || !catid) {
		alert('请选择宝贝分类！');
		return false;
	}
}

function msgMod(mid, act) {
	var ajaxurl = makeurl('msg', 'mod', {'mid':mid,'act':act,'isajax':1});
	//alert(ajaxurl);
	//jQuery.weeboxs.open(ajaxurl, {title:'版主管理', width:500, type:'ajax'});
	$.weeboxs.open(ajaxurl, {title:'版主管理', width:600, contentType:'ajax'});
	return false;
}

function msgModsubmit() {
	var weebox4mod = $(".weedialog").last().add($(".dialog-mask").last());
	weebox4mod.hide();
	setTimeout(function(){
		weebox4mod.remove();
	}, 10000);
}
