var $Praise=function(D,E,C,B){if($type(E)!="number"){return }var A="do=a&i="+E+"&t="+C;new AjaxReq({url:"/rate.v",method:"get",data:A,onRequest:function(){Mbox.openLite('<p class="Doing">正在处理，请稍候....</p>',200,30)},onSuccess:function(H){Mbox.close();if(H&&H.code==100){var G=H.msg.r||[],F=new Element("ul").addClass("rateBox");G.each(function(J,I){new Element("li").set("html",'<a href="javascript:void(0)" class="send" style="background-image: url('+J.m+')">'+J.t+"</a>").addEvent("click",function(){$Praise.submit(D,E,C,B,J.i)}).inject(F)});Mbox.openLite($dialog("选一朵鲜花吧",[F],[]),430,120,{closable:true})}else{if(H.code==302){new Prompt().confirm(["删除鲜花","您已送过鲜花。是否要删除？"],{onReturn:function(I){if(I){$Praise.del(D,E,C,B)}}})}else{if(H.code==401){$AuthBoxShow(H.msg)}else{Mbox.openLite('<p class="Doing">'+H.msg||"发生未知错误，请稍候再试！</p>",280,"auto");setTimeout(function(){Mbox.close()},1500)}}}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close()">返回</a></p>',200,30)}}).send()};$Praise.submit=function(D,F,C,A,E,B){Mbox.openLite('<p class="Doing">正在送花，请稍候......</p>',280,30);new AjaxReq({url:"/rate.v?do=aa&i="+F+"&t="+C+"&s="+E,onSuccess:function(G){Mbox.close();if(G&&G.code==900){B?window.location.reload(true):$Praise.update(G.msg,D,A)}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close()">返回</a></p>',200,30)}}).send()};$Praise.del=function(D,E,C,A,B){Mbox.openLite('<p class="Doing">正在删除，请稍候......</p>',280,30);new AjaxReq({url:"/rate.v?do=dd&i="+E+"&t="+C,onSuccess:function(F){Mbox.close();if(F&&F.code==900){B?window.location.reload(true):$Praise.update(F.msg,D,A)}},onError:function(){Mbox.openLite('<p class="Doing">操作失败，请<a href="#" onclick="Mbox.close()">返回</a></p>',200,30)}}).send()};$Praise.update=function(C,D,A){if(!C||(!C.c&&C.c!=0)||!C.u||!C.n){alert("获取鲜花总数错误，请稍候再试！");return }if(D){var B=$(D).get("tag");switch(B){case"span":$(D).set("html","("+(C.c||"0")+")");break;default:$(D).set("html",(C.c||"")+"鲜花");break}}if(A){A.call(null,C.c,C.u,C.n,C.t)}};