﻿var Feed={alertResult:function(f,e,d,a,b,g){var c=null;if(a&&b){c='<a href="'+b+'" target="_blank">'+a+"</a>"}Zhishi.Alert.showMessage(f,e,d,c,3000,g)},alertCollectQuestion:function(data,callback){if(!data){data=""}var json=eval("("+data+")");var cnt=null;if(json.result){cnt='<a href="/z/MyCollectedRecordsNew.htm" target="_blank">\u67e5\u770b\u6211\u7684\u6536\u85cf&gt;&gt;</a>'}Zhishi.Alert.showMessage(json.result,"\u6536\u85cf",json.message,cnt,3000)},alertReAskResult:function(c,b,a,d){Zhishi.Alert.showMessage(c,"\u8f6c\u95ee",b,a,3000,d)},alertZZQzoneResult:function(d,c,e){var a=null;var b;if(d){b="\u5df2\u6210\u529f\u8f6c\u8f7d\u5230QQ\u7a7a\u95f4。";a='<a href="'+c+'" target="_blank">\u8fdb\u5165QQ\u7a7a\u95f4\u67e5\u770b&gt;&gt;</a>'}else{b="\u95ee\u9898\u8f6c\u8f7d\u5931\u8d25，\u8bf7\u91cd\u65b0\u5c1d\u8bd5"}Zhishi.Alert.showMessage(d,"\u8f6c\u8f7d\u5230QQ\u7a7a\u95f4",b,a,3000,e)},alertZZSubjectQzoneResult:function(d,c,e){var a=null;var b;if(d){b="\u5df2\u6210\u529f\u8f6c\u8f7d\u5230QQ\u7a7a\u95f4。";a='<a href="'+c+'" target="_blank">\u8fdb\u5165QQ\u7a7a\u95f4\u67e5\u770b&gt;&gt;</a>'}else{b="\u4e13\u9898\u8f6c\u8f7d\u5931\u8d25，\u8bf7\u91cd\u65b0\u5c1d\u8bd5"}Zhishi.Alert.showMessage(d,"\u8f6c\u8f7d\u5230QQ\u7a7a\u95f4",b,a,3000,e)},alertBookWwDailyResult:function(e,d,a,b,f){var c=null;if(a&&b){c='<a href="'+b+'" target="_blank">'+a+"</a>"}Zhishi.Alert.showMessage(e,"\u8ba2\u9605\u95ee\u95ee\u65e5\u520a",d,c,3000,f)}};var new_bestAnswerHasSelectOne=false;var new_bestAnswerHasSelectTwo=false;var currentButton=null;var zzqqDialog=null;var checkboxList=new Array();var buttonList=new Array();var Link;function vote(vote_url){Zhishi.Ajax.sendRequest("GET",vote_url+"&r="+Math.random(),{onSuccess:function(data){var rsp=eval(data);if(rsp[0]==1){alert("\u64cd\u4f5c\u6210\u529f。");window.location.href=rsp[1]}else{alert(rsp[1])}}})}function addFavourite(a){Zhishi.Ajax.sendRequest("GET",a+"&r="+Math.random(),{onSuccess:function(b){Feed.alertCollectQuestion(b,window.location.reload)}})}function addEditorRecommend(a){Zhishi.Ajax.sendRequest("GET",a+"&r="+Math.random(),{onSuccess:function(b){alert(b);window.location.reload()}})}function addEditorPendingRecommend(a){Zhishi.Ajax.sendRequest("GET",a+"&r="+Math.random(),{onSuccess:function(b){alert(b);window.location.reload()}})}function zzQQ(a){zzqqDialog=new Zhishi.Dialog("\u8f6c\u8f7d\u5230QQ\u8d44\u6599\u5361",340,390,true,a);zzqqDialog.show()}var setMyDescription_url="";function updatePersonalDesc(userDesc){var desc=userDesc.value;if(desc.length>100){alert("\u4e2a\u4eba\u8bf4\u660e\u4e0d\u80fd\u8d85\u8fc7100\u5b57。");userDesc.select();return}Zhishi.Ajax.sendRequest("GET",setMyDescription_url+encodeURIComponent(desc),{onSuccess:function(data){var x=eval(data);if(x){alert(x[1])}}})}function ctrlSetDesc(a,b){if(b.ctrlKey&&(b.keyCode==13)){updatePersonalDesc(a)}}function impeach_fun(fm){if(fm.desc.value.length>100){alert("\u68c0\u4e3e\u8bf4\u660e\u4e0d\u80fd\u8d85\u8fc7100\u5b57。");fm.desc.select();return}var sURL="/vote?";var voteValue="";var vVote=fm.vote;for(var i=0;i<fm.vote.length;i++){if(fm.vote[i].checked){voteValue=fm.vote[i].value}}if(voteValue==""){alert("\u8bf7\u9009\u62e9\u68c0\u4e3e\u7c7b\u578b。");return}sURL+=("vote="+voteValue);sURL+=("&qid="+fm.qid.value);sURL+=("&aid="+fm.aid.value);sURL+=("&uid="+fm.uid.value);sURL+=("&sid="+fm.sid.value);sURL+=("&url="+encodeURIComponent(fm.url.value));sURL+=("&desc="+encodeURIComponent(fm.desc.value));Zhishi.Ajax.sendRequest("GET",sURL,{onSuccess:function(data){var rsp=eval(data);if(rsp[0]==1){alert("\u68c0\u4e3e\u6210\u529f，\u6211\u4eec\u4f1a\u5c3d\u5feb\u5904\u7406，\u611f\u8c22\u60a8\u7684\u5173\u6ce8！")}else{alert(rsp[1])}}});window.close()}Zhishi.Validator.AnswerQuestion={clickSubmitButton:false,answerContentRequired:function(){if(Editor.getPlainTextValue().trim()==""&&!Editor.hasImage()){return false}else{return true}},verCodeRequired:function(){if(verCode.form.name=="answerQuestion"){if(verCode.value==""||verCode.value==verCodeTipText){return false}else{return true}}else{if(document.answerSupplementForm.contentSupplement.checked){if(verCode.value==""||verCode.value==verCodeTipText){return false}else{return true}}return true}},supplementContentRequired:function(){if(document.answerSupplementForm&&document.answerSupplementForm.contentSupplement){if(document.answerSupplementForm.contentSupplement.checked){if(Editor.getPlainTextValue().trim()==""&&!Editor.hasImage()){return false}else{document.answerSupplementForm.answerSupplementContent.value=Editor.getValue();document.answerSupplementForm.editorStats.value=Editor.Util.getCountInfo();document.answerSupplementForm.useTime1.value=Editor.Util.getEditorTime()}}}return true},beforeSubmit:function(a){if(a&&a.form&&a.form.name!="answerQuestion"){return true}if(a&&a.id=="myAnswerContent"&&get("verCode")!=null){return true}Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateUrl,{onSuccess:function(c){if(c=="1"){Zhishi.Validator.AnswerQuestion.clickSubmitButton=true;document.answerQuestion.editorStats.value=Editor.Util.getCountInfo();document.answerQuestion.useTime.value=Editor.Util.getEditorTime();document.answerQuestion.myAnswerContent.value=Editor.getValue();document.answerQuestion.submit()}else{if(c=="0"){if(document.answerQuestion.showVerifyCode){document.answerQuestion.showVerifyCode.value="F"}var d=get("answerSubmit");var b=Zhishi.Login.loginList.length;d.setAttribute("wenwenid",b);d.addClassName("login_norefresh");Zhishi.Login.loginList[b]=function(){Zhishi.Validator.AnswerQuestion.clickSubmitButton=true;document.answerQuestion.editorStats.value=Editor.Util.getCountInfo();document.answerQuestion.useTime.value=Editor.Util.getEditorTime();document.answerQuestion.myAnswerContent.value=Editor.getValue();document.answerQuestion.submit()};Zhishi.Login.openLoginDialog(d);return true}}}})}};Zhishi.Validator.AnswerPKQuestion={answerContentRequired:function(){if(Editor.getPlainTextValue().trim()==""&&!Editor.hasImage()){return false}else{return true}},reasonRadioRequiredValidate:function(){var b=document.getElementsByName("reasonOption");if(b&&b.length){for(var a=0;a<b.length;a++){if(b[a].checked){return true}}}get("reasonInput_err_msg").innerHTML="\u8bf7\u60a8\u9009\u62e9\u5b8c\u5584\u7684\u7406\u7531!";get("reasonInput_err_msg").style.display="block";return false},reasonInputRequiredValidate:function(){if($("pk_other").checked){var a=$("reasonInput").value;if(!a){return false}a=a.trim();if(!a||a.length<1){return false}}return true},reasonInputLengthValidate:function(){if($("pk_other").checked){var a=$("reasonInput").value;if(!a){return false}a=a.trim();if(!a||a.length<1||a.length>20){return false}}return true},beforeSubmit:function(a){if(a&&a.form&&a.form.name!="answerPKQuestion"){return true}Zhishi.Ajax.sendRequest("GET",Zhishi.loginStateUrl,{onSuccess:function(c){if(c=="1"){document.answerPKQuestion.myAnswerPKContent.value=Editor.getValue();window.onbeforeunload=function(){};document.answerPKQuestion.submit()}else{if(c=="0"){var d=get("answerPKSubmit");var b=Zhishi.Login.loginList.length;d.setAttribute("wenwenid",b);d.addClassName("login_norefresh");Zhishi.Login.loginList[b]=function(){document.answerPKQuestion.myAnswerPKContent.value=Editor.getValue();window.onbeforeunload=function(){};document.answerPKQuestion.submit()};Zhishi.Login.openLoginDialog(d);return true}}}})}};function focusVerCode(){if(verCode.value==verCodeTipText){verCode.maxLength=4;verCode.value="";verCode.style.color="#000"}}function blurVerCode(){if(verCode.value.trim()==""){verCode.maxLength=6;verCode.value=verCodeTipText;verCode.style.color="#ACA899"}}function supplementStart(){if(supplementTime==0){supplementTime=new Date()}}function supplementEnd(){var a=new Date(),d=0;if(supplementTime!=0){d=a.getTime()-supplementTime.getTime()}d=d<0?0:parseInt(d/1000);document.answerSupplementForm.useTime1.value=d;return true}function answerStart(){if(answerTime==0){answerTime=new Date()}if(!text){return}if(text.value==tipText){text.value=""}text.style.color="#000000"}function answerEnd(){if(answerTime!=0){var a=new Date();var d=a.getTime()-answerTime.getTime();d=d<0?0:parseInt(d/1000);document.answerQuestion.useTime.value=d}}function blurMethod(){if(text&&text.value==""){text.value=tipText;text.style.color="#ACA899"}}function onAnswerSubmit(a,b){if(b.ctrlKey&&b.keyCode==13){document.getElementById(a).click();return false}return true}function initAnswerQuestion(){var b=document.getElementById("answerQuestionDiv");if(!b){return}var a=document.answerQuestion;if(!a){return}if(a.verifyCode&&verCode){verCode=a.verifyCode;blurVerCode();Zhishi.Event.attachEventListener(verCode,"focus",focusVerCode,false);Zhishi.Event.attachEventListener(verCode,"blur",blurVerCode,false)}Editor.init("myAnswerContent",{width:685,height:165,hasStateBar:true,onCtrlEnter:function(){document.getElementById("answerSubmit").click()},toolBar:"answerToolBar"});if(Zhishi.Browser.isIE6&&Editor.getSelf()&&$("answer_text_tips")){$("answer_text_tips").className="text_tips_for_ie6"}if($("meAnswer")){Zhishi.Event.attachEventListener($("meAnswer"),"click",function(){Editor.focus(true)},false)}var c=function(){var f=document.lemmaCreateForm;if(Editor.getSelf()!=null){var d=Editor.getPlainTextValue().trim();var e=Editor.hasImage();if((d!=""||e)&&Editor.id=="myAnswerContent"&&!Zhishi.Validator.AnswerQuestion.clickSubmitButton){return"【\u63d0\u793a】\u672a\u4fdd\u5b58\u7684\u5185\u5bb9\u5c06\u4f1a\u4e22\u5931"}}};if(document.answerQuestion&&document.answerQuestion.myAnswerContent){Editor.setValue(document.answerQuestion.myAnswerContent.value)}window.onbeforeunload=c;Zhishi.TeamCooperate.teamCooperte()}function answerSupplement(){var a=document.getElementById("divAnswerSupplement");a.style.display="block";document.answerSupplementForm.answerSupplementContent.focus()}function initMySupplementContent(){if(!document.answerSupplementForm){return}if(document.answerSupplementForm.answerSupplementContent&&document.answerSupplementForm.answerSupplementContent.value!=""){var b=document.answerSupplementForm.teamId;var a=document.answerSupplementForm.contentSupplement;var c=document.answerSupplementForm.origTableNameS;if((b.value==null||b.value=="")||c.value!="X"){if(a){a.checked=true}}}showMySupplementContent()}function showMySupplementContent(){var b=null;var a=document.getElementById("answerQuestionDiv");if(document.answerSupplementForm){b=document.answerSupplementForm.supplementSubmit;if(document.answerSupplementForm.verifyCode1&&verCode){verCode=document.answerSupplementForm.verifyCode1;blurVerCode();Zhishi.Event.attachEventListener(verCode,"focus",focusVerCode,false);Zhishi.Event.attachEventListener(verCode,"blur",blurVerCode,false)}}if(document.answerSupplementForm&&document.answerSupplementForm.contentSupplement){if(document.answerSupplementForm.contentSupplement.checked){document.getElementById("showSC").style.display="block";if(b!=null){b.disabled=false}var c=Editor.getSelf();if(c!=null){if(c.id=="myAnswerContent"&&document.answerQuestion&&document.answerQuestion.myAnswerContent){document.answerQuestion.myAnswerContent.value=Editor.getValue()}c.parentNode.removeChild(c)}if(a){a.style.display="none"}Editor.init("answerSupplementContent",{width:658,height:165,hasStateBar:true,onCtrlEnter:function(){document.getElementById("supplementSubmit").click()},toolBar:"answerToolBar"});if(Zhishi.Browser.isIE6&&Editor.getSelf()&&$("supplementAnswer_text_tips")){$("supplementAnswer_text_tips").className="text_tips_for_ie6"}if(document.answerSupplementForm.answerSupplementContent){Editor.setValue(document.answerSupplementForm.answerSupplementContent.value)}setTimeout(Editor.focus,100)}else{document.getElementById("showSC").style.display="none";var c=Editor.getSelf();if(c!=null){if(c.id=="answerSupplementContent"){document.answerSupplementForm.answerSupplementContent.value=Editor.getValue()}c.parentNode.removeChild(c)}setTimeout(function(){window.focus()},10);if(a){a.style.display="block";initAnswerQuestion()}}}checkIsDisabled()}function initAnswerPKQuestion(){Editor.init("myAnswerPKContent",{width:685,height:165,hasStateBar:true,onCtrlEnter:function(){document.getElementById("answerPKSubmit").click()}});if(Zhishi.Browser.isIE6&&Editor.getSelf()&&$("answerpk_text_tips")){$("answerpk_text_tips").className="text_tips_for_ie6"}var a=function(){if(Editor.getSelf()!=null){var b=Editor.getPlainTextValue().trim();var c=Editor.hasImage();if((b!=""||c)&&Editor.id=="myAnswerPKContent"){return"【\u63d0\u793a】\u672a\u4fdd\u5b58\u7684\u5185\u5bb9\u5c06\u4f1a\u4e22\u5931"}}};window.onbeforeunload=a;Editor.focus()}function checkIsDisabled(){var a=null;if(document.answerSupplementForm){a=document.answerSupplementForm.supplementSubmit}if(a==null){return}if(document.answerSupplementForm.contentSupplement!=null){if(document.answerSupplementForm.contentSupplement.checked){a.disabled=false;return}}if(document.answerSupplementForm.anonymousSupplement!=null){if(document.answerSupplementForm.anonymousSupplement.checked){a.disabled=false;return}else{a.disabled=true;return}}else{a.disabled=true;return}}function initSupplementQuestion(){var b=document.getElementsByTagName("input");for(var a=0;a<b.length;a++){if(b[a].type=="checkbox"&&b[a].id.indexOf("checkAnswerPanel")==0){checkboxList.push(b[a])}else{if(b[a].type=="button"){b[a].disabled=false;buttonList.push(b[a])}}}if(document.supplementQuestion&&document.supplementQuestion.mySupplementContent!=null&&document.supplementQuestion.mySupplementContent.value!=""){if(document.supplementQuestion.contentSupplement){document.supplementQuestion.contentSupplement.checked=true}}showSupplementQuestionContent();toggleCheckBoxExceptThis()}Zhishi.Validator.SupplementQuestion={supplementContentRequired:function(){var a=document.supplementQuestion;if(a.contentSupplement&&a.contentSupplement.checked){if(Editor.id=="mySupplementContent"&&(Editor.getPlainTextValue().trim()==""&&!Editor.hasImage())){a.mySupplementContent.value="";return false}}return true},setSupplementQuestion:function(){if(Editor.id=="mySupplementContent"){document.supplementQuestion.mySupplementContent.value=Editor.getValue();document.supplementQuestion.editorStats.value=Editor.Util.getCountInfo()}return true}};function toggleCheckBoxExceptThis(g,e){for(var d=0;d<checkboxList.length;d++){if(g&&checkboxList[d].id.indexOf(g)>0){continue}if(checkboxList[d].checked){var f=checkboxList[d].id.substr(16);checkboxList[d].checked=false;hideFollowPanel(f)}}if(e!=null){var b="b"+e;for(var c=0;c<buttonList.length;c++){if(buttonList[c].id!=b){var a=buttonList[c];if(a!=null&&a.value=="\u91c7\u7eb3\u4e3a\u7b54\u6848"&&a.disabled==true){a.disabled=false}}}}}function showSupplementQuestionContent(){if(document.supplementQuestion==null){return}var a=document.supplementQuestion.supplementSubmit;if(document.supplementQuestion&&document.supplementQuestion.contentSupplement){toggleCheckBoxExceptThis();if(document.supplementQuestion.contentSupplement.checked){document.getElementById("showSC").style.display="block";if(a!=null){a.disabled=false}var b=Editor.getSelf();if(b!=null){b.parentNode.removeChild(b)}Editor.init("mySupplementContent",{width:658,height:165,hasStateBar:true,onCtrlEnter:function(){document.getElementById("supplementSubmit").click()}});if(Zhishi.Browser.isIE6&&Editor.getSelf()&&$("supplementQuestion_text_tips")){$("supplementQuestion_text_tips").className="text_tips_for_ie6"}setTimeout(Editor.focus,100)}else{document.getElementById("showSC").style.display="none";var b=Editor.getSelf();if(b!=null){document.supplementQuestion.mySupplementContent.value=Editor.getValue();b.parentNode.removeChild(b)}setTimeout(function(){window.focus()},10)}}checkIsSupplementQuestionDisabled()}function checkIsSupplementQuestionDisabled(){var a=document.supplementQuestion.supplementSubmit;if(a==null){return}if(document.supplementQuestion.contentSupplement!=null){if(document.supplementQuestion.contentSupplement.checked){a.disabled=false;return}}if(document.supplementQuestion.offerSupplement!=null){if(document.supplementQuestion.offerSupplement.checked){a.disabled=false;return}}if(document.supplementQuestion.broadcastSupplement!=null){if(document.supplementQuestion.broadcastSupplement.checked){a.disabled=false;return}}if(document.supplementQuestion.anonymousSupplement!=null){if(document.supplementQuestion.anonymousSupplement.checked){a.disabled=false;return}else{a.disabled=true;return}}else{a.disabled=true;return}}function getDisabled(){return document.supplementQuestion.supplementSubmit.disabled}function setCookie(b,c,a){var d=new Date();d.setDate(d.getDate()+a);document.cookie=b+"="+escape(c)+((a==null)?"":";expires="+d.toGMTString())}function getCookie(a){if(document.cookie.length>0){c_start=document.cookie.indexOf(a+"=");if(c_start!=-1){c_start=c_start+a.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1){c_end=document.cookie.length}return unescape(document.cookie.substring(c_start,c_end))}}return""}var getShowNum=function(a){try{return new Number(document.getElementById(a).innerHTML)}catch(b){return 0}};var getExpectedNum=function(a){try{return new Number(getCookie("ww_"+a))}catch(b){return 0}};var setExpectedNum=function(a,b){setCookie("ww_"+a,b)};var _show="";var goodOrBad=0;var showResult=function(rstMsg){if(_show){var area=get(_show);area.setStyle("opacity",100);var rsp=null;try{rsp=eval(rstMsg)}catch(e){rsp=eval(this.errMsg)}if(rsp!=null){var code=rsp[0];var msg=rsp[1];area.innerHTML=msg;area.style.display="block";if(code==0){try{var cid=area.id+goodOrBad;var num=parseInt(getExpectedNum(cid),10);setExpectedNum(cid,(num+addNumber));expectNum(cid)}catch(e){}}else{if(code==2){window.location.href=loginUrl}}}window.setTimeout(function(){var e=new Zhishi.Effect(area,"opacity","100","0",1);e.start()},1000)}};var evaluateAnswer=function(c,d,a){if(a){var b=a+d;setExpectedNum(b,Math.max(getShowNum(b),getExpectedNum(b)));goodOrBad=d;_show=a;if(c){new WenwenAjaxEvent(c,showResult).notify()}}};var expectNum=function(a){try{document.getElementById(a).innerHTML=Math.max(getShowNum(a),getExpectedNum(a))}catch(b){}};function followAskEnd(b){if(null==b){return}var c=b.id.substring(3);ansAuthorId=c.split("_")[0];if(Editor.getPlainTextValue().trim()==""&&!Editor.hasImage()){var d=get("errors"+ansAuthorId);if(null!=d){d.overwriteClassName("field_err");d.innerHTML="\u60a8\u8fd8\u6ca1\u6709\u8f93\u5165\u4efb\u4f55\u5185\u5bb9！";d.style.display="block"}Editor.focus()}else{var e=Editor.Util.getEditorTime();var f=c.split("_")[1];var j=Editor.getValue();j=nomalizeText(j);j=j.replace(/[^\u0000-\u00FF]/g,function(k){return escape(k).replace(/(%u)(\w{4})/gi,"\\u$2")});var h=Editor.Util.getCountInfo();var a=["{",'userId:"',uin,'",userName:','""',",toUserId:",'"',ansAuthorId,'"',",questionId:",questionId,",seconds:",e,",replyId:",f,',origTableName:"',faOrigTableName,'",editorStats:"',h,'",origTmpId:',faOrigTmpId,',content:"',j,'"}'].join("");var g="api/answer/follow?format=json";var i={onSuccess:postCallBack,para:b,contentType:"application/json; charset=UTF-8",postdata:a,raw:true};Zhishi.Ajax.sendRequest("POST",g,i)}return false}function displayResult(){resetFollowErrorTip("errors"+ansAuthorId);var a=$("answerFrame"+ansAuthorId);var b=$("checkAnswerPanel"+ansAuthorId);var c=$("text"+ansAuthorId);c.value="";a.style.display="none";b.checked=false}function postCallBack(jsonData,o){var json=eval("("+jsonData+")");if(json.success){document.location="FollowComplete.e?sp="+questionId}else{var tempIds=o.id.substring(3);ansAuthorId=tempIds.split("_")[0];var errorO=$("errors"+ansAuthorId);errorO.innerHTML=json.message;errorO.overwriteClassName("field_err");errorO.style.display="block";Editor.focus()}}function toggleAnswerPanel(h,f){var b=null;if(f!=null){b=document.getElementById("b"+f)}toggleCheckBoxExceptThis(h,f);if($("contentSupplement")&&$("contentSupplement").checked){$("contentSupplement").checked=false;document.getElementById("showSC").style.display="none";var d=Editor.getSelf();if(d!=null){document.supplementQuestion.mySupplementContent.value=Editor.getValue();d.parentNode.removeChild(d)}setTimeout(function(){window.focus()},10)}var e=$("checkAnswerPanel"+h);var g="text"+h;var c=$("answerFrame"+h);if(e.checked){if(b!=null&&b.disabled==false){b.disabled=true}c.style.display="block";var a=$(g);if(a!=null){var d=Editor.getSelf();if(d!=null){d.parentNode.removeChild(d)}Editor.init(g,{width:658,height:165,hasStateBar:true});if(Zhishi.Browser.isIE6&&Editor.getSelf()&&$("follow_text_tips"+h)){$("follow_text_tips"+h).className="text_tips_for_ie6"}setTimeout(Editor.focus,100)}setTimeout(function(){resetFollowErrorTip("errors"+h)},0)}else{if(b!=null&&b.value=="\u91c7\u7eb3\u4e3a\u7b54\u6848"){b.disabled=false}hideFollowPanel(h)}}function hideFollowPanel(b){resetFollowErrorTip("errors"+b);$("answerFrame"+b).style.display="none";var a=Editor.getSelf();if(a!=null){$("text"+b).value=Editor.getValue();a.parentNode.removeChild(a);$("checkAnswerPanel"+b).checked=false}setTimeout(function(){window.focus()},10)}function resetFollowErrorTip(b){var a=get(b);if(null!=a){a.overwriteClassName("pump_tips");a.innerHTML='\u5bf9\u540c\u4e00\u56de\u7b54\u8005\u7684\u8ffd\u95ee\u8d85\u8fc73\u6b21\u540e\u6bcf\u6b21\u5c06\u6d88\u801710\u79ef\u5206  <a href="http://cache.soso.com/wenwen/help/help_ask_03.htm" target="_blank">\u4e86\u89e3\u8be6\u60c5</a>';a.style.display="block"}}function nomalizeText(a){a=a.replace(/\\/g,"\\\\");a=a.replace(/\"/g,'\\"');a=a.replace(/\r/g,"\\r");a=a.replace(/\n/g,"\\n");return a}var rateTips=["(\u6162)","(\u8f83\u6162)","(\u4e00\u822c)","(\u8f83\u5feb)","(\u5f88\u5feb)"];var attiTips=["(\u6577\u884d)","(\u8f83\u6577\u884d)","(\u4e00\u822c)","(\u8f83\u8ba4\u771f)","(\u5f88\u8ba4\u771f)"];Zhishi.SelectBestAnswer={bestAnswerHasSelectOne:false,bestAnswerHasSelectTwo:false,answerId:0,answerNum:0,width:401,height:362,giftHeight:168,bestAnswerDialog:null,solvedType:0,originalType:0,rateIndex:0,attiIndex:0,rateDivs:null,attiDivs:null,rateTip:null,attiTip:null,firstAnswerId:0,init:function(a){Zhishi.SelectBestAnswer.bestAnswerHasSelectOne=false;Zhishi.SelectBestAnswer.bestAnswerHasSelectTwo=false;Zhishi.SelectBestAnswer.firstAnswerId=0;Zhishi.SelectBestAnswer.answerNum=a;Zhishi.SelectBestAnswer.answerId=0;Zhishi.SelectBestAnswer.width=401;Zhishi.SelectBestAnswer.height=362;Zhishi.SelectBestAnswer.giftHeight=168;Zhishi.SelectBestAnswer.bestAnswerDialog=null;Zhishi.SelectBestAnswer.rateIndex="0";Zhishi.SelectBestAnswer.attiIndex="0";document.bestAnswerForm.bestAnswerId1.value="0";document.bestAnswerForm.bestAnswerStarLevel1.value="0";document.bestAnswerForm.bestAnswerMsg1.value="S";document.bestAnswerForm.bestAnswerGift1.value="0";document.bestAnswerForm.originalType1.value="0";document.bestAnswerForm.solvedType1.value="0";document.bestAnswerForm.authorRate1.value="0";document.bestAnswerForm.authorAttitude1.value="0";document.bestAnswerForm.bestAnswerId2.value="0";document.bestAnswerForm.bestAnswerStarLevel2.value="0";document.bestAnswerForm.bestAnswerMsg2.value="S";document.bestAnswerForm.bestAnswerGift2.value="0";document.bestAnswerForm.originalType2.value="0";document.bestAnswerForm.solvedType2.value="0";document.bestAnswerForm.authorRate2.value="0";document.bestAnswerForm.authorAttitude2.value="0"},updateSolvedType:function(a){Zhishi.SelectBestAnswer.solvedType=a},updateOriginalType:function(a){Zhishi.SelectBestAnswer.originalType=a},initRateEvent:function(){Zhishi.SelectBestAnswer.rateIndex="0";var d=document.chooseStarForm;var c=d.getElementsByTagName("DIV");var b=d.getElementsByTagName("SPAN");if(c){Zhishi.SelectBestAnswer.rateDivs=new Array();for(var a=0;a<c.length;a++){if(c[a]&&c[a].className.indexOf(" ratestar")>0){Zhishi.SelectBestAnswer.rateDivs.push(c[a])}}}if(b){for(var a=0;a<b.length;a++){if(b[a]&&b[a].className.indexOf(" ratestar")>0){Zhishi.SelectBestAnswer.rateTip=b[a];break}}}if(Zhishi.SelectBestAnswer.rateDivs){for(var a=0;a<Zhishi.SelectBestAnswer.rateDivs.length;a++){if(Zhishi.SelectBestAnswer.rateDivs[a]){Zhishi.Event.attachEventListener(Zhishi.SelectBestAnswer.rateDivs[a],"click",Zhishi.SelectBestAnswer.clickRate.bind(null,get(Zhishi.SelectBestAnswer.rateDivs[a]).id),false)}Zhishi.Event.attachEventListener(Zhishi.SelectBestAnswer.rateDivs[a],"mouseover",Zhishi.SelectBestAnswer.mouseoverRate.bind(null,get(Zhishi.SelectBestAnswer.rateDivs[a]).id),false);Zhishi.Event.attachEventListener(Zhishi.SelectBestAnswer.rateDivs[a],"mouseout",Zhishi.SelectBestAnswer.mouseoutRate.bind(null,get(Zhishi.SelectBestAnswer.rateDivs[a]).id),false)}Zhishi.SelectBestAnswer.defaultRate()}},initAttiEvent:function(){Zhishi.SelectBestAnswer.attiIndex="0";var d=document.chooseStarForm;var c=d.getElementsByTagName("DIV");var b=d.getElementsByTagName("SPAN");if(c){Zhishi.SelectBestAnswer.attiDivs=new Array();for(var a=0;a<c.length;a++){if(c[a]){if(c[a]&&c[a].className.indexOf(" attistar")>0){Zhishi.SelectBestAnswer.attiDivs.push(c[a])}}}}if(b){for(var a=0;a<b.length;a++){if(b[a]&&b[a].className.indexOf(" attistar")>0){Zhishi.SelectBestAnswer.attiTip=b[a];break}}}if(Zhishi.SelectBestAnswer.attiDivs){for(var a=0;a<Zhishi.SelectBestAnswer.attiDivs.length;a++){Zhishi.Event.attachEventListener(Zhishi.SelectBestAnswer.attiDivs[a],"click",Zhishi.SelectBestAnswer.clickAtti.bind(null,get(Zhishi.SelectBestAnswer.attiDivs[a]).id),false);Zhishi.Event.attachEventListener(Zhishi.SelectBestAnswer.attiDivs[a],"mouseover",Zhishi.SelectBestAnswer.mouseoverAtti.bind(null,get(Zhishi.SelectBestAnswer.attiDivs[a]).id),false);Zhishi.Event.attachEventListener(Zhishi.SelectBestAnswer.attiDivs[a],"mouseout",Zhishi.SelectBestAnswer.mouseoutAtti.bind(null,get(Zhishi.SelectBestAnswer.attiDivs[a]).id),false)}}Zhishi.SelectBestAnswer.defaultAtti()},clickRate:function(a){if(a){Zhishi.SelectBestAnswer.rateIndex=a;Zhishi.SelectBestAnswer.setRate(a)}},mouseoverRate:function(a){if(a){Zhishi.SelectBestAnswer.setRate(a)}},mouseoutRate:function(a){if(a){Zhishi.SelectBestAnswer.setRate(Zhishi.SelectBestAnswer.rateIndex)}},clickAtti:function(a){if(a){Zhishi.SelectBestAnswer.attiIndex=a;Zhishi.SelectBestAnswer.setAtti(a)}},mouseoverAtti:function(a){if(a){Zhishi.SelectBestAnswer.setAtti(a)}},mouseoutAtti:function(a){if(a){Zhishi.SelectBestAnswer.setAtti(Zhishi.SelectBestAnswer.attiIndex)}},setRate:function(b){Zhishi.SelectBestAnswer.defaultRate();if(b>=1&&b<=5){for(var a=0;a<b;a++){Zhishi.SelectBestAnswer.rateDivs[a].className="ico_star";if(Zhishi.SelectBestAnswer.rateTip){Zhishi.SelectBestAnswer.rateTip.style.display="block";Zhishi.SelectBestAnswer.rateTip.innerHTML=rateTips[a]}}}},setAtti:function(b){Zhishi.SelectBestAnswer.defaultAtti();if(b>=1&&b<=5){for(var a=0;a<b;a++){Zhishi.SelectBestAnswer.attiDivs[a].className="ico_star";if(Zhishi.SelectBestAnswer.attiTip){Zhishi.SelectBestAnswer.attiTip.style.display="block";Zhishi.SelectBestAnswer.attiTip.innerHTML=attiTips[a]}}}},defaultRate:function(){if(Zhishi.SelectBestAnswer.rateDivs){for(var a=0;a<=4;a++){Zhishi.SelectBestAnswer.rateDivs[a].className="ico_gray_star"}}if(Zhishi.SelectBestAnswer.rateTip){Zhishi.SelectBestAnswer.rateTip.style.display="none"}},defaultAtti:function(){if(Zhishi.SelectBestAnswer.attiDivs){for(var a=0;a<=4;a++){Zhishi.SelectBestAnswer.attiDivs[a].className="ico_gray_star"}}if(Zhishi.SelectBestAnswer.attiTip){Zhishi.SelectBestAnswer.attiTip.style.display="none"}},getGiftItems:function(){var e=document.chooseStarForm;var c=e.getElementsByTagName("li");var b=new Array();if(c){for(var d=0;d<c.length;d++){var a=c[d];if(a.className&&(" "+a.className+" ").indexOf(" gift_item ")>=0){b.push(a)}}}return b},initChooseGiftEvent:function(){var b=Zhishi.SelectBestAnswer.getGiftItems();if(!b){return false}for(var c=0;c<b.length;c++){var a=b[c];Zhishi.SelectBestAnswer.clickGiftEvent=Zhishi.SelectBestAnswer.clickGift.bind(a);Zhishi.Event.attachEventListener(a,"click",Zhishi.SelectBestAnswer.clickGiftEvent,false);if(Zhishi.Browser.isIE6){Zhishi.SelectBestAnswer.mouseOverGiftEvent=Zhishi.SelectBestAnswer.mouseOverGift.bind(a);Zhishi.SelectBestAnswer.mouseOutGiftEvent=Zhishi.SelectBestAnswer.mouseOutGift.bind(a);Zhishi.Event.attachEventListener(a,"mouseover",Zhishi.SelectBestAnswer.mouseOverGiftEvent,false);Zhishi.Event.attachEventListener(a,"mouseout",Zhishi.SelectBestAnswer.mouseOutGiftEvent,false)}}return true},isSelectGift:function(a){if(a.className&&(" "+a.className+" ").indexOf(" selected ")>=0){return true}else{return false}},selectGift:function(c,a){if(a){get(c).addClassName("selected");var b=c.getElementsByTagName("div");if(b&&b.length>0){get(b[0]).addClassName("select")}}else{get(c).removeClassName("selected");var b=c.getElementsByTagName("div");if(b&&b.length>0){get(b[0]).removeClassName("select")}}},clickGift:function(){var b=Zhishi.SelectBestAnswer.getGiftItems();if(!b){return false}for(var c=0;c<b.length;c++){var a=b[c];if(a==this){if(Zhishi.SelectBestAnswer.isSelectGift(a)){Zhishi.SelectBestAnswer.selectGift(a,false)}else{Zhishi.SelectBestAnswer.selectGift(a,true)}}else{Zhishi.SelectBestAnswer.selectGift(a,false)}}return false},mouseOverGift:function(){get(this).addClassName("gift_hover")},mouseOutGift:function(){get(this).removeClassName("gift_hover")},clickGiftEvent:function(){},mouseOverGiftEvent:function(){},mouseOutGiftEvent:function(){},getGiftDiv:function(e){var c=document.chooseStarForm;var b=c.getElementsByTagName("div");if(b){for(var a=0;a<b.length;a++){var d=b[a];if(d.id==e){return d}}}},expandGifts:function(){var d=Zhishi.SelectBestAnswer.getGiftDiv("collapseGift");var b=Zhishi.SelectBestAnswer.getGiftDiv("expandGift");if(!d||!b){return false}get(d).hide();get(b).show();var c=Zhishi.SelectBestAnswer.width;var a=Zhishi.SelectBestAnswer.height+Zhishi.SelectBestAnswer.giftHeight;Zhishi.SelectBestAnswer.bestAnswerDialog.resize(c,a);return false},collapseGifts:function(){var d=Zhishi.SelectBestAnswer.getGiftDiv("collapseGift");var b=Zhishi.SelectBestAnswer.getGiftDiv("expandGift");if(!b||!d){return false}get(b).hide();get(d).show();var c=Zhishi.SelectBestAnswer.width;var a=Zhishi.SelectBestAnswer.height;Zhishi.SelectBestAnswer.bestAnswerDialog.resize(c,a);return false},click:function(e){if(!e||e<=0){return}if(Zhishi.SelectBestAnswer.answerNum<=0){return}Zhishi.SelectBestAnswer.answerId=e;var b=document.getElementById("choose_button");if(!b){return}if(!Zhishi.SelectBestAnswer.bestAnswerHasSelectOne&&Zhishi.SelectBestAnswer.answerNum>1){Zhishi.SelectBestAnswer.firstAnswerId=Zhishi.SelectBestAnswer.answerId;b.innerHTML=document.getElementById("choose_one").innerHTML;Zhishi.SelectBestAnswer.height=385;var c=Zhishi.SelectBestAnswer.width;var a=Zhishi.SelectBestAnswer.height;var d='<form name="chooseStarForm" onsubmit="return false;">';d+=document.getElementById("selectBestAnswerTemplate").innerHTML;d+="</form>";Zhishi.SelectBestAnswer.bestAnswerDialog=new Zhishi.Dialog("\u91c7\u7eb3\u6ee1\u610f\u7b54\u6848",c,a,false,d);Zhishi.SelectBestAnswer.bestAnswerDialog.afterClose=function(){var g=document.chooseStarForm;g.parentNode.removeChild(g)};Zhishi.SelectBestAnswer.bestAnswerDialog.show();Zhishi.SelectBestAnswer.initChooseGiftEvent();Zhishi.SelectBestAnswer.initRateEvent();Zhishi.SelectBestAnswer.initAttiEvent()}else{if(Zhishi.SelectBestAnswer.bestAnswerHasSelectOne&&!Zhishi.SelectBestAnswer.bestAnswerHasSelectTwo){b.innerHTML=document.getElementById("choose_three").innerHTML;Zhishi.SelectBestAnswer.height=160;var c=Zhishi.SelectBestAnswer.width;var a=Zhishi.SelectBestAnswer.height;var d='<form name="chooseStarForm" onsubmit="return false;">';d+='<div style="height:40px;margin-top:15px;">';d+='<span style="float:left;background:url(http://cache.soso.com/wenwen/i/icon_ok.png) no-repeat; display:inline-block;width:38px; height:40px; margin:0 10px 0 30px;"></span><p style=" float:left;line-height:40px; font-size:14px;">\u5df2\u91c7\u7eb3\u6b64\u7b54\u6848，\u4f60\u8fd8\u53ef\u4ee5\u7ee7\u7eed\u91c7\u7eb3\u4e00\u4e2a\u7b54\u6848</p>';d+="</div>";d+='<div style="padding-top: 25px; text-align:center;">';d+='<span ch="w.next.an"><input type="button" class="login_require login_norefresh"  value="\u7ee7\u7eed\u91c7\u7eb3\u7b2c\u4e8c\u4e2a" name="button" style="margin: 0 4px; width: 120px; height: 28px; font-size: 14px; line-height: 23px;" onclick="Zhishi.SelectBestAnswer.selectSecond()"></span>';d+='<input type="button"  value="\u91c7\u7eb3\u5b8c\u6210" name="button2" style="margin: 0 4px; width: 100px; height: 28px; font-size: 14px; line-height: 23px;" onclick="Zhishi.SelectBestAnswer.selectFinish()">';d+="</div>";d+="</form>";Zhishi.SelectBestAnswer.bestAnswerDialog=new Zhishi.Dialog("\u7ee7\u7eed\u91c7\u7eb3\u6ee1\u610f\u7b54\u6848",c,a,false,d,{isNeedClose:false});Zhishi.SelectBestAnswer.bestAnswerDialog.afterClose=function(){var g=document.chooseStarForm;g.parentNode.removeChild(g)};Zhishi.SelectBestAnswer.bestAnswerDialog.show()}else{b.innerHTML=document.getElementById("choose_two").innerHTML;Zhishi.SelectBestAnswer.height=368;var c=Zhishi.SelectBestAnswer.width;var a=Zhishi.SelectBestAnswer.height;var d='<form name="chooseStarForm" onsubmit="return false;">';d+=document.getElementById("selectBestAnswerTemplate").innerHTML;d+="</form>";Zhishi.SelectBestAnswer.bestAnswerDialog=new Zhishi.Dialog("\u91c7\u7eb3\u6ee1\u610f\u7b54\u6848",c,a,false,d);Zhishi.SelectBestAnswer.bestAnswerDialog.afterClose=function(){var g=document.chooseStarForm;g.parentNode.removeChild(g)};Zhishi.SelectBestAnswer.bestAnswerDialog.show();Zhishi.SelectBestAnswer.initChooseGiftEvent();Zhishi.SelectBestAnswer.initRateEvent();Zhishi.SelectBestAnswer.initAttiEvent()}}},getGiftId:function(){var b=Zhishi.SelectBestAnswer.getGiftItems();if(!b){return 0}for(var c=0;c<b.length;c++){var a=b[c];if(Zhishi.SelectBestAnswer.isSelectGift(a)){return a.id.substr(4)}}return 0},validateInput:function(){var a=document.chooseStarForm;if(a.thankswords.value.length>40){alert("\u60a8\u8f93\u5165\u7684\u611f\u8a00\u8d85\u8fc740\u5b57，\u8bf7\u4fee\u6539！");a.thankswords.focus();a.thankswords.select();return false}if(Zhishi.SelectBestAnswer.answerId<=0){alert("\u9009\u62e9\u6ee1\u610f\u7b54\u6848\u9519\u8bef!");return false}return true},getStartlevel:function(){var c=document.chooseStarForm;if(c.starLevel){var b=c.starLevel.length;for(var a=0;a<b;a++){if(c.starLevel[a].checked){return c.starLevel[a].value}}}return 3},selectFirst:function(){var b=document.chooseStarForm;if(!Zhishi.SelectBestAnswer.validateInput()){return false}document.bestAnswerForm.bestAnswerId1.value=Zhishi.SelectBestAnswer.answerId;document.bestAnswerForm.bestAnswerStarLevel1.value=Zhishi.SelectBestAnswer.getStartlevel();document.bestAnswerForm.bestAnswerMsg1.value="S"+b.thankswords.value;document.bestAnswerForm.bestAnswerGift1.value=Zhishi.SelectBestAnswer.getGiftId();document.bestAnswerForm.originalType1.value=Zhishi.SelectBestAnswer.originalType;document.bestAnswerForm.solvedType1.value=Zhishi.SelectBestAnswer.solvedType;document.bestAnswerForm.authorRate1.value=Zhishi.SelectBestAnswer.rateIndex;document.bestAnswerForm.authorAttitude1.value=Zhishi.SelectBestAnswer.attiIndex;Zhishi.SelectBestAnswer.originalType="0";Zhishi.SelectBestAnswer.solvedType="0";Zhishi.SelectBestAnswer.rateIndex="0";Zhishi.SelectBestAnswer.attiIndex="0";var a=document.getElementById("b"+Zhishi.SelectBestAnswer.answerId);if(a){a.value="\u5df2\u88ab\u91c7\u7eb3";a.disabled=true}Zhishi.SelectBestAnswer.bestAnswerHasSelectOne=true;Zhishi.SelectBestAnswer.bestAnswerDialog.close();Zhishi.SelectBestAnswer.click(Zhishi.SelectBestAnswer.answerId)},selectCancel:function(){Zhishi.SelectBestAnswer.bestAnswerDialog.close()},selectSecond:function(){Zhishi.SelectBestAnswer.bestAnswerHasSelectTwo=true;var b='<span class="icon_ok2"></span>\u8be5\u7b54\u6848\u5df2\u88ab\u91c7\u7eb3，\u8bf7\u7ee7\u7eed\u91c7\u7eb3\u7b2c\u4e8c\u4e2a\u7b54\u6848。';var a=document.createElement("span");a.innerHTML=b;a.className="tip";get("b"+Zhishi.SelectBestAnswer.firstAnswerId).insertAfter(a);Zhishi.SelectBestAnswer.bestAnswerDialog.close()},selectFinish:function(){Zhishi.SelectBestAnswer.bestAnswerDialog.close();Zhishi.SelectBestAnswer.submit()},selectOnlyOne:function(){var a=document.chooseStarForm;if(!Zhishi.SelectBestAnswer.validateInput()){return false}document.bestAnswerForm.bestAnswerId1.value=Zhishi.SelectBestAnswer.answerId;document.bestAnswerForm.bestAnswerStarLevel1.value=Zhishi.SelectBestAnswer.getStartlevel();document.bestAnswerForm.bestAnswerMsg1.value="S"+a.thankswords.value;document.bestAnswerForm.bestAnswerGift1.value=Zhishi.SelectBestAnswer.getGiftId();document.bestAnswerForm.originalType1.value=Zhishi.SelectBestAnswer.originalType;document.bestAnswerForm.solvedType1.value=Zhishi.SelectBestAnswer.solvedType;document.bestAnswerForm.authorRate1.value=Zhishi.SelectBestAnswer.rateIndex;document.bestAnswerForm.authorAttitude1.value=Zhishi.SelectBestAnswer.attiIndex;document.bestAnswerForm.bestAnswerId2.value="0";document.bestAnswerForm.bestAnswerStarLevel2.value="0";document.bestAnswerForm.bestAnswerMsg2.value="S";document.bestAnswerForm.bestAnswerGift2.value="0";document.bestAnswerForm.originalType2.value="0";document.bestAnswerForm.solvedType2.value="0";document.bestAnswerForm.authorRate2.value="0";document.bestAnswerForm.authorAttitude2.value="0";document.getElementById("b"+Zhishi.SelectBestAnswer.answerId).disabled=true;Zhishi.SelectBestAnswer.bestAnswerDialog.close();Zhishi.SelectBestAnswer.submit()},selectMore:function(){var b=document.chooseStarForm;if(!Zhishi.SelectBestAnswer.validateInput()){return false}document.bestAnswerForm.bestAnswerId1.value=Zhishi.SelectBestAnswer.answerId;document.bestAnswerForm.bestAnswerStarLevel1.value=Zhishi.SelectBestAnswer.getStartlevel();document.bestAnswerForm.bestAnswerMsg1.value="S"+b.thankswords.value;document.bestAnswerForm.bestAnswerGift1.value=Zhishi.SelectBestAnswer.getGiftId();document.bestAnswerForm.originalType1.value=Zhishi.SelectBestAnswer.originalType;document.bestAnswerForm.solvedType1.value=Zhishi.SelectBestAnswer.solvedType;document.bestAnswerForm.authorRate1.value=Zhishi.SelectBestAnswer.rateIndex;document.bestAnswerForm.authorAttitude1.value=Zhishi.SelectBestAnswer.attiIndex;Zhishi.SelectBestAnswer.originalType="0";Zhishi.SelectBestAnswer.solvedType="0";Zhishi.SelectBestAnswer.rateIndex="0";Zhishi.SelectBestAnswer.attiIndex="0";var a=document.getElementById("b"+Zhishi.SelectBestAnswer.answerId);if(a){a.value="\u5df2\u88ab\u91c7\u7eb3";a.disabled=true}Zhishi.SelectBestAnswer.bestAnswerHasSelectOne=true;Zhishi.SelectBestAnswer.bestAnswerDialog.close()},selectComplete:function(){var a=document.chooseStarForm;if(!Zhishi.SelectBestAnswer.validateInput()){return false}if(!Zhishi.SelectBestAnswer.bestAnswerHasSelectOne||Zhishi.SelectBestAnswer.answerNum<=1){document.bestAnswerForm.bestAnswerId1.value=Zhishi.SelectBestAnswer.answerId;document.bestAnswerForm.bestAnswerStarLevel1.value=Zhishi.SelectBestAnswer.getStartlevel();document.bestAnswerForm.bestAnswerMsg1.value="S"+a.thankswords.value;document.bestAnswerForm.bestAnswerGift1.value=Zhishi.SelectBestAnswer.getGiftId();document.bestAnswerForm.originalType1.value=Zhishi.SelectBestAnswer.originalType;document.bestAnswerForm.solvedType1.value=Zhishi.SelectBestAnswer.solvedType;document.bestAnswerForm.authorRate1.value=Zhishi.SelectBestAnswer.rateIndex;document.bestAnswerForm.authorAttitude1.value=Zhishi.SelectBestAnswer.attiIndex}else{document.bestAnswerForm.bestAnswerId2.value=Zhishi.SelectBestAnswer.answerId;document.bestAnswerForm.bestAnswerStarLevel2.value=Zhishi.SelectBestAnswer.getStartlevel();document.bestAnswerForm.bestAnswerMsg2.value="S"+a.thankswords.value;document.bestAnswerForm.bestAnswerGift2.value=Zhishi.SelectBestAnswer.getGiftId();document.bestAnswerForm.originalType2.value=Zhishi.SelectBestAnswer.originalType;document.bestAnswerForm.solvedType2.value=Zhishi.SelectBestAnswer.solvedType;document.bestAnswerForm.authorRate2.value=Zhishi.SelectBestAnswer.rateIndex;document.bestAnswerForm.authorAttitude2.value=Zhishi.SelectBestAnswer.attiIndex}document.getElementById("b"+Zhishi.SelectBestAnswer.answerId).disabled=true;Zhishi.SelectBestAnswer.rateIndex="0";Zhishi.SelectBestAnswer.attiIndex="0";Zhishi.SelectBestAnswer.originalType="0";Zhishi.SelectBestAnswer.solvedType="0";Zhishi.SelectBestAnswer.bestAnswerDialog.close();Zhishi.SelectBestAnswer.submit()},submit:function(){document.bestAnswerForm.submit()}};Zhishi.TeamCooperate={showTeamMemberDialog:null,teamCooperte:function(){var a=document.answerQuestion.teamCooperateChb;var b=document.getElementById("teamCooperTypeDiv");if(b&&a){if(a.checked){b.style.display="block"}else{b.style.display="none"}}},showTeamAnswerMembers:function(b,a){Zhishi.TeamCooperate.showTeamMemberDialog=new Zhishi.Dialog("\u5408\u4f5c\u7f16\u8f91\u8005",460,310,true,"ShowTeamCooperateMembers.e?sp="+b+"&sp="+a);Zhishi.TeamCooperate.showTeamMemberDialog.show()}};function trim(a){a=a.replace(/(^\s*)|(\s*$)/g,"");return a}function redirectSearch4Form(i,g,c){var e=trim(i.w.value);if(e==""){window.location.reload();return false}else{var h=search_solved_url.replace(/\?.*/gi,"");var d=h+"?sp=S"+encodeURIComponent(e);if(c&&g!=""){d+="&ch="+g}if(Zhishi.Browser.isIE||Zhishi.Browser.isOpera){var b=document.createElement("a");b.href=d;document.body.appendChild(b);b.click()}else{document.location=d}return false}}function redirectAskWithParam(d,e){var g=trim(d.value);var f="";if(e==null){e=""}if(isEmpty(g)){var c=ask_for_title_url+"&ch="+e;f=c}else{var c=ask_url+encodeURIComponent(d.value)+"&ch="+e;f=c}if(Zhishi.Browser.isIE||Zhishi.Browser.isOpera){var b=document.createElement("a");b.href=f;document.body.appendChild(b);b.click()}else{document.location=f}}function chat(a,c,f,d,b){var e="http://wenwen.soso.com/cgi-bin/TS_cgi?tu=";e=e+f+"&tm="+d+"&q="+a+"&a="+c+"&enc="+b;getLink(e);return false}function openChatBox(b){if(b){Link=b;try{if(Zhishi.Browser.isIE){var a=new ActiveXObject("TimwpDll.TimwpCheck");if(a){var d=a.GetVersion()}if(d>=2.1){this.location.href=Link}else{alert("\u641c\u641c\u95ee\u95ee\u6e29\u99a8\u63d0\u793a：\r\n　　\u8bf7\u60a8\u8bbf\u95eehttp://im.qq.com/\u4e0b\u8f7d\u65b0\u7248\u7684QQ/TM\u4ee5\u652f\u6301\u4e0e\u95ee\u53cb\u5728\u7ebf\u4ea4\u6d41！");window.target="_top";window.open("http://im.qq.com/")}}else{if(Zhishi.Browser.isFirefox){this.location.href=Link}else{alert("\u641c\u641c\u95ee\u95ee\u6e29\u99a8\u63d0\u793a：\r\n　　\u60a8\u4f7f\u7528\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301QQ\u4e34\u65f6\u4f1a\u8bdd\u529f\u80fd，\u5efa\u8bae\u60a8\u52a0\u5bf9\u65b9\u4e3a\u597d\u53cb，\u6216\u4f7f\u7528IE/TT/FireFox\u6d4f\u89c8\u5668\u8bbf\u95ee。")}}}catch(c){alert("\u641c\u641c\u95ee\u95ee\u6e29\u99a8\u63d0\u793a：\r\n　　\u8bf7\u60a8\u8bbf\u95eehttp://im.qq.com/\u4e0b\u8f7d\u65b0\u7248\u7684QQ/TM\u4ee5\u652f\u6301\u4e0e\u95ee\u53cb\u5728\u7ebf\u4ea4\u6d41！");window.target="_top";window.open("http://im.qq.com/")}}}function getLink(b){var a;Editor.Ajax.sendRequest("GET",b,{onSuccess:function(c){openChatBox(c);return false}});return false}function initOnlineUserClass(f){var b=gets(f);var d=new Array();var a="";if(b){for(var e=0;e<b.length;e++){var g=b[e].parentNode;var c=g.className;if(c.length>5){c=c.substring(5);d.push(b[e]);a+=c;if(e<b.length-1){a+=","}}}getResponseString(a,d)}}function getResponseString(c,a){if(c){var b="/z/WenwenAjaxEvent.e?sp=9&sp=S"+c;Zhishi.Ajax.sendRequest("GET",b,{onSuccess:function(d){if(d&&d.length>3){var e=d.indexOf(",");if(e>0&&(e+2)<(d.length-2)){result=d.substring(e+2,d.length-2);onlineClass(result,a)}}}})}}function onlineClass(b,a){if(b&&a){var d=b.split(",");if(d.length==a.length){for(var c=0;c<a.length;c++){if(d[c]=="1"){a[c].className="ico_talk"}}}}}check_qq_exist=function(){var c=window.navigator.userAgent.toLowerCase();var f=/gecko/.test(c)&&!/khtml/.test(c);var a=/safari/.test(c);if(f||a){return true}try{var d=new ActiveXObject("TimwpDll.TimwpCheck");return true}catch(b){return false}};openChatBox=function(a){if(a!=0){Link=a;try{window.location.href=Link}catch(b){}}};function on_click_qq(a,f,i,g,h){var d="http://bizapp.qq.com/webc.htm?new=0&o=jz.soso.com&q=0&sid="+a;var b="/wenwen/ad/?vid="+g+"&uin="+f+"&type=qq";var c;var e="";if(a>10020){e=d;c=i+"&clk_bqq=1";window.open(e,"_blank","height=544, width=644,toolbar=no,scrollbars=no,menubar=no,status=no")}else{e=b;c=i+"&clk_bqq=2";if(check_qq_exist()){Zhishi.Ajax.sendRequest("GET",b,{onSuccess:function(j){openChatBox(j);return false},onErr:function(){}})}else{alert("\u817e\u8baf\u641c\u7d22\u63a8\u5e7f\u6e29\u99a8\u63d0\u793a：\r\n     \u60a8\u6ca1\u6709\u5b89\u88c5QQ\u6216\u8005\u60a8\u7684\u6d4f\u89c8\u5668\u8bbe\u7f6e\u7981\u6b62\u4e86QQ\u4e34\u65f6\u4f1a\u8bdd\u529f\u80fd。")}}if(typeof h=="object"&&(h.tagName=="A"||h.tagName=="a")){h.href=c}return false};function getTagNameByType(b){var a="";switch(b){case 1:a="solved";break;case 2:a="partSolved";break;case 3:a="notSolved";break;case 4:a="original";break;case 5:a="notOriginal";break}return a}function getNumTag(c,b){var a=getTagNameByType(b);return document.getElementById(a+"Num"+c)}function getNumBarTag(c,b){var a=getTagNameByType(b);return document.getElementById(a+"Bar"+c)}function getTipsTag(c,b){var a=getTagNameByType(b);return document.getElementById(a+"Tips"+c)}function getEvaluateTips(a,b){switch(a){case 0:return"\u60a8\u5df2\u8bc4\u4ef7！";case 1:return"\u8bc4\u4ef7\u6210\u529f\u52a0"+b+"\u7968！";default:return}}function showEvaluateTips(d,b,a,c){var e=getTipsTag(d,b);if(e){e.innerHTML=getEvaluateTips(a,c);e.style.display="block";window.setTimeout(function(){var f=new Zhishi.Effect(e,"opacity","100","0",1);f.start()},1000)}}function updateTotalSolvedNum(g){var h=getNumTag(g,1);var b=getNumTag(g,2);var d=getNumTag(g,3);if(!h||!b||!d){return}var i=parseInt(h.innerHTML,10);var a=parseInt(b.innerHTML,10);var f=parseInt(d.innerHTML,10);var e=i+a+f;var c=document.getElementById("totalSolvedNum"+g);if(c){c.innerHTML=e}}function updateTotalOriginalNum(e){var a=getNumTag(e,4);var b=getNumTag(e,5);if(!a||!b){return}var g=parseInt(a.innerHTML,10);var f=parseInt(b.innerHTML,10);var d=g+f;var c=document.getElementById("totalOriginal"+e);if(c){c.innerHTML=d}}function updateSolvedBar(i){var k=getNumTag(i,1);var d=getNumTag(i,2);var f=getNumTag(i,3);if(!k||!d||!f){return}var j=getNumBarTag(i,1);var c=getNumBarTag(i,2);var e=getNumBarTag(i,3);if(!j||!c||!e){return}var l=parseInt(k.innerHTML,10);var a=parseInt(d.innerHTML,10);var h=parseInt(f.innerHTML,10);var g=l+a+h;if(g>0){if(l<=50&&a<=50&&h<=50){var b=Math.max(Math.max(l,a),h);j.style.width=Math.round(l*100*b/(g*50))+"px";c.style.width=Math.round(a*100*b/(g*50))+"px";e.style.width=Math.round(h*100*b/(g*50))+"px"}else{j.style.width=Math.round(l*100/g)+"px";c.style.width=Math.round(a*100/g)+"px";e.style.width=(100-Math.round(l*100/g)-Math.round(a*100/g))+"px"}}}function updateOriginalBar(f){var d=getNumTag(f,4);var i=getNumTag(f,5);if(!d||!i){return}var c=getNumBarTag(f,4);var g=getNumBarTag(f,5);if(!c||!g){return}var a=parseInt(d.innerHTML,10);var h=parseInt(i.innerHTML,10);var e=a+h;if(e>0){if(a<=50&&h<=50){var b=Math.max(a,h);c.style.width=Math.round(a*100*b/(e*50))+"px";g.style.width=Math.round(h*100*b/(e*50))+"px"}else{c.style.width=Math.round(a*100/e)+"px";g.style.width=(100-Math.round(a*100/e))+"px"}}}function updateBestRate(a){if(a){}}function disableBar(a,b){ulObj=get(a+b);if(ulObj){ulObj.className="disabled_evaluation"}}function disableEvaluate(d,c,a){var b=null;if(a){switch(c){case 1:case 2:case 3:disableBar("solveDIV",d);break;case 4:case 5:disableBar("origiDIV",d);break}}}function checkIsDisable(c,b){var d;switch(b){case 1:case 2:case 3:d=get("solveDIV"+c);break;case 4:case 5:d=document.getElementById("origiDIV"+c);break}if(d){var a=d.className;if(a&&a.indexOf("disabled_evaluation")>=0){return true}else{return false}}return false}function updateEvaluateNumAndBar(b,a){switch(a){case 1:case 2:case 3:updateBestRate(b);updateSolvedBar(b);break;case 4:case 5:updateOriginalBar(b);break}}function evaluateAnswerNew(url,answerId,type,value){var disable=checkIsDisable(answerId,type);if(disable){return false}var refer=document.referrer;if(refer==null||refer==""){refer="null"}url+="&sp=S"+encodeURIComponent(refer)+"&sp=S"+ac_evaluationParam;var result=0;Zhishi.Ajax.sendRequest("GET",url,{onSuccess:function(response){if(response){var data=eval("("+response.replace(/'/gi,"")+")")[0];if(data=="1"){result=1}}if(result>0){var numDiv=getNumTag(answerId,type);if(numDiv){var number=parseInt(numDiv.innerHTML,10)+value;numDiv.innerHTML=number;updateEvaluateNumAndBar(answerId,type)}}showEvaluateTips(answerId,type,result,value);disableEvaluate(answerId,type,true);return false}})}function initEvaluateAnswer(b,a){disableEvaluate(b,1,a);disableEvaluate(b,4,a)};var zzQzoneDialog=null;function zzQzone(a){zzQzoneDialog=new Zhishi.Dialog("\u8f6c\u8f7d\u5230QQ\u7a7a\u95f4",620,436,true,a);zzQzoneDialog.show()};
