function $($){return document.getElementById($)}function hidden_div(_){$(_).style.display="none"}function show_div(_){$(_).style.display="block"}function exist($){if($)return false;else return true}function rndnum($){var _="";for(var A=0;A<$;A++);_+=Math.floor(Math.random()*10);return _}function reloadcode(){$("codeimg").src=weburl+"?/"+type+"/safecode.png?n="+Math.random()}function ctlent(_){if((_.ctrlKey&&_.keyCode==13)||(_.altKey&&_.keyCode==83))$("bcms_submit").click()}function runcode(_){var $=_.parentNode.firstChild,A=$.value,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,_=window.open("","","top=10000");_.open("text/html","replace");_.document.write(B);_.document.execCommand("saveas","","code.htm");_.document.close()}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 replace($){re=/%/g;$=$.replace(re,"&#37;");re=/\+/g;$=$.replace(re,"&#43;");return($)}function stopbutton(A,_){$(A).disabled=true;$(A).value="\u5012\u65f6("+_+")";if(--_>0)setTimeout("stopbutton('"+A+"',"+_+")",1000);if(_<=0){$(A).value="\u53d1\u8868\u8bc4\u8bba";$(A).disabled=false;hidden_div("bcms_post_msg")}}function showajaxdiv(F,_,D,G){if($("ajax-div-"+F))var B=$("ajax-div-"+F);else{B=document.createElement("DIV");B.id="ajax-div-"+F;B.className="ajaxdiv";document.body.appendChild(B)}var E=B.style;E.display="";E.width=D+"px";var A=navigator.userAgent.toLowerCase(),C=(A.indexOf("opera")!=-1),H=scrollTop=0;if(C){H=document.body.clientHeight/2;scrollTop=document.body.scrollTop}else{H=document.documentElement.clientHeight/2;scrollTop=document.documentElement.scrollTop}B.innerHTML=_;E.left=(document.documentElement.clientWidth/2+document.documentElement.scrollLeft-D/2)+"px";E.top=(H+scrollTop-B.clientHeight/2)+"px";if(G==1){E.position="absolute";E.fontSize="12px";E.fontFamily="Tahoma,Arial";E.padding="5px";E.backgroundColor="#f00";E.color="#fff";E.border="0";E.textAlign="center"}}function reply(C,E,F,_,A,G){var D=$("bcms_quote"),B=$("bcms_quote_text");if(exist(D)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201cbcms_quote\u201d\u7684\u5f15\u7528\u63d2\u5165\u6846input,\u5c5e\u6027\u4e3a\u9690\u85cf\uff01");return}if(exist(B)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201cbcms_quote_text\u201d\u7684\u5f15\u7528\u4fe1\u606f\u663e\u793a\u5c42");return}if(G=="add"){D.value=C;B.innerHTML="[<a onclick=reply('','','','','','del')  style='color:red;cursor:hand;' title='\u53d6\u6d88\u5f15\u7528'><b>\xd7</b></a>] \u5f15\u7528\uff1a"+E+"\u697c\u7684 <a title="+F+">"+_+"</a> \u4e8e "+A+" \u53d1\u8868\u7684\u5185\u5bb9.";return false}else{D.value=0;B.innerHTML="<label for=\"bcms_content\">\u5185\u5bb9</label><span>(\u5fc5\u586b)</span>";return false}}function chkso(_){var A=$(_).value,B=(/^([a-zA-Z\u4E00-\u9FA5][\u0000-\uFFFF]*){1,50}$/).test(A);if(B)location.href=weburl+"?/"+type+"/keyword/"+escape(A)+"/index.html";else{alert("\u9519\u8bef\uff0c\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u5173\u952e\u5b57\uff01");$(_).focus()}}function createxmlhttp(){var A=null;try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(_){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch($){A=null}}if(!A&&typeof XMLHttpRequest!="undefined")A=new XMLHttpRequest();return A}function tagshow(A){var C=weburl+"index.asp?go=retag&type="+type+"&item="+encodeURIComponent(A),B=createxmlhttp();B.onreadystatechange=_;B.open("GET",C,true);B.send(null);function _(){if(B.readyState==1)showajaxdiv("tagline","\u6b63\u5728\u5efa\u7acb\u8fde\u63a5...",200,1);else if(B.readyState==2)$("ajax-div-tagline").innerHTML="\u6b63\u5728\u53d1\u9001\u6570\u636e...";else if(B.readyState==3)$("ajax-div-tagline").innerHTML="\u6b63\u5728\u63a5\u6536\u6570\u636e...";else if(B.readyState==4)if(B.status==200){showajaxdiv("tagshow",B.responseXML.lastChild.firstChild.nodeValue,500,0);hidden_div("ajax-div-tagline");B=null}else $("ajax-div-tagline").innerHTML="\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u65b0\u5c1d\u8bd5\uff01"}}function digg(_,C){var F=$("bcms_digg_num"+C),E=$("bcms_digg_msg"+C);if(exist(F)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201cbcms_digg_num"+C+"\u201d\u7684\u8fd4\u56de\u4fe1\u606f\u663e\u793a\u5c42");return}if(exist(E)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201cbcms_digg_msg"+C+"\u201d\u7684\u8fd4\u56de\u4fe1\u606f\u63d0\u793a\u5c42");return}var D=weburl+"index.asp?go=redigg&type="+type+"&id="+C+"&digg="+_+"&n="+Math.random(),B=createxmlhttp();B.onreadystatechange=A;B.open("GET",D,true);B.send(null);function A(){if(B.readyState==4&&B.status==200){var $=B.responseText.split("|");F.innerHTML=$[0];E.innerHTML=$[1];B=null}else E.innerHTML="<img src='"+weburl+"inc/dll/loading.gif'>"}}function pl(_,C){var D=$("commentlist");if(exist(D)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201ccommentlist\u201d\u7684\u8bc4\u8bba\u663e\u793a\u5c42");return}var E=weburl+"?/"+type+"/comments/"+_+"/"+C+"/"+Math.random(),B=createxmlhttp();B.onreadystatechange=A;B.open("GET",E,true);B.send(null);function A(){if(B.readyState==4&&B.status==200){D.innerHTML=B.responseText;B=null}}}function chkcomm(E,D){var B="<img src='"+weburl+"inc/dll/loading.gif' style='margin:0 0 -3px -20px;background:#FFFBDF;'>",F=$("bcms_post_msg"),N=$("bcms_user"),_=$("bcms_mail"),G=$("bcms_url"),H=$("bcms_content"),L=$("bcms_quote"),K=$("bcms_quote_text"),C=$("bcms_safecode"),I=$("bcms_cookie");if(exist(F)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201cbcms_post_msg\u201d\u7684\u8fd4\u56de\u4fe1\u606f\u63d0\u793a\u5c42");return}if(exist(H)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_content\u201d\u7684\u5185\u5bb9\u8f93\u5165\u6846input");return}else zcontent=H.value;if(exist(C)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_safecode\u201d\u7684\u9a8c\u8bc1\u7801\u8f93\u5165\u6846input");return}else zsafecode=C.value;if(exist(N))zuser="\u7f51\u53cb"+rndnum(4);else zuser=N.value;if(exist(_))zmail="";else zmail=_.value;if(exist(G))zurl="";else zurl=G.value;if(exist(L))zquote=0;else zquote=L.value;show_div("bcms_codediv");show_div("bcms_post_msg");F.innerHTML=B+"\u8bf7\u7b49\u5f85\uff0c\u6570\u636e\u63d0\u4ea4\u4e2d...";if(exist(I)==false)setcookies(zuser,zmail,zurl);var J=weburl+"index.asp?go=recomments",A="type="+E+"&aid="+D+"&user="+escape(zuser)+"&mail="+zmail+"&url="+zurl+"&quote="+zquote+"&content="+escape(replace(zcontent))+"&safecode="+zsafecode,M=createxmlhttp();M.open("POST",J,true);M.setRequestHeader("Cache-Control","no-cache");M.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");M.send(A);M.onreadystatechange=function(){if(M.readyState==1)F.innerHTML=B+"\u8bf7\u7b49\u5f85\uff0c\u6b63\u5728\u5efa\u7acb\u8fde\u63a5...";else if(M.readyState==2)F.innerHTML=B+"\u8bf7\u7b49\u5f85\uff0c\u6b63\u5728\u53d1\u9001\u6570\u636e...";else if(M.readyState==3)F.innerHTML=B+"\u8bf7\u7b49\u5f85\uff0c\u6b63\u5728\u63a5\u53d7\u6570\u636e...";else if(M.readyState==4)if(M.status==200){var _=M.responseText.split("|");if(_[1]=="False"){if(_[0]=="bcms_safecode"){$(_[0]).value="";$(_[0]).focus();reloadcode();F.innerHTML=_[2]}else{$(_[0]).focus();F.innerHTML=_[2]}}else if(_[1]=="True"){stopbutton("bcms_submit",_[0]);F.innerHTML=_[2]}else{stopbutton("bcms_submit",_[0]);pl(D,"99");H.value="";C.value="";reloadcode();F.innerHTML=_[2];if(exist(L)==false)L.value=0;if(exist(K)==false)K.innerHTML="<label for=\"bcms_content\">\u5185\u5bb9</label><span>(\u5fc5\u586b)</span>"}M=null}else F.innerHTML=B+"\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u5237\u65b0\u91cd\u65b0\u5c1d\u8bd5\uff01"}}function chk(F){var D="<img src='"+weburl+"inc/dll/loading.gif' style='margin:0 0 -3px -20px;background:#FFFBDF;'>",H=$("bcms_post_msg");if(exist(H)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u4e3a\u201cbcms_post_msg\u201d\u7684\u8fd4\u56de\u4fe1\u606f\u63d0\u793a\u5c42");return}if(F=="book"){var G=$("bcms_user"),A=$("bcms_mail"),_=$("bcms_content");if(exist(G)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_user\u201d\u7684\u6635\u79f0\u8f93\u5165\u6846input");return}else zuser=G.value;if(exist(A))zmail="";else zmail=A.value;if(exist(_)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_content\u201d\u7684\u5185\u5bb9\u8f93\u5165\u6846input");return}else zcontent=_.value;var I=weburl+"index.asp?go=rebooks",B="user="+escape(zuser)+"&mail="+zmail+"&content="+escape(replace(zcontent))}else{var C=$("bcms_name"),I=$("bcms_url"),A=$("bcms_mail"),J=$("bcms_info");if(exist(C)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_user\u201d\u7684\u540d\u79f0\u8f93\u5165\u6846input");return}else zname=C.value;if(exist(A)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_mail\u201d\u7684\u90ae\u7bb1\u8f93\u5165\u6846input");return}else zmail=A.value;if(exist(I)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_url\u201d\u7684\u7f51\u5740\u8f93\u5165\u6846input");return}else zurl=I.value;if(exist(J)){alert("\u53c2\u6570\u6709\u8bef\uff0c\u7f3a\u5c11ID\u201cbcms_info\u201d\u7684\u8bf4\u660e\u8f93\u5165\u6846input");return}else zinfo=J.value;I=weburl+"index.asp?go=relinks",B="type="+F+"&name="+zname+"&mail="+zmail+"&url="+zurl+"&info="+escape(replace(zinfo))}show_div("bcms_post_msg");H.innerHTML=D+"\u6570\u636e\u63d0\u4ea4\u4e2d...";var E=createxmlhttp();E.open("POST",I,true);E.setRequestHeader("Cache-Control","no-cache");E.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");E.send(B);E.onreadystatechange=function(){if(E.readyState==4&&E.status==200){var _=E.responseText.split("|");if(_[1]=="False"){$(_[0]).focus();H.innerHTML=_[2]}else{$("bcms_submit").disabled=true;H.innerHTML=_[2]}E=null}else H.innerHTML=D+"\u6570\u636e\u5904\u7406\u4e2d..."}}