




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='9'>");
	document.writeln("<input type='hidden' name='aid' id='aid' value='3028350'>");
	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='9'>");
	document.writeln("<input type='hidden' name='aid' id='aid' value='3028350'>");
	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\">2<\/b> 条　<a href=\"http://comment.mop.com/comment.do?pid=9&aid=3028350\">查看全部回复<\/a><\/div>")


document.writeln("<!--一组评论内容开始-->");
document.writeln("	<div class=\"pinglun_con\" onmouseover=\"mouseAComment('over','149')\" onmouseout=\"mouseAComment('out','149')\">");
document.writeln("    	<p class=\"pic\"><a href='http://hi.mop.com/profile2.do?id=353482574' target='_blank'><img src='http://image2.mop.com/comment/images/ping_01.gif' width='50' height='50' /></a><\/p>");
document.writeln("        <div class=\"content_pl\">");
document.writeln("        	<div class=\"member_infor\">");
document.writeln("            <img src=\"http://image2.mop.com/comment/images\/ping_05.gif\" \/> 717654352good　2009-07-14 00:47:13　来自广东省深圳市");
document.writeln("            <\/div>");
document.writeln("            <div class=\"infor\">我日，月经也报道，人家掉把阴毛数死你狗日的<br/><\/div>");
document.writeln("            ");
document.writeln("            <!--鼠标滑过时显示开始-->");
document.writeln("            <div class=\"left\"  style=\"display:none;\" id=\"hi_149\">");
				
document.writeln("                <div class=\"kapian\"  style=\"margin-left:230px;\"><a href=\"javascript:void(0);\" onclick=\"share(9,3028350);\">分享给好友<\/a><\/div>");
            	
document.writeln("          	<\/div>");
document.writeln("            <!--鼠标滑过时显示结束-->");
document.writeln("            ");
document.writeln("            <div class=\"right\">");
document.writeln("            	<div class=\"kapian\"><div class=\"ding_cai\" id=\"up_149\" style=\"display:none;\"></div><a href='javascript:void(0);' onclick='updown(\"up\",9,3028350,149);'><b class=\"cyellow\">顶<\/b></a><span class=\"cyellow\" id=\"upnum_149\">(0)<\/span><\/div>");
document.writeln("                <div class=\"kapian\"><div class=\"ding_cai\" id=\"down_149\" style=\"display:none;\"></div><a href='javascript:void(0);' onclick='updown(\"down\",9,3028350,149);'><b class=\"cblack\">踩<\/b></a><span id=\"downnum_149\">(0)<\/span><\/div>");
document.writeln("          <\/div>");
document.writeln("            ");
document.writeln("        <\/div>");
document.writeln("    <\/div>");
document.writeln("	<!--一组评论内容结束-->")

document.writeln("<!--一组评论内容开始-->");
document.writeln("	<div class=\"pinglun_con\" onmouseover=\"mouseAComment('over','11')\" onmouseout=\"mouseAComment('out','11')\">");
document.writeln("    	<p class=\"pic\"><a href='http://hi.mop.com/profile2.do?id=352281129' target='_blank'><img src='http://image2.mop.com/comment/images/ping_01.gif' width='50' height='50' /></a><\/p>");
document.writeln("        <div class=\"content_pl\">");
document.writeln("        	<div class=\"member_infor\">");
document.writeln("            <img src=\"http://image2.mop.com/comment/images\/ping_05.gif\" \/> anyi3927　2009-07-07 10:58:13　来自贵州省毕节市");
document.writeln("            <\/div>");
document.writeln("            <div class=\"infor\">我日，月经也报道，人家掉把阴毛数死你狗日的<\/div>");
document.writeln("            ");
document.writeln("            <!--鼠标滑过时显示开始-->");
document.writeln("            <div class=\"left\"  style=\"display:none;\" id=\"hi_11\">");
				
document.writeln("                <div class=\"kapian\"  style=\"margin-left:230px;\"><a href=\"javascript:void(0);\" onclick=\"share(9,3028350);\">分享给好友<\/a><\/div>");
            	
document.writeln("          	<\/div>");
document.writeln("            <!--鼠标滑过时显示结束-->");
document.writeln("            ");
document.writeln("            <div class=\"right\">");
document.writeln("            	<div class=\"kapian\"><div class=\"ding_cai\" id=\"up_11\" style=\"display:none;\"></div><a href='javascript:void(0);' onclick='updown(\"up\",9,3028350,11);'><b class=\"cyellow\">顶<\/b></a><span class=\"cyellow\" id=\"upnum_11\">(0)<\/span><\/div>");
document.writeln("                <div class=\"kapian\"><div class=\"ding_cai\" id=\"down_11\" style=\"display:none;\"></div><a href='javascript:void(0);' onclick='updown(\"down\",9,3028350,11);'><b class=\"cblack\">踩<\/b></a><span id=\"downnum_11\">(0)<\/span><\/div>");
document.writeln("          <\/div>");
document.writeln("            ");
document.writeln("        <\/div>");
document.writeln("    <\/div>");
document.writeln("	<!--一组评论内容结束-->")


var ht = '&nbsp;&nbsp;<a href="http://comment.mop.com/comment.do?pid=9&aid=3028350" target="_blank" class="cyellow"><span class="f12">已有评论(2)</span></a>　<a href="javascript:void(0);" onclick="share(9,3028350);"><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("<!--操作失败弹出结束-->");