function Wap_kkCommunity(a,d,b){this.scriptId=d;this.toShowId=b;this.eid=a}
Wap_kkCommunity.prototype={init:function(){this.commentPage=1;this.getMovieid();this.initDom("c_loading_pic","scomment_tip","scommentContent","gmcomments","comment_total","c_loading_button","comment_over_tip");this.loadJsData(this.scriptId,this.getScriptUrl());var a=this;document.getElementById(this.gmCommentsButtonId).onclick=function(){a.buttonClick.apply(a);return false}},initDom:function(a,d,b,c,e,f,g){var h="<h2>评论<span id='"+e+"'>（0条）</span></h2><div class='comm_none' id='"+d+"' style='display:none'>暂时没有评论~</div><div class='comm_list'><div id='"+
b+"'></div><div class='comm_loading' style='display:none;' id='"+a+'\'\'><a href=\'javascript:;\'><span>正在加载</span><b></b></a></div><div class="comm_more" style="display:none;" id="'+f+'"><a href="javascript:;" id="'+c+'"><span>点击查看更多</span><b aria-hidden="true" data-icon="g"></b></a></div><div class="comm_over" style="display:none;" id="'+g+'">评论已经加载完啦~</div></div>';document.getElementById(this.eid).innerHTML=h;document.getElementById(this.eid).style.display="block";this.loadingPicId=a;this.scommentTipId=
d;this.scommentContentId=b;this.gmCommentsButtonId=c;this.totalCommentId=e;this.gmButtonDivId=f;this.commentOverID=g},addHandler:function(a,d,b){if(a.addEventListener)a.addEventListener(d,b,false);else if(a.attachEvent)a.attachEvent("on"+d,b);else a["on"+d]=b},removeHandle:function(a,d,b){if(a.removeEventListener)a.removeEventListener(d,b,false);else if(a.detachEvent)a.detachEvent("on"+d,b);else a["on"+d]=null},getMovieid:function(){return this.movieid=G_MOVIEID},loadJsData:function(a,d){this.beforeScriptLoaded();
var b=this,c=document.getElementById(a);if(c){document.getElementsByTagName("head")[0].removeChild(c);c=null}c=document.createElement("script");c.type="text/javascript";c.id="scriptId";if(c.readyState)c.onreadystatechange=function(){if(c.readyState=="loaded"||c.readyState=="complete"){c.onreadystatechange=null;b.afterScriptLoaded.apply(b)}};else c.onload=function(){b.afterScriptLoaded.apply(b)};c.src=d;document.getElementsByTagName("head")[0].appendChild(c)},afterScriptLoaded:function(){document.getElementById(this.loadingPicId).style.display=
"none";var a=0;if(window.scomment&&scomment.status==200){document.getElementById(this.scommentTipId).style.display="none";if(scomment.data.weibo.length>0){this.commentPage++;a=1;document.getElementById(this.totalCommentId).innerHTML="("+scomment.data.misc.count+")条";for(var d="",b=scomment.data.weibo,c=document.createElement("ul"),e=0,f=b.length;e<f;e++)d+="<li><img src="+b[e].userinfo.avatar+" alt='头像' /><p>"+b[e].content+"</p><p><span>"+b[e].userinfo.nickname+"</span>发表于<span>"+b[e].pub_time+"</span></p></li>";
c.innerHTML=d;document.getElementById(this.scommentContentId).appendChild(c);if(scomment.data.weibo.length<10){a=2;document.getElementById(this.commentOverID).style.display="block"}}else{a=2;if(document.getElementById(this.scommentContentId).innerHTML==""){document.getElementById(this.scommentTipId).innerHTML="暂无评论";document.getElementById(this.scommentTipId).style.display="block"}else document.getElementById(this.commentOverID).style.display="block"}}else if(document.getElementById(this.scommentContentId).innerHTML==
""){if(window.scomment&&scomment.status==404)document.getElementById(this.scommentTipId).innerHTML="暂无评论";else document.getElementById(this.scommentTipId).innerHTML="加载失败";document.getElementById(this.scommentTipId).style.display="block"}if(a!=2)if(this.commentPage<=10)document.getElementById(this.gmButtonDivId).style.display="block";else document.getElementById(this.commentOverID).style.display="block"},beforeScriptLoaded:function(){document.getElementById(this.gmButtonDivId).style.display="none";
document.getElementById(this.loadingPicId).style.display="block"},nextPageLoading:function(){this.loadJsData(this.scriptId,this.getScriptUrl())},buttonClick:function(){this.loadJsData(this.scriptId,this.getScriptUrl())},getScriptUrl:function(){var a;switch(G_MOVIE_TYPE){case "video":a="http://api.t.kankan.com/weibo_list_short_wap.json?jsobj=scomment&type=video&id="+this.movieid+"&page="+this.commentPage;break;case "MTV":a="http://api.t.kankan.com/weibo_list_short_wap.json?jsobj=scomment&type=yinyue&id="+
this.movieid+"&page="+this.commentPage;break;default:a="http://api.t.kankan.com/weibo_list_vod.json?jsobj=scomment&movieid="+this.movieid+"&page="+this.commentPage}return a}};var wap_kkCommunity=new Wap_kkCommunity("sec_comment","wap_scomment_script","m_footer");wap_kkCommunity.init();