function $($){return document.getElementById($)}function echo(A,_){$(A).innerHTML=_}function show(A){var _=$(A).style;_.display=_.display=="none"?"":""}function reloadcode(){$("codeimg").src=weburl+"?/"+type+"/safecode.png?n="+Math.random()}function Replace($){re=/%/g;$=$.replace(re,"&#37;");re=/\+/g;$=$.replace(re,"&#43;");return($)}function StopButton(A,_){$(A).disabled="disabled";$(A).value="\u5012\u65f6("+_+")";if(--_>0)setTimeout("StopButton('"+A+"',"+_+")",1000);if(_<=0){$(A).value="\u53d1\u8868\u8bc4\u8bba";$(A).disabled="";$("postmsg").innerHTML=""}}function AddText(_,B,D,A,C){bcms_quote.value=_;$("bcms_recontent").innerHTML="[<a onclick=DelText() title='\u53d6\u6d88\u5f15\u7528'><b><font color=red>\xd7</font></b></a>] \u5f15\u7528\uff1a"+B+"\u697c\u7684 <a title="+D+">"+A+"</a> \u4e8e "+C+" \u53d1\u8868\u7684\u5185\u5bb9.";return false}function DelText(){bcms_quote.value="";$("bcms_recontent").innerHTML="\u5185\u5bb9 (\u5fc5\u586b):";return false}function SetCookie(_,B){var A=30,$=new Date();$.setTime($.getTime()+A*24*60*60*1000);expires="; expires="+$.toGMTString();document.cookie=_+"="+encodeURIComponent(B)+expires+";path=/"}function getCookie(_){var $=document.cookie.match(new RegExp("(^| )"+_+"=([^;]*)(;|$)"));if($!=null)return decodeURIComponent($[2]);return null}function delCookie(_){var $=new Date();$.setTime($.getTime()-1);var A=getCookie(_);expires="; expires="+$.toGMTString();if(A!=null)document.cookie=_+"="+A+expires+";path=/"}function setCookies(A,$,B){var _=document.getElementById("bcms_cookie");if(_.checked){SetCookie("lanyu-user",A);SetCookie("lanyu-mail",$);SetCookie("lanyu-url",B)}}function delCookies(){delCookie("lanyu-user");delCookie("lanyu-mail");delCookie("lanyu-url");alert("\u60a8\u7684\u4fe1\u606f\u5df2\u6210\u529f\u5220\u9664\uff01");$("bcms_user").value="";$("bcms_mail").value="";$("bcms_url").value=""}function PL(A){var _=weburl+"?/"+type+"/comments/"+A+"/"+Math.random(),$=new Ajax(null,"HTML").get(_,function($){echo("commentsmain",$)})}function Digg(num,aid){var param=weburl+"?go=redigg&type="+type+"&id="+aid+"&digg="+num+"&n="+Math.random(),aj=new Ajax(null,"HTML").get(param,function(res){eval(res)})}function Check(){if($("bcms_user").value==""){$("postmsg").innerHTML="\u540d\u5b57\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_user').focus();return false}if($("bcms_content").value==""){$("postmsg").innerHTML="\u8bc4\u8bba\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_content').focus();return false}if($("bcms_safecode").value==""){$("postmsg").innerHTML="\u7b54\u6848\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_safecode').focus();return false}$("postmsg").innerHTML="\u6b63\u5728\u63d0\u4ea4\u8bf7\u7a0d\u540e...";var param="type="+$("bcms_type").value+"&aid="+$("bcms_aid").value+"&user="+$("bcms_user").value+"&mail="+$("bcms_mail").value+"&url="+$("bcms_url").value+"&quote="+$("bcms_quote").value+"&content="+escape(Replace($("bcms_content").value))+"&safecode="+$("bcms_safecode").value,aj=new Ajax(null,"HTML").post(weburl+"?go=recomments",param,function(res){eval(res)});setCookies($("bcms_user").value,$("bcms_mail").value,$("bcms_url").value)}function Checkbook(){if($("bcms_user").value==""){$("postmsg").innerHTML="\u59d3\u540d\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_user').focus();return false}if($("bcms_content").value==""){$("postmsg").innerHTML="\u7559\u8a00\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_content').focus();return false}if($("bcms_safecode").value==""){$("postmsg").innerHTML="\u7b54\u6848\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_safecode').focus();return false}$("postmsg").innerHTML="\u6b63\u5728\u63d0\u4ea4\u8bf7\u7a0d\u540e...";var param="user="+$("bcms_user").value+"&mail="+$("bcms_mail").value+"&url="+$("bcms_url").value+"&content="+escape(Replace($("bcms_content").value))+"&safecode="+$("bcms_safecode").value,aj=new Ajax(null,"HTML").post(weburl+"?go=rebooks",param,function(res){eval(res)});setCookies($("bcms_user").value,$("bcms_mail").value,$("bcms_url").value)}function Checklink(){if($("bcms_name").value==""){$("postmsg").innerHTML="\u7f51\u7ad9\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_name').focus();return false}if($("bcms_mail").value==""){$("postmsg").innerHTML="\u90ae\u7bb1\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_mail').focus();return false}if($("bcms_url").value==""){$("postmsg").innerHTML="\u7f51\u7ad9\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_url').focus();return false}if($("bcms_info").value==""){$("postmsg").innerHTML="\u7f51\u7ad9\u8bf4\u660e\u4e0d\u80fd\u4e3a\u7a7a";$('bcms_info').focus();return false}$("postmsg").innerHTML="\u6b63\u5728\u63d0\u4ea4\u8bf7\u7a0d\u540e...";var param="type="+$("bcms_type").value+"&webname="+$("bcms_name").value+"&webmail="+$("bcms_mail").value+"&weburl="+$("bcms_url").value+"&webinfo="+$("bcms_info").value,aj=new Ajax(null,"HTML").post(weburl+"?go=relinks",param,function(res){eval(res)})}function tagshow(_){var A=500,B=new Ajax(null,"XML");B.get(weburl+"?go=retag&type="+type+"&item="+encodeURIComponent(_),function(_){if($("ajax-div-tagshow"))var C=$("ajax-div-tagshow");else{C=document.createElement("DIV");C.id="ajax-div-tagshow";C.className="ajaxdiv";document.body.appendChild(C)}var E=C.style;E.display="";E.width=A+"px";var B=navigator.userAgent.toLowerCase(),D=(B.indexOf("opera")!=-1),F=scrollTop=0;if(D){F=document.body.clientHeight/2;scrollTop=document.body.scrollTop}else{F=document.documentElement.clientHeight/2;scrollTop=document.documentElement.scrollTop}C.innerHTML=_.lastChild.firstChild.nodeValue;E.left=(document.documentElement.clientWidth/2+document.documentElement.scrollLeft-A/2)+"px";E.top=(F+scrollTop-C.clientHeight/2)+"px"})}function showhide(_){$(_).style.display=$(_).style.display=="none"?"block":"none"}function RunCode(_){var $=_.parentNode.firstChild,A=$.value;if(A!=""){var B=window.open("","","");B.opener=null;B.document.write(A);B.document.close()}}function CopyCode(_){var $=_.parentNode.firstChild,A=$.createTextRange();A.moveToElementText($);A.scrollIntoView();A.select();A.execCommand("Copy");A.collapse(false)}function SaveCode(A){var $=A.parentNode.firstChild,B=$.value;if(B!=""){var _=window.open("","","top=10000");_.open("text/html","replace");_.document.write(B);_.document.execCommand("saveas","","code.htm");_.document.close()}}function go(){var A=arguments[0],B=document.getElementById(A).value,_=B.length;if(_<=10&&_>=2){var $=(/^[0-9a-zA-Z\u4E00-\u9FA5]+$/).test(B);if($)location.href=weburl+"?/"+type+"/keyword/"+escape(keys.value)+"/index.html";else alert("\u9519\u8bef\uff0c\u53ea\u5141\u8bb8\u8f93\u5165\u4e2d\u6587\uff0c\u5b57\u6bcd\uff0c\u6570\u5b57\uff0c\u4e0d\u5141\u8bb8\u7279\u6b8a\u5b57\u7b26\uff01")}else alert("\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u60a8\u8981\u641c\u7d22\u7684\u5173\u952e\u5b57\uff0c\u6700\u5c11\u4e24\u4e2a\u5b57\uff0c\u6700\u591a\u5341\u4e2a\u5b57\uff01")}function ctlent(_,A){if((_.ctrlKey&&_.keyCode==13)||(_.altKey&&_.keyCode==83))$(A).click()}function enter(_,A){if(_.keyCode==13)$(A).click()}