




function checkForm() {
	var username = "";
	if(nickname=='') {
		 username = $("#username_0").val();
		 
		 username = username.replace(/^[\n|\r\n]*|[\n|\r\n]*$/g, '');
		 if(username == '') {
		 	popMsg('请输入昵称');
		 	return false;
		 }
	}
	
	var msg = $("#content").val();
	msg = $.trim(msg);
	if(msg == '') {
		popMsg("请输入评论内容");
		return false;
	}
	return true;
}

var lastBg = ""; 
function mouseAComment(action, id) {
	if(action == 'over') {
		$("#hi_"+id).show();
		lastBg = $("commentRoot_"+id).css("background");
		$("commentRoot_"+id).css("background","#f7f7f7");
	} else if(action == 'out') {
		$("#hi_"+id).hide();
		$("commentRoot_"+id).css("background",lastBg);
	}
}

function popMsg(content, title) {
	$("#popContent").html(content);
	if(title) {
		$("#popTitle").html(title);
	}
	
	$("#popDiv").css("left", (document.body.clientWidth / 2 -$("#popDiv").width() / 2 - 50) + "px");
    $("#popDiv").css("top", (((document.documentElement.scrollTop == 0) ? document.body.scrollTop : document.documentElement.scrollTop) + ((document.documentElement.clientHeight == 0) ? document.body.clientHeight : document.documentElement.clientHeight) / 2 - $("#popDiv").height() / 2) + "px");
	
	$("#popDiv").show();
}

function share(pid, aid) {
	if(nickname == '') {
		popMsg("您还未登陆，无法分享新闻给好友");
		return;
	} else {
		popMsg("您已分享新闻给好友","操作成功");
		var i = new Image();
		i.src="http://comment.mop.com/zixun/zixunShare.do?pid="+pid+"&aid="+aid+"&r="+Math.random();
	}
	
}

function updown(action, pid, aid, id) {
	//播放动画
	var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="60" height="80">\
		<param name="movie" value="http://image2.mop.com/comment/images/'+action+'.swf" />\
		<param name="quality" value="high" />\
        <param name="wmode" value="transparent" />\
		<embed src="http://image2.mop.com/comment/images/'+action+'.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="60" height="80"></embed>\
		</object>';
	$("#"+action+"_"+id).html(html).show("fast");
	
	setTimeout('$("#'+action+'_'+id+'").hide()',1500);

	// 数字加1
	var reg = new RegExp("\\((.*?)\\)");
	var numStr = reg.exec($("#"+action+"num_"+id).html())[1];
	var num = parseInt(numStr);
	num++;
	$("#"+action+"num_"+id).html("("+ num +")");
	
	//发送请求
	var i = new Image();
	i.src="http://comment.mop.com/zixun/zixunUpDown.do?action="+action+"&pid="+pid+"&aid="+aid+"&id="+id+"&r="+Math.random();
}


document.writeln("<!--评论开始-->");
document.writeln("<div class=\"blank16\"><\/div>");
document.writeln("<div class=\"clearit\" style=\"border-top:1px solid #e3e3e3;\"><\/div>");
document.writeln("");
document.writeln("<div class=\"blank16\"><\/div>");
document.writeln("<h5 class=\"titleh5\">我也说两句<\/h5>");
document.writeln("");
document.writeln("<div class=\"clearit\"><\/div>");

