﻿function switchCatelog(b){if(b==null){return false}var a=document.getElementById("catelog");if(a==null){return false}if(b.getAttribute("show")=="1"){a.style.display="none";b.setAttribute("show","0");b.innerHTML="\u663e\u793a"}else{a.style.display="block";b.setAttribute("show","1");b.innerHTML="\u9690\u85cf"}return false}var evaluateTips={"1":"\u5185\u5bb9\u5f88\u5dee","2":"\u5185\u5bb9\u4e0d\u9519","3":"\u5185\u5bb9\u4e30\u5bcc","4":"\u5185\u5bb9\u4e13\u4e1a","5":"\u5185\u5bb9\u6743\u5a01"};function showEvaluateTip(c){if(c==null){return}var a=evaluateTips[c.getAttribute("value")];var b=document.getElementById("evaluateTip");if(b==null){return}b.className="";b.innerHTML=(a!=null?a:"");b.style.display="block"}function clearEvaluateTip(){var a=document.getElementById("evaluateTip");if(a==null){return}a.style.display="none"}function showEvaluateErrorTip(b){if(b==null){return}var a=document.getElementById("evaluateTip");if(a==null){return}a.className="msg";a.innerHTML=b;a.style.display="block"}function initialLevelProgressBar(){var a=null;var d=null;var c=0;for(var b=1;b<=5;b++){a=document.getElementById("lv"+b);if(a==null){continue}c=parseInt(a.innerHTML);d=document.getElementById("lp"+b);if(d==null){continue}d.style.width=c+"px"}}var evaluateUrl="/Evaluate.htm";function evaluateLemma(f,c,a,d,g){if(hasEvaluated(f,c,a)){showEvaluateErrorTip("\u60a8\u5df2\u7ecf\u8bc4\u4ef7\u8fc7\u4e86！");return}setEvaluateFlag(f,c,a,true);var b=evaluateUrl+"?lId="+c+"&cId="+a+"&score="+d;Zhishi.Ajax.sendRequest("GET",b,{onSuccess:g});var i=document.getElementById("evaluePanel");if(i!=null){i.style.display="none"}var e=document.getElementById("star_re_wrap");if(e!=null){e.style.display="block"}var h=document.getElementById("evaluateResultPanel");if(h!=null){h.className="mark"+d}}function evaluateFinished(data){var result=eval("("+data+")");if(result==null){showEvaluateErrorTip("\u62b1\u6b49！\u60a8\u7684\u8bc4\u4ef7\u64cd\u4f5c\u672a\u80fd\u6210\u529f，\u8bf7\u7a0d\u540e\u518d\u8bd5！");return}if(result.state==0){var totalEvaluateElem=document.getElementById("totalEvaluate");if(totalEvaluateElem!=null){totalEvaluateElem.innerHTML="&nbsp;\u5171"+result.total+"\u4eba\u53c2\u4e0e\u8bc4\u4ef7&nbsp;"}var lvElem=null;for(var i=1;i<=5;i++){lvElem=document.getElementById("lv"+i);if(lvElem!=null){lvElem.innerHTML=result.level[i-1]}}initialLevelProgressBar();var tipElem=document.getElementById("evaluateTip");if(tipElem!=null){tipElem.className="";tipElem.innerHTML="\u8bc4\u4ef7\u6210\u529f！";tipElem.style.display="block"}}else{showEvaluateErrorTip("\u60a8\u5df2\u7ecf\u8bc4\u4ef7\u8fc7\u4e86！")}}function hasEvaluated(c,b,d){var a=Zhishi.Cookie.getCookie("bk_evaluate_"+c+"_"+b+"_"+d);if(a=="1"){return true}return false}function setEvaluateFlag(c,b,d,a){if(a){Zhishi.Cookie.setCookie("bk_evaluate_"+c+"_"+b+"_"+d,1,0.166667)}else{Zhishi.Cookie.delCookie("bk_evaluate_"+c+"_"+b+"_"+d)}};
