function favorite(fd,ct,ci){yapi({method:"content.favorite",data:{content_type:ct,content_id:ci,favorite:fd},success:function(r){t.fav=(r["result"]["favorite"]=="add")?{a:"none",r:""}:{a:"",r:"none"};d.getElementById("fav_add").style.display=t.fav.a;d.getElementById("fav_remove").style.display=t.fav.r;}});}function rating_star(rd,ct,ci,rr,v){if(typeof(t.rate_voted)=="undefined"){for(i=1;i<=5;i++){d.getElementById(ct+"_"+ci+"_"+i).src=cdn("ic/rate/"+((rd=="over")?((i>v)?"f":"t"):((((i-1)<rr)&&(i>rr))?"h":((i<=rr)?"t":"f")))+".png");}}}function rating_vote(ct,ci,v){if(typeof(t.rate_voted)=="undefined"){yapi({method:"content.rating.vote",data:{content_type:ct,content_id:ci,vote:v},success:function(r){rating_star("out",ct,ci,v,v);t.rate_voted=true;}});}}