var Http={headLoc:document.getElementsByTagName("head").item(0),get:function(b){var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("charset","utf-8");a.setAttribute("src",b+"&r="+Math.random());this.headLoc.appendChild(a)},send:function(b){var a=document.createElement("script");a.setAttribute("type","text/javascript");a.setAttribute("charset","utf-8");a.setAttribute("src",b);this.headLoc.appendChild(a)}};var Statistic={prePlay:"playstat_",prePlayDb:"playdb_",prePlayTvVod:"playtvvod_",prePlayMovieVod:"playmovievod_",preCmt:"cmtstat_",preUp:"upstat_",preGrade:"grade_",preGraden:"graden_",playList:jQuery("span[id^=playstat_]"),playDbList:jQuery("span[id^=playdb_]"),playTvVodList:jQuery("span[id^=playtvvod_]"),playMovieVodList:jQuery("span[id^=playmovievod_]"),cmtList:jQuery("span[id^=cmtstat_]"),upList:jQuery("span[id^=upstat_]"),gradeList:jQuery("span[id^=grade_]"),gradenList:jQuery("span[id^=graden_]"),get:function(f,e,d,h){var b="http://count.joy.cn/static/"+h+".aspx?";var g=action.contentTypeId;if(f=="playdb_"){g=13}else{if(f=="playtvvod_"){g=14}else{if(f=="playmovievod_"){g=11}}}var a="";for(var c=0;c<e.length;c++){a=a+"content_type="+g+";content_id="+e.eq(c)[0].id.substring(f.length)+";job="+d+"&";if(c>0&&c%30==0){Http.send(b+a+Math.random());a=""}}if(e.length>0&&a.length>0){Http.send(b+a+Math.random())}},getcmt:function(d,c,f){var e="http://comment.app.joy.cn/comment.do?method=count&appId="+appID+"&cbm="+f;if(typeof(isAlbum)!="undefined"){e=e+"&isAlbum="+isAlbum}var a="";for(var b=0;b<c.length;b++){a=a+"&contentIds="+c.eq(b)[0].id.substring(d.length);if(b>0&&b%30==0){Http.send(e+a+"&r="+Math.random());a=""}}if(c.length>0){Http.send(e+a+"&r="+Math.random())}},upstat:function(d){for(var a=0;a<this.upList.length;a++){var c=this.upList.eq(a)[0].id.substring(this.preUp.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.upList.eq(a)[0].innerHTML=formatV(d[b].up);break}}}},playstat:function(d){for(var a=0;a<this.playList.length;a++){var c=this.playList.eq(a)[0].id.substring(this.prePlay.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.playList.eq(a)[0].innerHTML=formatV(d[b].vv);break}}}},playdb:function(d){for(var a=0;a<this.playDbList.length;a++){var c=this.playDbList.eq(a)[0].id.substring(this.prePlayDb.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.playDbList.eq(a)[0].innerHTML=formatV(d[b].vv);break}}}},playtv:function(d){for(var a=0;a<this.playTvVodList.length;a++){var c=this.playTvVodList.eq(a)[0].id.substring(this.prePlayTvVod.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.playTvVodList.eq(a)[0].innerHTML=formatV(d[b].vv);break}}}},playmovie:function(d){for(var a=0;a<this.playMovieVodList.length;a++){var c=this.playMovieVodList.eq(a)[0].id.substring(this.prePlayMovieVod.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.playMovieVodList.eq(a)[0].innerHTML=formatV(d[b].vv);break}}}},cmtstat:function(d){for(var a=0;a<this.cmtList.length;a++){var c=this.cmtList.eq(a)[0].id.substring(this.preCmt.length);for(var b=0;b<d.length;b++){if(c==d[b].id){this.cmtList.eq(a)[0].innerHTML=formatV(d[b].cmtnum)}}}},changegradecb:function(d){for(var a=0;a<this.gradeList.length;a++){var c=this.gradeList.eq(a)[0].id.substring(this.preGrade.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.gradeList.eq(a)[0].innerHTML=formatV(d[b].grade)}}}for(var a=0;a<this.gradenList.length;a++){var c=this.gradenList.eq(a)[0].id.substring(this.preGraden.length);for(var b=0;b<d.length;b++){if(c==d[b].content_id){this.gradenList.eq(a)[0].innerHTML=formatV(d[b].graden)}}}}};function playStat(a){Statistic.playstat(a)}function playDb(a){Statistic.playdb(a)}function playTvVod(a){Statistic.playtv(a)}function playMovieVod(a){Statistic.playmovie(a)}function cmtStat(a){Statistic.cmtstat(a)}function upStat(a){Statistic.upstat(a)}function changegradecb(a){Statistic.changegradecb(a)}function upcb(json){var o=eval(json);if(o[0].retcode==1){Statistic.get(Statistic.preUp,Statistic.upList,"up","upStat")}}function gradecb(json){var o=eval(json);if(o[0].retcode==1){Statistic.get(Statistic.preGrade,Statistic.gradeList,"grade","changegradecb")}}Statistic.get(Statistic.prePlay,Statistic.playList,"vv","playStat");Statistic.get(Statistic.prePlayDb,Statistic.playDbList,"vv","playDb");Statistic.get(Statistic.prePlayTvVod,Statistic.playTvVodList,"vv","playTvVod");Statistic.get(Statistic.prePlayMovieVod,Statistic.playMovieVodList,"vv","playMovieVod");if(typeof(appID)!="undefined"){Statistic.getcmt(Statistic.preCmt,Statistic.cmtList,"cmtStat")}Statistic.get(Statistic.preUp,Statistic.upList,"up","upStat");Statistic.get(Statistic.preGrade,Statistic.gradeList,"grade","changegradecb");function formatV(a){if(typeof(isList)!="undefined"){a=comma(a)}return a}function comma(a){var c="";var d="";d=a.toString();if(d.indexOf(".")!=-1){var e=d.split(".");c=e[0];d="."+e[1]}else{c=d;d=""}var b=c.length;for(b=b-3;b>0;b-=3){c=c.substr(0,b)+","+c.substr(b)}a=c+d;return a};