function creatXmlHttpObj(){var _=false;if(window.XMLHttpRequest){_=new XMLHttpRequest();if(_.overrideMimeType)_.overrideMimeType("text/xml")}else if(window.ActiveXObject){var A=new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");for(var B=0;B<A.length&&!_;B++){try{_=new ActiveXObject(A[B])}catch($){}}}if(!_){window.alert("Creat XMLHttp object error!");return false}return _}function sendRequest(_,A){xmlHttp=creatXmlHttpObj();xmlHttp.open("GET",A,true);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-Type","charset=utf-8");xmlHttp.onreadystatechange=function $(){if(xmlHttp.readyState==4)if(xmlHttp.status==200)switch(_){case"comment":commentServerResponse();break;case"login":loginServerResponse();break}else alert("Your request page is empty")};xmlHttp.send(null)}function commentServerResponse(){var $=xmlHttp.responseText,_=new Date().getTime();switch($){case"Please Login.":case"You are not admin.":case"Code Error.":case"ID Error":case"Please enter comment.":case"Data Insert Error.":$_("showMsg").innerHTML=$;break;default:setTimeout("clearInfo()","8000");$_("showMsg").className="showSucc";$_("showMsg").innerHTML="\u63d0\u4ea4\u5185\u5bb9\u6210\u529f\uff0c\u7ba1\u7406\u5458\u4f1a\u5c3d\u5feb\u4e3a\u60a8\u89e3\u7b54\uff0c\u656c\u8bf7\u5173\u6ce8\u672c\u7ad9\uff0c\u8c22\u8c22!";$_("content").value="";$_("checkcode").value="";$_("content_num").value="100";$_("chkpic").src="../include/check_code.php?t="+_;$_("comment_show").innerHTML=$}}function clearInfo(){$_("showMsg").className="hidden";$_("showMsg").innerHTML=""}function checkContent(B,A,C){var D=B.member_id.value,$=B.content.value.trim(),_=B.checkcode.value;if(D==""){$_(C).className="showError";$_(C).innerHTML="Please Login.";return false}else if($==""){$_(C).className="showError";$_(C).innerHTML="Please enter comment.";return false}else if(_==""){$_(C).className="showError";$_(C).innerHTML="Please enter check code.";return false}else sendRequest("comment",A+"&member_id="+encodeURIComponent(D)+"&content="+encodeURIComponent($)+"&checkcode="+encodeURIComponent(_))}function loginServerResponse(){var $=xmlHttp.responseText;switch($){case"Please enter email":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="\u8bf7\u8f93\u5165 E-mail.";break;case"Please enter password":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="\u8bf7\u8f93\u5165\u5bc6\u7801.";break;case"Please enter Checkcode":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801.";break;case"Email Error":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="E-mail \u9519\u8bef.";break;case"Password Error":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="\u5bc6\u7801\u9519\u8bef.";break;case"Code Error":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="\u9a8c\u8bc1\u7801\u9519\u8bef.";break;case"Check your confirm email":$_("showLoginMsg").className="showError";$_("showLoginMsg").innerHTML="\u8bf7\u68c0\u67e5\u4f60\u7684 E-mail.";break;case"Success.":$_("showLoginMsg").className="showSucc";$_("showLoginMsg").innerHTML="\u767b\u5f55\u6210\u529f.";window.location.href="http://www.admin51.com/member/information_edit.php";break;case"Success ifr.":$_("showLoginMsg").className="showSucc";$_("showLoginMsg").innerHTML="\u767b\u5f55\u6210\u529f.";window.location.href="http://www.admin51.com/member/information_edit.php";break;default:$_("showLoginMsg").className="showSucc";$_("showLoginMsg").innerHTML="\u767b\u5f55\u6210\u529f.";window.location.href="http://www.admin51.com/member/information_edit.php"}}function checkLogin(B,A,C){var _=B.email.value,D=B.password.value,$=B.checkcode.value;if(_==""){$_(C).className="showError";$_(C).innerHTML="\u8bf7\u8f93\u5165 E-mail.";B.email.focus();return false}else if(!is_email(_)){$_(C).className="showError";$_(C).innerHTML="Email \u683c\u5f0f\u9519\u8bef.";return false}else if(D==""){$_(C).className="showError";$_(C).innerHTML="\u8bf7\u8f93\u5165\u5bc6\u7801.";B.password.focus();return false}else if($==""){$_(C).className="showError";$_(C).innerHTML="\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801.";B.checkcode.focus();return false}else sendRequest("login",A+"email="+encodeURIComponent(_)+"&password="+encodeURIComponent(D)+"&checkcode="+encodeURIComponent($))}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};String.prototype.ltrim=function(){return this.replace(/(^\s*)/g,"")};String.prototype.rtrim=function(){return this.replace(/(\s*$)/g,"")};function $_(){var _=new Array();for(var A=0;A<arguments.length;A++){var $=arguments[A];if(typeof $=="string")$=document.getElementById($);if(arguments.length==1)return $;_.push($)}return _}function handleKey($,_){$=(!$)?window.event:$;code=($.charCode)?$.charCode:(($.keyCode)?$.keyCode:(($.which)?$.which:0));if($.type=="keydown")if(code==13){document.getElementById(_).click();return false}}function is_email($){var $=$,_=/^(([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}){0,1}$/;if(_.test($))return true;else return false}function setOnFocus(){document.getElementById("commentForm").content.focus()}