if(nickname == "") {
	document.writeln("<!--登录前开始-->");
	document.writeln("<form id='commentform' name='commentform' method='post' action='http://comment.mop.com/zixun/zixunCommentAdd.do' onSubmit=\"document.charset='utf-8'; return checkForm();\" accept-charset=\"utf-8\">" );
	document.writeln("<input type='hidden' name='head' id='head' value=''>");
	document.writeln("<input type='hidden' name='pid' id='pid' value='5'>");
	document.writeln("<input type='hidden' name='aid' id='aid' value='207941'>");
	document.writeln("<input type='hidden' name='from' id='aid' value='"+ document.location.href +"'>");
	document.writeln("	<div><span class=\"denglu_befor\"><a href=\"http://passport.mop.com/register\">还没有注册？<\/a><\/span><\/div>");
	document.writeln("	<div class=\"blank4\"><\/div>");
	document.writeln("	<div class=\"pic_member\">");
	document.writeln("		<p><a href=\"#\"><img src=\"http:\/\/image2.mop.com\/comment\/images\/ping_01.gif\" \/><\/a><\/p>");
	document.writeln("	    <h2><a href=\"#\">猫扑网友<\/a><\/h2>");
	document.writeln("	<\/div>");
	document.writeln("	");
	document.writeln("	<div class=\"pinglun_kuang\">");
	document.writeln("		<textarea id=\"content\" name=\"content\" cols=\"\" rows=\"\"><\/textarea>");
	document.writeln("	    <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("	  	<tr>");
	document.writeln("	    <td>昵称：<input type=\"text\" id=\"username_0\" name=\"username\"  class=\"inputy\"  style=\"background:#fff\" \/> 密码：<input name=\"password\" type=\"password\" id=\"password_0\"  class=\"inputy\"  style=\"background:#fff\" \/><\/td>");
	document.writeln("	    <td>&nbsp;<\/td>");
	document.writeln("	    <td width=\"15\"><input type=\"checkbox\" name=\"top\" value=\"true\" id=\"top_0\"  \/><\/td>");
	document.writeln("	    <td width=\"75\">使用MP置顶<\/td>");
	document.writeln("	    <td width=\"80\"><input type=\"image\" src=\"http:\/\/image2.mop.com\/comment\/images\/ping_02.gif\" \/><\/td>");
	document.writeln("	  	<\/tr>");
	document.writeln("		<\/table>");
	document.writeln("	");
	document.writeln("	<\/div>");
	document.writeln("	");
	document.writeln("	<div class=\"blank8\"><\/div>");
	document.writeln("	<div class=\"blank16\"><\/div>");
	document.writeln("	<div class=\"clearit\" style=\"border-top:1px solid #e3e3e3;\"><\/div>");
	document.writeln("	");
	document.writeln("	");
	document.writeln("	<\/form>");
	document.writeln("	<!--登录前结束-->");
} else {
	document.writeln("<!--登录后开始-->");
	document.writeln("<form id='commentform' name='commentform' method='post' action='http://comment.mop.com/zixun/zixunCommentAdd.do' onSubmit=\"document.charset='utf-8'; return checkForm();\" accept-charset=\"utf-8\">");
	document.writeln("<input type='hidden' name='head' id='head' value='"+ Hi_USER.headUrl +"'>");
	document.writeln("<input type='hidden' name='pid' id='pid' value='5'>");
	document.writeln("<input type='hidden' name='aid' id='aid' value='207941'>");
	document.writeln("<input type='hidden' name='from' id='aid' value='"+ document.location.href +"'>");
	document.writeln("	<div class=\"denglu_after\">登录:"+loginTimes+"次　MP:"+mp+" <a href=\"http://passport.mop.com/Logout?backUrl="+escape(document.location.href)+"\"><img src=\"http:\/\/image2.mop.com\/comment\/images\/ping_04.gif\" \/><\/a><\/div>");
	document.writeln("	<div class=\"blank4\"><\/div>");
	document.writeln("	<div class=\"pic_member\">");
	document.writeln("		<p><a href=\"http://hi.mop.com/\"><img src=\""+ Hi_USER.headUrl +"\" \/><\/a><\/p>");
	document.writeln("	    <h2><a href=\"http://hi.mop.com/\">"+nickname+"<\/a><\/h2>");
	document.writeln("	<\/div>");
	document.writeln("	");
	document.writeln("	<div class=\"pinglun_kuang\">");
	document.writeln("		<textarea id=\"content\" name=\"content\" cols=\"\" rows=\"\"><\/textarea>");
	document.writeln("	    <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
	document.writeln("	  	<tr>");
	document.writeln("	    <td width=\"15\" align=\"left\">&nbsp;<\/td>");
	document.writeln("	    <td width=\"30\">&nbsp;<\/td>");
	document.writeln("	    <td>&nbsp;<\/td>");
	document.writeln("	    <td>&nbsp;<\/td>");
	document.writeln("	    <td width=\"15\"><input type=\"checkbox\" value=\"true\" name=\"top\" id=\"top_0\" \/><\/td>");
	document.writeln("	    <td width=\"75\">使用MP置顶<\/td>");
	document.writeln("	    <td width=\"80\"><input type=\"image\" src=\"http:\/\/image2.mop.com\/comment\/images\/ping_02.gif\" \/><\/td>");
	document.writeln("	  	<\/tr>");
	document.writeln("		<\/table>");
	document.writeln("	<\/div>");
	document.writeln("<div class=\"blank8\"><\/div>");
	document.writeln("<div class=\"blank16\"><\/div>");
	document.writeln("<div class=\"clearit\" style=\"border-top:1px solid #e3e3e3;\"><\/div>")
	document.writeln("	<\/form>");
}

document.writeln("<div class=\"blank8\"><\/div>");
document.writeln("<!--评论内容开始-->");
document.writeln("<div class=\"cgery textrig\">已有评论 <b class=\"cyellow\">0<\/b> 条　<a href=\"http://comment.mop.com/comment.do?pid=5&aid=207941\">查看全部回复<\/a><\/div>")



var ht = '&nbsp;&nbsp;<a href="http://comment.mop.com/comment.do?pid=5&aid=207941" target="_blank" class="cyellow"><span class="f12">已有评论(0)</span></a>　<a href="javascript:void(0);" onclick="share(5,207941);"><img src="http://image2.mop.com/comment/images/ping_00.gif" style="vertical-align:middle;" /></a>';
document.getElementById('title_comment').innerHTML = ht;



document.writeln("<!--操作失败弹出开始-->");
document.writeln("<div class=\"pop\" style=\"width:350px;display:none;\" id=\"popDiv\">");
document.writeln("	<div class=\"contentk\">");
document.writeln("   	  <div class=\"pad5\">");
document.writeln("  		<h1 class=\"title_sm\"><span><img src=\"http:\/\/image2.mop.com\/comment\/images\/ping_16.gif\" style=\"cursor:pointer\" onclick=\"$(\'#popDiv\').hide();\" \/><\/span><b id=\"popTitle\"><img src=\"http:\/\/image2.mop.com\/comment\/images\/ping_18.gif\" \/> 操作失败<\/b><\/h1>");
document.writeln("    	");
document.writeln("        <div class=\"informp\" id=\"popContent\">您的MP不足50，<a href=\"#\" style=\"text-decoration:underline;\">点击这里即可轻松获得MP！<\/a><br \/>");
document.writeln("<a href=\"#\" style=\"text-decoration:underline;\">查看这里<\/a> 了解更多MP信息<\/div>");
document.writeln("        ");
document.writeln("		<div class=\"blank4\"><\/div>");
document.writeln("    	<\/div>");
document.writeln("	<\/div>");
document.writeln("  <div class=\"clearit\"><\/div>");
document.writeln("<\/div>");
document.writeln("<!--操作失败弹出结束-->");