
var tem=getCookie("people_mood_"+contentID);
newstitle=newstitle.replace(/\"/g,"\%22");
newstitle=newstitle.replace(/\&/g,"\%26");


	document.write("<script id='people_face_div' type='text/javascript'></script>");

	var url = window.location;
	var urltemp = "";
	var String1 = "";
	var String2 = "";

	url += "";
	var stemp=url.indexOf("/GB/");
	url = url.replace("http://",""); 
	url = url.replace(".html","");
	url = url.replace("GB/",""); 

	String1 = url.substr(url.lastIndexOf(".people.com.cn"));
	String1 = url.replace(String1,"");   // String1 = politics

	String2 = url.substr(url.lastIndexOf("/")); 
	String2 = String2.replace("/","");

	var content="";

	//alert(String1);

if (channelID>0 && contentID>0 && contentID==String2 && newstitle!="" && publishtime!="" && navigator.cookieEnabled && stemp>0){


    if (String1!="" && String2!=""){

	document.write("<div align='center'><span id='people_face_show'>");

	if (tem==""){

	content=content+"<table whidth='400' align='center' cellpadding='2' cellspacing='2' border='0' style='border:1px solid #c1c1c1;background:#EFFDFE;'>";
	content=content+"  <tr><td colspan=8 whidth='200' align='left'>请选择您浏览此新闻时的心情：<br><br></td>";
	content=content+"	<td colspan=8 whidth='200' align='right'><a href=http://news.people.com.cn/GB/122793/index.html target=_blank>（点此查看新闻表情排行榜）</a><br><br></td>";
	content=content+"  </tr>";
	content=content+"  <tr>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/0.gif' width='19' border='0' vspace='2'><br>感动<br><input type='radio' name='facetype' value='0' onclick=\"javascript:faceClick('0');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/1.gif' width='19' border='0' vspace='2'><br>温馨<br><input type='radio' name='facetype' value='1' onclick=\"javascript:faceClick('1');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/2.gif' width='19' border='0' vspace='2'><br>难过<br><input type='radio' name='facetype' value='2' onclick=\"javascript:faceClick('2');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/3.gif' width='19' border='0' vspace='2'><br>无聊<br><input type='radio' name='facetype' value='3' onclick=\"javascript:faceClick('3');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/4.gif' width='19' border='0' vspace='2'><br>同情<br><input type='radio' name='facetype' value='4' onclick=\"javascript:faceClick('4');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/5.gif' width='19' border='0' vspace='2'><br>愤怒<br><input type='radio' name='facetype' value='5' onclick=\"javascript:faceClick('5');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/6.gif' width='19' border='0' vspace='2'><br>可笑<br><input type='radio' name='facetype' value='6' onclick=\"javascript:faceClick('6');return false;\">";
	content=content+"	</td>";
	content=content+"	<td align='center' width='2'>&nbsp;</td>";
	content=content+"	<td width='48' align='center'>";
	content=content+"	  <img src='http://www.people.com.cn/people_mood/face/7.gif' width='19' border='0' vspace='2'><br>奇怪<br><input type='radio' name='facetype' value='7' onclick=\"javascript:faceClick('7');return false;\">";
	content=content+"	</td>";
	content=content+"  </tr>";
	content=content+"</table>";

	document.write(content);
	
	}else{
		faceClick('-1');
	}
	
	document.write("</span></div>");
    }
}


function faceClick(facetype)
{
  if (facetype>-2 && contentID==String2){
	document.getElementById("people_face_show").innerHTML='<br><font color=#C0C0C0>表情数据已提交，请稍候......</font><br><br>';
	var show_Url = "http://comments.people.com.cn/mood/main/mood_sub.php?facetype="+(facetype)+"&titles="+(newstitle)+"&newsid="+(contentID)+"&channel="+(String1)+"&channelid="+(channelID)+"&pubtime="+(publishtime);
        if ( navigator.userAgent.toLowerCase().indexOf('msie') >= 0 ) {
                document.getElementById("people_face_div").src = show_Url;
        } else {
                var js = document.createElement("script");
                js.setAttribute("type", "text/javascript");
                js.setAttribute("src", show_Url);
                document.body.insertBefore(js, null);
        }
  }
}

function fixCookieDate(date) {
	var base = new Date(0);
	var skew = base.getTime();
	if (skew > 0) date.setTime(date.getTime() - skew);
}

function setCookie(name, value, path, domain, secure) {
		var expdates = new Date();
		fixCookieDate(expdates);
		expdates.setTime(expdates.getTime() + (1*60*60*24*1000));
		document.cookie = name + "=" + (value) + ((expdates)?"; expires="+expdates.toGMTString():"") + ((path)?"; path="+path:"") + ((domain)?"; domain="+domain:"") + ((secure)?"; secure":"");
}
function getCookie(name) {
  var search;

  search = name + "="
  offset = document.cookie.indexOf(search) 
  if (offset != -1) {
    offset += search.length ;
    end = document.cookie.indexOf(";", offset) ;
    if (end == -1)
      end = document.cookie.length;
    return document.cookie.substring(offset, end);
  }
  else
    return "";
}
