var error_email_empty="Email地址为空。";var error_email_illegal="Email地址无效。";var error_email_invalid="您只能使用以  结尾的信箱，请重新填写。";var error_email_censor="请不要使用以  结尾的信箱，请重新填写。";var error_usernick_empty="用户昵称为空。";var error_usernick_toolong="用户昵称超过14个字符。";var error_usernick_tooshort="用户昵称小于7个字符。";var error_passwd_empty="密码为空。";var error_passwd_illegal="密码包含非法字符。";var error_passwd_notmatch="两次输入的密码不一致。";var error_passwd_tooshort="密码小于6个字符。";var error_passwd_toolong="密码大于16个字符。";var error_seccode_empty="验证码为空。";var error_seccode_invalid="验证码不合法。";var error_seccode_wrong="验证码不匹配。";var error_login_email_nick_wrong="Email地址与密码不匹配。";var wikilinkno;var xmlHttp;var currentPos=null;var login=1;var gSubmitFlag=true;var innerObj;var ajaxflag=true;var nologinflag=0;var ajaxpostflag=true;function viewDocShowEditor(b){var c=document.getElementById(b);c.style.display="block";var a=document.getElementById("topic_title");a.focus()}function KillSpace(h){var f=0;var d=0;var g=0;var e=0;var c=0;while(f==0){g=h.length;h=h.replace(/(^\s*)|(\s*$)/g,"");d=h.length;if(g==d){e=0}else{e=1}g=h.length;h=h.replace(/(^\u3000*)|(\u3000*$)/g,"");h=h.replace(/(^\ue4c6*)|(\ue4c6*$)/g,"");d=h.length;if(g==d){c=0}else{c=1}if(e==0&&c==0){f=1}else{f=0}}return h}function SubmitNewEvent(a){if(a.keyCode==13){SubmitNew()}}function showsecNew(c,b){var a=document.getElementById(c);str="/Captcha.jpg?random="+Math.random();if(b&&b!=""){str+="&type="+b}a.src=str}function showsec(d,b){var c=document.getElementById("seccode");c.value="";var a=document.getElementById(d);str="/Captcha.jpg?random="+Math.random();if(b&&b!=""){str+="&type="+b}a.src=str}Topicload=function(){if(getHdCookie(hdCookieName)==null){var a=document.getElementById("anonymity");if(a!=null&&a.style.display=="none"){a.style.display=""}var b=document.getElementById("topic_seccode_li");if(b!=null&&b.style.display=="none"){b.style.display=""}}};TopicSeccodeShow=function(){if(getHdCookie(hdCookieName)==null){var a=document.getElementById("topic_seccode_img");if(a!=null&&a.style.display=="none"){a.style.display="";showsec("imgsec","comments")}}};Replyload=function(){if(getHdCookie(hdCookieName)==null){var a=document.getElementById("anonymity");if(a!=null&&a.style.display=="none"){a.style.display=""}var b=document.getElementById("reply_seccode_li");if(b!=null&&b.style.display=="none"){b.style.display=""}}};ReplySeccodeShow=function(){if(getHdCookie(hdCookieName)==null){var a=document.getElementById("reply_seccode_img");if(a!=null&&a.style.display=="none"){a.style.display="";setTimeout(function(){showsec("imgsec","comments")},500)}}};TopicfocusTwo=function(){if(getHdCookie(hdCookieName)==null){var a=document.getElementById("topic_seccode_li");var b=document.getElementById("captchaimg");if(a!=null&&b!=null){a.style.display="";b.style.display="";setTimeout(function(){showsec("imgsec","comments")},500)}}};function LoginSubmitNewEvent(a){if(a.keyCode==13){doTopicSubmitNew()}}function closeloginForm(){closeFloatWindow();gSubmitFlag=true;ajaxflag=true;ajaxpostflag=true}function loginRegister(){gSubmitFlag=true;var a='<div class="editor_login"><ul><li><span>E-mail：</span><input id="emaillogin" type="text" class="inp_txt" size="30" /></li><li><span>密码：</span><input id="pwdlogin" type="password"  class="inp_txt" size="30" /></li><li><span>验证码：</span><input id="seccodelogin" type="text" class="inp_txt wid50" maxlength="4" onkeydown="LoginSubmitNewEvent(event)"/><label class="img_yzm mar-lr8"><img id="imgseclogin" alt="" src="" /></label><a href="javascript:showsecNew(\'imgseclogin\',\'comments\');" class="block l width">看不清楚，换一个！</a></li><li><input id="LoginandSubmit" name="LoginandSubmit" type="button" value="立即登陆" class="inp_btn" onclick="return doTopicSubmitNewTwo();"/></li><li id="err_infologin" style="display:none" class="error">&nbsp;</li></ul></div>';setFloatWindow("登录",a,360,false,false);setTimeout(function(){showsecNew("imgseclogin","comments")},1000);document.getElementById("_CLOSEX").onmousedown=closeloginForm}docvalidateTwo=function(a){if(SubmitdocLoginNewTwo()){if(a=="1"){loginRegister();return}else{closeloginForm();SubmitregisterFormTwo()}}};SubmitdocLoginNewTwo=function(){var b=document.getElementById("topic_title");var a=document.getElementById("topic_content");if(KillSpace(b.value.Trim()).length==0){alert("标题不能为空!");return false}if(b.value.length>30){alert("标题不能过长！");return false}if(KillSpace(a.value.Trim()).length==0){alert("内容不能为空！");return false}if(a.value.length>10000){alert("内容不能超过1万字！");return false}return true};function SubmitLoginNew(){var c=document.getElementById("topic_title");var a=document.getElementById("topic_content");var b="";if(KillSpace(c.value.Trim()).length==0){document.getElementById("err_info").innerHTML="标题不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(c.value.length>30){document.getElementById("err_info").innerHTML="标题不能过长！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}c.value=KillSpace(c.value.Trim());if(KillSpace(a.value.Trim()).length==0){document.getElementById("err_info").innerHTML="内容不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(a.length>10000){document.getElementById("err_info").innerHTML="内容不能超过1万字！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}}SubmitNewTwo=function(){var d=document.getElementById("topic_title");var b=document.getElementById("topic_content");var c="";if(KillSpace(d.value.Trim()).length==0){document.getElementById("err_info").innerHTML="标题不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(d.value.length>30){document.getElementById("err_info").innerHTML="标题不能过长！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}d.value=KillSpace(d.value.Trim());if(KillSpace(b.value.Trim()).length==0){document.getElementById("err_info").innerHTML="内容不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(b.length>10000){document.getElementById("err_info").innerHTML="内容不能超过1万字！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(getHdCookie(hdCookieName)==null){nologinflag=1;var a=document.getElementById("seccode");if(a.value.length==0){document.getElementById("err_info").innerHTML="验证码不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);a.focus();gSubmitFlag=true;return false}}doTopicSubmitNewTwo()};doTopicSubmitNewTwo=function(){if(!gSubmitFlag){return false}gSubmitFlag=false;if(getHdCookie(hdCookieName)==null){if(nologinflag==1){checkRandNewTwo();return null}else{nologinflag=0;var b=document.getElementById("emaillogin");if(b.value.length==0){document.getElementById("err_infologin").innerHTML="邮件地址不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);b.focus();gSubmitFlag=true;return false}var c=document.getElementById("pwdlogin");if(c.value.length==0){document.getElementById("err_infologin").innerHTML="密码不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);c.focus();gSubmitFlag=true;return false}var a=document.getElementById("seccodelogin");if(a.value.length==0){document.getElementById("err_infologin").innerHTML="验证码不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);a.focus();gSubmitFlag=true;return false}}checkRandNewTwo()}else{doctopicsubmitNewTwo();return null}};var checkrandhttp=null;checkRandNewTwo=function(){gSubmitFlag=false;checkrandhttp=createXMLHttpRequestByObject("checkrandhttp");var a="/ajaxCheckRand.do?randType=comments&rand=";if(getHdCookie(hdCookieName)==null&&nologinflag!=1){a+=document.getElementById("seccodelogin").value.Trim()}if((getHdCookie(hdCookieName)==null&&nologinflag==1)){a+=document.getElementById("seccode").value.Trim()}checkrandhttp.open("POST",a,true);checkrandhttp.onreadystatechange=changeRandFlagNewTwo;checkrandhttp.send(null)};function changeRandFlagNewTwo(){if(checkrandhttp.readyState==4){if(checkrandhttp.status==200){var a=checkrandhttp.responseXML.getElementsByTagName("flag")[0].firstChild.data;if(a=="true"){doctopicsubmitNewTwo();return}else{if(getHdCookie(hdCookieName)==null&&nologinflag==1){document.getElementById("err_info").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);document.getElementById("seccode").focus();document.getElementById("seccode").innerText="";showsec("imgsec","comments")}else{document.getElementById("err_infologin").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);document.getElementById("seccodelogin").focus();document.getElementById("seccodelogin").innerText="";showsecNew("imgseclogin","comments")}gSubmitFlag=true;return false}}}}var doctopichttpnew=null;doctopicsubmitNewTwo=function(){var d=document.getElementById("doc_title").value;var c=document.getElementById("topic_title");var h=document.getElementById("topic_content");var b=document.getElementById("newImagesUrl");var f=h.value;if(b!=null){f='<p><a href="'+b.value+'" target="_blank"><img src="'+b.value+'" hspace="0" border="0"/></a></p>'+f}var a="/createDocTopic.do";var j="doc_title="+encodeURI(d)+"&topic_title="+encodeURI(c.value)+"&content="+encodeURI(f)+"&type=doc&no_login_flag="+nologinflag;doctopichttpnew=createXMLHttpRequestByObject(doctopichttpnew);if(getHdCookie(hdCookieName)==null&&nologinflag!=1){var g=document.getElementById("emaillogin");var e=document.getElementById("pwdlogin");var i=document.getElementById("seccodelogin");j+="&email="+encodeURI(g.value)+"&pwd="+encodeURI(e.value)+"&seccode="+encodeURI(i.value)}doctopichttpnew.open("POST",a,true);doctopichttpnew.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");doctopichttpnew.onreadystatechange=doctopicsubmitNewhttpTwo;doctopichttpnew.send(j)};doctopicsubmitNewhttpTwo=function(){if(doctopichttpnew.readyState==4){if(doctopichttpnew.status==200){var b=doctopichttpnew.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;if(b=="true"){alert("您的帖子已经发表成功!");var a=document.getElementById("doc_title").value;window.location="http://wikibar.hudong.com/"+encodeURI(a)}else{var c=doctopichttpnew.responseXML.getElementsByTagName("FAILUREREASON")[0].firstChild.data;if(getHdCookie(hdCookieName)!=null||getHdCookie(hdCookieName)==null&&nologinflag==1){document.getElementById("err_info").innerHTML=""+c+"";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);document.getElementById("seccode").focus();document.getElementById("seccode").innerText="";showsec("imgsec","comments")}else{document.getElementById("err_infologin").innerHTML=""+c+"";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);document.getElementById("seccodelogin").focus();document.getElementById("seccodelogin").innerText="";showsecNew("imgseclogin","comments")}gSubmitFlag=true;return false}}}};function closepopwindowNew(){document.getElementById("topic_title").value="";document.getElementById("topic_content").value="";document.getElementById("topic_seccode_li").style.display="none";document.getElementById("captchaimg").style.display="none";closeFloatWindow();gSubmitFlag=true;if("true"==user_isrealexpert){document.getElementById("experttopic").style.display=""}if("true"==user_isexpert||"true"==user_isrealexpert){document.getElementById("show_thesaurus_dt").innerHTML=document.getElementById("show_thesaurus_dt").innerHTML+'<a id="addthesaurus" href="javascript:thesaurusIfLock();" class="r">我来补充</a>';document.getElementById("show_thesaurus").style.display="block"}document.getElementById("_doc_flag").value="1"}SubmitregisterFormTwo=function(){var a='<div class="editor_register"><form method="post" name="RegisterForm"><span id="ajaxinfo"></span><ul><li><span>E-mail：</span><input id="emailregister" onblur="checkemail(true);" name="email" type="text" class="inp_txt" size="30"/><label id="div_email" class="red"></label><label class="block">作为登录的帐号</label></li>	<li><span>昵称：</span><input id="nickregister" name="usernick" onblur="checkusername(true);" type="text" class="inp_txt" size="30"/><label id="div_usernick" class="red"></label><label class="block">14个字符一下，注册后不可修改。</label></li><li><span>密码：</span><input id="pswregister" name="pwd" onblur="checkpassword();" type="password" class="inp_txt" size="30"/><label id="pwderror" class="red"></label></li><li><span>重复密码：</span><input id="confimpswregister" name="pwd2" onblur="checkpassword2();" type="password" class="inp_txt" size="30"/><label id="pwderror2" class="red"></label><a href="#" target="target"></a></li><li><span>验证码：</span><input name="seccode" type="text" onblur="checkseccode(true);" class="inp_txt wid50" maxlength="4"/><label class="img_yzm mar-r8 l"><img id="imgsecregist" alt="" src="" class="l"/></label><label id="div_seccode" class="red" style="display:none"></label></li><li><a href="javascript:showsecNew(\'imgsecregist\',\'register\');" class="blur">看不清楚，换一个！</a></li><li><input name="chkagree" id="chkagree" type="checkbox"  class="mar-r8" checked="checked" onclick="changeagree();"/>同意本站<a href="http://www.hudong.com/common/fwtk.jsp" target="_blank">服务条款</a></li><li class="a-l"><input id="btnReg" name="btnReg" type="submit" value="马上注册吧" class="inp_btn" onclick="if(doSubmit_registerTwo()==false) return false"/></li></ul></form></div>';setFloatWindow("注册",a,450,false,false);setTimeout(function(){showsecNew("imgsecregist","register")},1000);document.getElementById("_CLOSEX").onmousedown=closerefisterFormTwo};function closerefisterFormTwo(){closeFloatWindow();gSubmitFlag=true}function doSubmit_registerTwo(){var b=document.RegisterForm.email.value.Trim();var c=document.RegisterForm.usernick.value.Trim();var d=document.RegisterForm.pwd.value.Trim();var a=document.RegisterForm.seccode.value;if(checkemail(false)==false){return false}if(checkpassword()==false){return false}if(checkpassword2()==false){return false}if(checkusername(false)==false){return false}if(checkseccode(false)==false){return false}ajaxreg_divTwo("email="+encodeURI(b)+"&passwd="+encodeURI((d))+"&usernick="+encodeURI(c)+"&seccode="+encodeURI(a),1)}var ajaxregxmlHttp;function ajaxreg_divTwo(a,b){ajaxregxmlHttp=false;ajaxregxmlHttp=createXMLHttpRequestByObject("ajaxregxmlHttp");ajaxregxmlHttp.open("GET","/ajaxDivRegister.do?"+a+"&submittype="+b,true);ajaxregxmlHttp.onreadystatechange=callbackreg_divTwo;ajaxregxmlHttp.send(null)}function callbackreg_divTwo(){if(ajaxregxmlHttp.readyState==4){if(ajaxregxmlHttp.status==200){var d=ajaxregxmlHttp.responseXML.getElementsByTagName("eleid")[0].firstChild.data;var c=ajaxregxmlHttp.responseXML.getElementsByTagName("errinfo")[0].firstChild.data;var a=ajaxregxmlHttp.responseXML.getElementsByTagName("submittype")[0].firstChild.data;if(d!="null"&&c!="null"){var b=document.getElementById(d);errmsg(b,c)}if(a=="0"&&d!="null"&&c=="null"){var b=document.getElementById(d);infomsg(b)}else{if(a=="1"&&c=="null"&&d=="null"){refreshuserloginnav("top_usernav");doctopicsubmitNewTwo()}}}else{document.getElementById("ajaxinfo").innerHTML="网站繁忙，请刷新重新尝试！"}}}var lastseccode=lastpassword=lastemail="";function checkemail(a){var c=document.RegisterForm.email.value.Trim();var g=document.getElementById("div_email");if(c==""){errmsg(g,error_email_empty);return false}if(c==lastemail){return}else{lastemail=c}var f="";var d="";var b=f!=""?/()document.getElementById/i:null;var e=d!=""?/()document.getElementById/i:null;illegalemail=!(/^[\-\.\w]+@[\-\w]+(\.\w+)+$/.test(c));invalidemail=f!=""?!b.test(c):d!=""&&e.test(c);if(illegalemail||invalidemail){errmsg(g,illegalemail?error_email_illegal:(f!=""?error_email_invalid:error_email_censor));return false}if(a==true){ajaxreg("email="+encodeURI(c),0)}else{infomsg(g)}}function checkusername(a){var d=document.RegisterForm.usernick.value.Trim();var b=document.getElementById("div_usernick");if(d==""){errmsg(b,error_usernick_empty);return false}var c=d.replace(/[^\x00-\xff]/g,"**").length;if(c>14){errmsg(b,error_usernick_toolong);return false}if(a==true){ajaxreg("usernick="+encodeURI(d),0)}else{infomsg(b)}}function checkpassword(b){var a=document.RegisterForm.pwd.value;var d=document.getElementById("pwderror");if(a==""){errmsg(d,error_passwd_empty);return false}var c=a.length;if(c<6||c>16){errmsg(d,c<6?error_passwd_tooshort:error_passwd_toolong);return false}if(a==""||/[\'\"\\]/.test(a)){errmsg(d,error_passwd_illegal);return false}else{if(!b){checkpassword2(true)}}}function checkpassword2(b){var a=document.RegisterForm.pwd.value;var e=document.RegisterForm.pwd2.value;var d=document.getElementById("pwderror2");var c=document.getElementById("pwderror");if(e!=""){checkpassword(true)}if(a==""||(b&&e=="")){return false}if(a!=e){errmsg(d,error_passwd_notmatch);c.innerHTML="";return false}else{if(checkpassword(true)==false){return false}else{infomsg(d);infomsg(c)}}}function checkseccode(a){var c=document.RegisterForm.seccode.value;var b=document.getElementById("div_seccode");if(c==""){errmsg(b,error_seccode_empty);return false}if(c==lastseccode){return}else{lastseccode=c}if(a==true){ajaxreg("seccode="+encodeURI(c),0)}else{infomsg(b)}}function changeagree(){var a=document.getElementById("chkagree");var b=document.getElementById("btnReg");if(a.checked){b.style.display=""}else{b.style.display="none"}}function infomsg(a){a.innerHTML='<img src="/images/002.gif" align="absmiddle">'}function errmsg(a,b){a.innerHTML="<b>*</b>"+b;a.style.display=""}var regxmlHttp;function ajaxreg(a,b){regxmlHttp=createXMLHttpRequestByObject("regxmlHttp");regxmlHttp.open("GET","/ajaxRegister.do?"+a+"&submittype="+b,true);regxmlHttp.onreadystatechange=callbackregxmlHttp;regxmlHttp.send(null)}function callbackregxmlHttp(){if(regxmlHttp.readyState==4){if(regxmlHttp.status==200){setreg()}else{alert("网站繁忙，请刷新重新尝试！")}}}function setreg(){var d=regxmlHttp.responseXML.getElementsByTagName("eleid")[0].firstChild.data;var c=regxmlHttp.responseXML.getElementsByTagName("errinfo")[0].firstChild.data;var a=regxmlHttp.responseXML.getElementsByTagName("submittype")[0].firstChild.data;if(d!="null"&&c!="null"){var b=document.getElementById(d);errmsg(b,c);document.RegisterForm.onsubmit=function(){return false}}if(a=="0"&&d!="null"&&c=="null"){var b=document.getElementById(d);infomsg(b);document.RegisterForm.onsubmit=function(){return false}}else{if(a=="1"&&c=="null"&&d=="null"){document.RegisterForm.onsubmit=function(){return true};document.RegisterForm.submit()}}}function topicListloginRegister(){gSubmitFlag=true;var a='<div class="editor_login"><ul><li><span>E-mail：</span><input id="emaillogin" type="text" class="inp_txt" size="30" /></li><li><span>密码：</span><input id="pwdlogin" type="password"  class="inp_txt" size="30" /></li><li><span>验证码：</span><input id="seccodelogin" type="text" class="inp_txt wid50" maxlength="4" onkeydown="LoginSubmitNewEvent(event)"/><label class="img_yzm mar-lr8"><img id="imgseclogin" alt="" src="" /></label><a href="javascript:showsecNew(\'imgseclogin\',\'comments\');" class="block l width">看不清楚，换一个！</a></li><li><input id="LoginandSubmit" name="LoginandSubmit" type="button" value="立即登陆" class="inp_btn" onclick="return doTopicListSubmitTwo();"/></li><li id="err_infologin" style="display:none" class="error">&nbsp;</li></ul></div>';setFloatWindow("登录",a,360,false,false);setTimeout(function(){showsecNew("imgseclogin","comments")},1000);document.getElementById("_CLOSEX").onmousedown=closeloginForm}function doTopicListSubmitTwo(){if(getHdCookie(hdCookieName)==null){no_login_flag=0;ajaxflag=false;var b=document.getElementById("emaillogin");if(b.value.length==0){document.getElementById("err_infologin").innerHTML="邮件地址不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);b.focus();gSubmitFlag=true;return}var c=document.getElementById("pwdlogin");if(c.value.length==0){document.getElementById("err_infologin").innerHTML="密码不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);c.focus();gSubmitFlag=true;return}var a=document.getElementById("seccodelogin");if(a.value.length==0){document.getElementById("err_infologin").innerHTML="验证码不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);a.focus();gSubmitFlag=true;return}}changeRandTpoicListTwo();return}function topicListvalidateTwo(a){if(SubmitTopicLoginNewTwo()){if(a=="1"){topicListloginRegister()}else{closeloginForm();SubmitregisterFormTopicList()}}}function SubmitTopicLoginNewTwo(){var b=document.getElementById("topic_title");var a=HD.util.getData("content");if(KillSpace(b.value.Trim()).length==0){alert("标题不能为空!");return false}if(b.value.length>30){alert("标题不能过长！");return false}if(KillSpace(a.Trim()).length==0){alert("内容不能为空！");return false}if(a.length>10000){alert("内容不能超过1万字！");return false}return true}var doctopichttp=null;function doTopicSubmitTwo(){if(!gSubmitFlag){return false}gSubmitFlag=false;var e=document.getElementById("topic_title");var c=HD.util.getData("content");var d="";if(KillSpace(e.value.Trim()).length==0){document.getElementById("err_info").innerHTML="标题不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(e.value.length>38){document.getElementById("err_info").innerHTML="标题不能过长！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}e.value=KillSpace(e.value.Trim());if(KillSpace(c.Trim()).length==0){document.getElementById("err_info").innerHTML="内容不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(c.length>10000){document.getElementById("err_info").innerHTML="内容不能超过1万字！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}var b=document.getElementById("topic_seccode_li");var f=document.getElementById("captchaimg");if(getHdCookie(hdCookieName)==null){no_login_flag=1;var a=document.getElementById("seccode");if(a!=null){if(a.value.length==0){document.getElementById("err_info").innerHTML="验证码不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);a.focus();gSubmitFlag=true;return false}changeRandTpoicListTwo();return null}}else{no_login_flag=0;doctopicsubmitTwo();return}}function doctopicsubmitTwo(){var c=document.getElementById("doc_title").value;var g=document.getElementById("topic_title");var f=HD.util.getData("content");doctopichttp=createXMLHttpRequestByObject(doctopichttp);var d="/createDocTopic.do";var b="";if(ajaxflag){b="doc_title="+encodeURI(c)+"&topic_title="+encodeURI(g.value)+"&content="+encodeURIComponent(f)+"&type=doc&no_login_flag="+no_login_flag}else{var e=document.getElementById("emaillogin");var h=document.getElementById("pwdlogin");var a=document.getElementById("seccodelogin");b="doc_title="+encodeURI(c)+"&topic_title="+encodeURI(g.value)+"&content="+encodeURIComponent(f)+"&type=doc&email="+encodeURI(e.value)+"&pwd="+encodeURI(h.value)+"&seccode="+encodeURI(a.value)+"&no_login_flag="+no_login_flag}doctopichttp.open("POST",d,true);doctopichttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");doctopichttp.onreadystatechange=doctopicsubmit1Two;doctopichttp.send(b)}var testhttp=null;function changeRandTpoicListTwo(){testhttp=createXMLHttpRequestByObject("testhttp");var a="/ajaxCheckRand.do?randType=comments&rand=";if(getHdCookie(hdCookieName)==null&&no_login_flag==1){var a="/ajaxCheckRand.do?randType=comments&rand="+document.getElementById("seccode").value.Trim()}else{var a="/ajaxCheckRand.do?randType=comments&rand="+document.getElementById("seccodelogin").value.Trim()}testhttp.open("POST",a,true);testhttp.onreadystatechange=changeRandFlagTopicListTwo;testhttp.send(null)}function changeRandFlagTopicListTwo(){if(testhttp.readyState==4){if(testhttp.status==200){var a=testhttp.responseXML.getElementsByTagName("flag")[0].firstChild.data;if(a=="true"){doctopicsubmitTwo();return}else{if(getHdCookie(hdCookieName)==null&&no_login_flag==1){document.getElementById("err_info").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);document.getElementById("seccode").focus();document.getElementById("seccode").innerText="";showsec("imgsec","comments");gSubmitFlag=true;return false}else{document.getElementById("err_infologin").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);document.getElementById("seccodelogin").focus();document.getElementById("seccodelogin").innerText="";showsec("imgsec","comments");gSubmitFlag=true;return false}}}}}function doctopicsubmit1Two(){if(doctopichttp.readyState==4){if(doctopichttp.status==200){var a=doctopichttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;if(a=="true"){document.getElementById("topic_title").value="";try{UnloadConfirm.clear()}catch(c){}location.reload(true)}else{if(getHdCookie(hdCookieName)!=null||getHdCookie(hdCookieName)==null&&no_login_flag==1){var b=doctopichttp.responseXML.getElementsByTagName("FAILUREREASON")[0].firstChild.data;document.getElementById("err_info").innerHTML=""+b+"";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500)}else{document.getElementById("err_infologin").innerHTML=""+b+"";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);document.getElementById("seccodelogin").focus();document.getElementById("seccodelogin").innerText="";showsecNew("imgseclogin","comments")}}}}}function SubmitregisterFormTopicList(){var a='<div class="editor_register"><form method="post" name="RegisterForm"><span id="ajaxinfo"></span><ul><li><span>E-mail：</span><input id="emailregister" onblur="checkemail(true);" name="email" type="text" class="inp_txt" size="30"/><label id="div_email" class="red"></label><label class="block">作为登录的帐号</label></li>	<li><span>昵称：</span><input id="nickregister" name="usernick" onblur="checkusername(true);" type="text" class="inp_txt" size="30"/><label id="div_usernick" class="red"></label><label class="block">14个字符一下，注册后不可修改。</label></li><li><span>密码：</span><input id="pswregister" name="pwd" onblur="checkpassword();" type="password" class="inp_txt" size="30"/><label id="pwderror" class="red"></label></li><li><span>重复密码：</span><input id="confimpswregister" name="pwd2" onblur="checkpassword2();" type="password" class="inp_txt" size="30"/><label id="pwderror2" class="red"></label><a href="#" target="target"></a></li><li><span>验证码：</span><input name="seccode" type="text" onblur="checkseccode(true);" class="inp_txt wid50" maxlength="4"/><label class="img_yzm mar-r8 l"><img id="imgsecregist" alt="" src="" class="l"/></label><label id="div_seccode" class="red" style="display:none"></label></li><li><a href="javascript:showsecNew(\'imgsecregist\',\'register\');" class="blur">看不清楚，换一个！</a></li><li><input name="chkagree" id="chkagree" type="checkbox"  class="mar-r8" checked="checked" onclick="changeagree();"/>同意本站<a href="http://www.hudong.com/common/fwtk.jsp" target="_blank">服务条款</a></li><li class="a-l"><input id="btnReg" name="btnReg" type="submit" value="马上注册吧" class="inp_btn" onclick="if(doSubmit_registerTopicTwo()==false) return false"/></li></ul></form></div>';setFloatWindow("注册",a,450,false,false);setTimeout(function(){showsecNew("imgsecregist","register")},1000);document.getElementById("_CLOSEX").onmousedown=closerefisterFormTwo}function doSubmit_registerTopicTwo(){var b=document.RegisterForm.email.value.Trim();var c=document.RegisterForm.usernick.value.Trim();var d=document.RegisterForm.pwd.value.Trim();var a=document.RegisterForm.seccode.value;if(checkemail(false)==false){return false}if(checkpassword()==false){return false}if(checkpassword2()==false){return false}if(checkusername(false)==false){return false}if(checkseccode(false)==false){return false}ajaxregTopicTwo_div("email="+encodeURI(b)+"&passwd="+encodeURI((d))+"&usernick="+encodeURI(c)+"&seccode="+encodeURI(a),1)}var ajaxregTopicHttp;function ajaxregTopicTwo_div(a,b){ajaxregTopicHttp=false;ajaxregTopicHttp=createXMLHttpRequestByObject("ajaxregxmlHttp");ajaxregTopicHttp.open("GET","/ajaxDivRegister.do?"+a+"&submittype="+b,true);ajaxregTopicHttp.onreadystatechange=callbackregtopicTwo_div;ajaxregTopicHttp.send(null)}function callbackregtopicTwo_div(){if(ajaxregTopicHttp.readyState==4){if(ajaxregTopicHttp.status==200){var d=ajaxregTopicHttp.responseXML.getElementsByTagName("eleid")[0].firstChild.data;var c=ajaxregTopicHttp.responseXML.getElementsByTagName("errinfo")[0].firstChild.data;var a=ajaxregTopicHttp.responseXML.getElementsByTagName("submittype")[0].firstChild.data;if(d!="null"&&c!="null"){var b=document.getElementById(d);errmsg(b,c)}if(a=="0"&&d!="null"&&c=="null"){var b=document.getElementById(d);infomsg(b)}else{if(a=="1"&&c=="null"&&d=="null"){refreshuserloginnav("top_usernav");no_login_flag=0;doctopicsubmitTwo()}}}else{document.getElementById("ajaxinfo").innerHTML="网站繁忙，请刷新重新尝试！"}}}function SubmitregisterFormPost(){var a='<div class="editor_register"><form method="post" name="RegisterForm"><span id="ajaxinfo"></span><ul><li><span>E-mail：</span><input id="emailregister" onblur="checkemail(true);" name="email" type="text" class="inp_txt" size="30"/><label id="div_email" class="red"></label><label class="block">作为登录的帐号</label></li>	<li><span>昵称：</span><input id="nickregister" name="usernick" onblur="checkusername(true);" type="text" class="inp_txt" size="30"/><label id="div_usernick" class="red"></label><label class="block">14个字符一下，注册后不可修改。</label></li><li><span>密码：</span><input id="pswregister" name="pwd" onblur="checkpassword();" type="password" class="inp_txt" size="30"/><label id="pwderror" class="red"></label></li><li><span>重复密码：</span><input id="confimpswregister" name="pwd2" onblur="checkpassword2();" type="password" class="inp_txt" size="30"/><label id="pwderror2" class="red"></label><a href="#" target="target"></a></li><li><span>验证码：</span><input name="seccode" type="text" onblur="checkseccode(true);" class="inp_txt wid50" maxlength="4"/><label class="img_yzm mar-r8 l"><img id="imgsecregist" alt="" src="" class="l"/></label><label id="div_seccode" class="red" style="display:none"></label></li><li><a href="javascript:showsecNew(\'imgsecregist\',\'register\');" class="blur">看不清楚，换一个！</a></li><li><input name="chkagree" id="chkagree" type="checkbox"  class="mar-r8" checked="checked" onclick="changeagree();"/>同意本站<a href="http://www.hudong.com/common/fwtk.jsp" target="_blank">服务条款</a></li><li class="a-l"><input id="btnReg" name="btnReg" type="submit" value="马上注册吧" class="inp_btn" onclick="if(doSubmit_registerPostTwo()==false) return false"/></li></ul></form></div>';setFloatWindow("注册",a,450,false,false);setTimeout(function(){showsecNew("imgsecregist","register")},1000);document.getElementById("_CLOSEX").onmousedown=closerefisterFormTwo}function doSubmit_registerPostTwo(){var b=document.RegisterForm.email.value.Trim();var c=document.RegisterForm.usernick.value.Trim();var d=document.RegisterForm.pwd.value.Trim();var a=document.RegisterForm.seccode.value;if(checkemail(false)==false){return false}if(checkpassword()==false){return false}if(checkpassword2()==false){return false}if(checkusername(false)==false){return false}if(checkseccode(false)==false){return false}ajaxregPostTwo_div("email="+encodeURI(b)+"&passwd="+encodeURI((d))+"&usernick="+encodeURI(c)+"&seccode="+encodeURI(a),1)}var ajaxregPostHttp;function ajaxregPostTwo_div(a,b){ajaxregPostHttp=false;ajaxregPostHttp=createXMLHttpRequestByObject("ajaxregPostHttp");ajaxregPostHttp.open("GET","/ajaxDivRegister.do?"+a+"&submittype="+b,true);ajaxregPostHttp.onreadystatechange=callbackregpostTwo_div;ajaxregPostHttp.send(null)}function callbackregpostTwo_div(){if(ajaxregPostHttp.readyState==4){if(ajaxregPostHttp.status==200){var d=ajaxregPostHttp.responseXML.getElementsByTagName("eleid")[0].firstChild.data;var c=ajaxregPostHttp.responseXML.getElementsByTagName("errinfo")[0].firstChild.data;var a=ajaxregPostHttp.responseXML.getElementsByTagName("submittype")[0].firstChild.data;if(d!="null"&&c!="null"){var b=document.getElementById(d);errmsg(b,c)}if(a=="0"&&d!="null"&&c=="null"){var b=document.getElementById(d);infomsg(b)}else{if(a=="1"&&c=="null"&&d=="null"){refreshuserloginnav("top_usernav");no_login_flag=0;docpostajaxsubmitTwo()}}}else{document.getElementById("ajaxinfo").innerHTML="网站繁忙，请刷新重新尝试！"}}}function postloginRegister(){gSubmitFlag=true;var a='<div class="editor_login"><ul><li><span>E-mail：</span><input id="emaillogin" type="text" class="inp_txt" size="30" /></li><li><span>密码：</span><input id="pwdlogin" type="password"  class="inp_txt" size="30" /></li><li><span>验证码：</span><input id="seccodelogin" type="text" class="inp_txt wid50" maxlength="4" onkeydown="LoginSubmitNewEvent(event)"/><label class="img_yzm mar-lr8"><img id="imgseclogin" alt="" src="" /></label><a href="javascript:showsecNew(\'imgseclogin\',\'comments\');" class="block l width">看不清楚，换一个！</a></li><li><input id="LoginandSubmit" name="LoginandSubmit" type="button" value="立即登陆" class="inp_btn" onclick="return doPostSubmitTwo();"/></li><li id="err_infologin" style="display:none" class="error">&nbsp;</li></ul></div>';setFloatWindow("登陆",a,360,false,false);setTimeout(function(){showsecNew("imgseclogin","comments")},1000);document.getElementById("_CLOSEX").onmousedown=closeloginForm}function postvalidateTwo(a){if(SubmitPostLoginNewTwo()){if(a=="1"){postloginRegister()}else{closeloginForm();SubmitregisterFormPost()}}}function SubmitPostLoginNewTwo(){var b=document.getElementById("post_title");var a=HD.util.getData("content");if(KillSpace(b.value.Trim()).length==0){alert("标题不能为空!");return false}if(b.value.length>30){alert("标题不能过长！");return false}if(KillSpace(a.Trim()).length==0){alert("内容不能为空！");return false}if(a.length>10000){alert("内容不能超过1万字！");return false}return true}function doPostSubmitTwo(){if(getHdCookie(hdCookieName)==null){no_login_flag=0;ajaxpostflag=false;var b=document.getElementById("emaillogin");if(b.value.length==0){document.getElementById("err_infologin").innerHTML="邮件地址不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);b.focus();gSubmitFlag=true;return false}var c=document.getElementById("pwdlogin");if(c.value.length==0){document.getElementById("err_infologin").innerHTML="密码不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);c.focus();gSubmitFlag=true;return false}var a=document.getElementById("seccodelogin");if(a.value.length==0){document.getElementById("err_infologin").innerHTML="验证码不能为空！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);a.focus();gSubmitFlag=true;return false}}changeRandPostNewTwo();return}function docPostSubmitNewTwo(){if(!gSubmitFlag){return false}gSubmitFlag=false;var d=document.getElementById("post_title");var b=HD.util.getData("content");var c="";if(KillSpace(d.value.Trim()).length==0){document.getElementById("err_info").innerHTML="标题不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(d.value.length>38){document.getElementById("err_info").innerHTML="标题不能过长！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}d.value=KillSpace(d.value.Trim());b=KillSpace(b.Trim());if(b.length==0){document.getElementById("err_info").innerHTML="内容不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(b.length>10000){document.getElementById("err_info").innerHTML="内容不能超过1万字！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);gSubmitFlag=true;return false}if(getHdCookie(hdCookieName)==null){no_login_flag=1;var a=document.getElementById("seccode");if(a.value.length==0){document.getElementById("err_info").innerHTML="验证码不能为空！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);a.focus();gSubmitFlag=true;return false}changeRandPostNewTwo();return null}else{no_login_flag=0;docpostajaxsubmitTwo();return}}var docposthttp=null;function docpostajaxsubmitTwo(){var e=document.getElementById("doc_title").value;var a=document.getElementById("post_title");var b=HD.util.getData("content");var d=document.getElementById("topics_id");docposthttp=createXMLHttpRequestByObject("docposthttp");var c="/createDocPost.do";var i="";if(ajaxpostflag){i="doc_title="+encodeURI(e)+"&post_title="+encodeURI(a.value)+"&content="+encodeURIComponent(b)+"&topics_id="+encodeURI(d.value)+"&no_login_flag="+no_login_flag+"&type=post"}else{var g=document.getElementById("emaillogin");var f=document.getElementById("pwdlogin");var h=document.getElementById("seccodelogin");i="doc_title="+encodeURI(e)+"&post_title="+encodeURI(a.value)+"&content="+encodeURIComponent(b)+"&topics_id="+encodeURI(d.value)+"&email="+encodeURI(g.value)+"&pwd="+encodeURI(f.value)+"&seccode="+encodeURI(h.value)+"&no_login_flag="+no_login_flag+"&type=post"}docposthttp.open("POST",c,true);docposthttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");docposthttp.onreadystatechange=docpostajaxsubmit1Two;docposthttp.send(i)}function docpostajaxsubmit1Two(){if(docposthttp.readyState==4){if(docposthttp.status==200){gSubmitFlag=true;var a=docposthttp.responseXML.getElementsByTagName("FLAG")[0].firstChild.data;if(a=="true"){try{UnloadConfirm.clear()}catch(c){}location.reload()}else{if(getHdCookie(hdCookieName)!=null||getHdCookie(hdCookieName)==null&&no_login_flag==1){var b=docposthttp.responseXML.getElementsByTagName("FAILUREREASON")[0].firstChild.data;document.getElementById("err_info").innerHTML=""+b+"";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500)}else{document.getElementById("err_infologin").innerHTML=""+b+"";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);document.getElementById("seccodelogin").focus();document.getElementById("seccodelogin").innerText="";showsecNew("imgseclogin","comments")}}}}}var randposthttp=null;function changeRandPostNewTwo(){randposthttp=createXMLHttpRequestByObject("randposthttp");if(getHdCookie(hdCookieName)==null&&no_login_flag==1){var a="/ajaxCheckRand.do?randType=comments&rand="+document.getElementById("seccode").value.Trim()}else{var a="/ajaxCheckRand.do?randType=comments&rand="+document.getElementById("seccodelogin").value.Trim()}randposthttp.open("POST",a,true);randposthttp.onreadystatechange=changeRandFlagPostNewTwo;randposthttp.send(null)}function changeRandFlagPostNewTwo(){if(randposthttp.readyState==4){if(randposthttp.status==200){var a=randposthttp.responseXML.getElementsByTagName("flag")[0].firstChild.data;if(a=="true"){document.getElementById("seccode").value="";docpostajaxsubmitTwo();return}else{if(getHdCookie(hdCookieName)==null&&no_login_flag==1){document.getElementById("err_info").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);document.getElementById("seccode").focus();document.getElementById("seccode").innerText="";showsec("imgsec","comments");gSubmitFlag=true;return false}else{document.getElementById("err_infologin").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_infologin").style.display="block";setTimeout("document.getElementById('err_infologin').style.display='none';",2500);document.getElementById("seccodelogin").focus();document.getElementById("seccodelogin").innerText="";showsec("imgsec","comments");gSubmitFlag=true;return false}}}}}function closepopwindow(){document.getElementById("topic_title").value="";document.getElementById("topic_content").value="";gSubmitFlag=true;if(!ajaxflag){if("true"==user_isrealexpert){document.getElementById("experttopic").style.display=""}if("true"==user_isexpert||"true"==user_isrealexpert){document.getElementById("show_thesaurus_dt").innerHTML=document.getElementById("show_thesaurus_dt").innerHTML+'<a id="addthesaurus" href="javascript:thesaurusIfLock();" class="r">我来补充</a>';document.getElementById("show_thesaurus").style.display="block"}document.getElementById("_doc_flag").value="1";document.getElementById("topic_email_li").style.display="none";document.getElementById("topic_pwd_li").style.display="none";document.getElementById("topic_seccode_li").style.display="none";document.getElementById("captchaimg").style.display="none";login=1;ajaxflag=true}closeFloatWindow()}var testhttp=null;function checkRand(){gSubmitFlag=false;testhttp=createXMLHttpRequestByObject("testhttp");var a="/ajaxCheckRand.do?randType=comments&rand="+document.getElementById("seccode").value.Trim();testhttp.open("POST",a,true);testhttp.onreadystatechange=changeRandFlag;testhttp.send(null)}function changeRandFlag(){if(testhttp.readyState==4){if(testhttp.status==200){var a=testhttp.responseXML.getElementsByTagName("flag")[0].firstChild.data;if(a=="true"){ajaxflag=false;doctopicsubmit();return}else{document.getElementById("err_info").innerHTML="验证码不准确，请重新输入！";document.getElementById("err_info").style.display="block";setTimeout("document.getElementById('err_info').style.display='none';",2500);document.getElementById("seccode").focus();document.getElementById("seccode").innerText="";showsec("imgsec","comments");gSubmitFlag=true;return false}}}}function abc(){var a=document.getElementById("doc_title").value;var b=document.createElement("form");b.target="_blank";b.method="post";document.body.appendChild(b);b.action="http://wikibar.hudong.com/"+encodeURI(a);b.submit();b.parentNode.removeChild(b)}function html2text(a){a=a.replace(/<br[\s\/]{0,2}>/ig,"\r\n");a=a.replace(/<.*?>/ig,"");return a}function getQuote(c,a,f){var b=document.getElementById(f);var e=html2text(b.innerHTML);if(e.length>=100){e=e.substring(0,100)+"..."}if(e.length>0){var d="";d+='<div class="bor-ccc">';d+='<strong>QUOTE:</strong>原帖由<i class="pad10">'+c+"</i>于 "+a+" 发表：<br/>";d+=e;d+="</div>";d+="<br />";HD.util.changeData("content",d);window.scroll(0,document.getElementById("textarea").offsetTop)}};