function createXMLHTTP(){var b=false;if(window.XMLHttpRequest){b=new XMLHttpRequest();}else{if(window.ActiveXObject){try{b=new ActiveXObject("Msxml2.XMLHTTP");}catch(a){try{b=new ActiveXObject("Microsoft.XMLHTTP");}catch(a){}}}}return b;}String.prototype.trim=function(){return this.replace(/(^[\s]*)|([\s]*$)/g,"");};function getLength(e){var d=e.EditorDocument;var a;if(document.all){var c=d.body.innerText.trim();a=c.length;}else{var b=d.createRange();b.selectNodeContents(d.body);var c=b.toString().trim();a=c.length;}return a;}function getTopics(a){if(a&&parseInt(a)>0){var d=document.getElementById("topic_order");if(d&&d.value!=""){var e=d.value;getmodule("topic_ls_con","bo_id=middle_part&bid="+a+"&order="+e);var c=document.getElementById("topic_order");for(var b=0;b<c.length;b++){if(c.options[b].value==e){c.options[b].selected=true;break;}}}}}function getTargetTopics(a,b){if(a&&parseInt(a)>0){getmodule("topic_ls_con","bo_id=middle_part&bid="+a+"&target="+b);}}function createFCK(b){if(b&&b!=""){var a=new FCKeditor(b);a.BasePath="fckeditor/";a.Config.AutoDetectLanguage=false;a.Config.DefaultLanguage="zh-cn";a.ToolbarSet="139sc-bbs";a.Value="";a.ReplaceTextarea();}}function createEditFCK(c,b){if($("topic_reply_area_new_con")){$("topic_reply_area_new_con").style.display="none";}if(b&&b!=""){var a="readContent.jsp?fname="+b+"&r="+Math.random();new Ajax.Request(a,{method:"get",encoding:"GBK",onSuccess:function(e){var l=e.responseText;var f=l.indexOf("&lt;");while(f>=0){l=l.replace("&lt;","<");l=l.replace("&gt;",">");f=l.indexOf("&lt;");}var j=l.indexOf("&#59;");while(j>=0){l=l.replace("&#59;",";");j=l.indexOf("&#59;");}var i=l.indexOf("&#44;");while(i>=0){l=l.replace("&#44;",",");i=l.indexOf("&#44;");}var h=l.indexOf("&quot;");while(h>=0){l=l.replace("&quot;",'"');h=l.indexOf("&quot;");}var g=l.indexOf("&#039;");while(g>=0){l=l.replace("&#039;","'");g=l.indexOf("&#039;");}if(c&&c!=""){var k=$(c);if(k){k.value=l;}var d=new FCKeditor(c);d.BasePath="/fckeditor/";d.Config.AutoDetectLanguage=false;d.Config.DefaultLanguage="zh-cn";d.ToolbarSet="139sc-bbs";d.ReplaceTextarea();}},onFailure:function(){if(c&&c!=""){var d=$(c);d.value="";var e=new FCKeditor(c);e.BasePath="/fckeditor/";e.Config.AutoDetectLanguage=false;e.Config.DefaultLanguage="zh-cn";e.ToolbarSet="139sc-bbs";e.ReplaceTextarea();}}});}}function getAbstract(b){var d=b.EditorDocument;var e="";if(document.all){var e=d.body.innerText;var a=e.length;if(a>100){e=e.substring(0,100)+"......";}}else{var c=d.createRange();c.selectNodeContents(d.body);var e=c.toString();var a=e.length;if(a>100){e=e.substring(0,100)+"......";}}return e;}function publishTopic(e){if(e&&parseInt(e)>0){getmodule("check_right_container","bo_id=check_right&bid="+e);var g=document.getElementById("check_right_container");if(g){var f=g.innerHTML;if(f.indexOf("err000")>=0){callLoginDIV();return;}else{var k=document.getElementById("topic_title");if(!k||trim(k.value)==""){alert("\u8bf7\u586b\u5199\u8bdd\u9898\u6807\u9898\uff01");return false;}var l=FCKeditorAPI.GetInstance("topic_content_area");var h=l.GetXHTML();if(!h||trim(h)==""){alert("\u8bf7\u586b\u5199\u8bdd\u9898\u5185\u5bb9\uff01");return false;}if(getLength(l)>10000){alert("话题内容不能超过10000字，请修改！");return false;}var i=encodeURI(getAbstract(l));i=i.replace(/&/g,"\\u0026");var a=$("btn_pub_topic");var a=document.getElementById("btn_pub_topic");var b="ajax.do?method=doApp&app_attribute=publishTopic";var m=encodeURI(k.value).replace(/&/g,"\\u0026");var c=encodeURI(h);c=c.replace(/&/g,"\\u0026");var d="bid="+e+"&title="+m+"&content="+c+"&abstractCnt="+i;var j=createXMLHTTP();if(!j){alert("Cannot create XMLHTTP instance");return false;}j.onreadystatechange=function(){if(j.readyState==4){if(j.status==200){result=j.responseText;myarray=result.split("&");alert(myarray[0]);if(result.indexOf("\u6210\u529f")){getmodule("board_topic_ls_con","bo_id=get_board_topics&board_id="+e);k.value="";l.SetData("");if(a){a.disabled=false;}}else{if(a){a.disabled=false;}}}else{alert("系统错误，请联系我们的系统管理人员。谢谢合作！");}}};j.open("POST",b,true);j.setRequestHeader("Content-type","application/x-www-form-urlencoded");j.send(d);if(a){a.disabled=true;}}}}}function getTopicContent(e,d,b){if(d){var c=null;if(b=="topic"){c=$("topic_cnt_con_"+e);}else{c=$("topic_reply_cnt_con_"+e);}var a="readContent.jsp?fname="+d+"&r="+Math.random();new Ajax.Request(a,{method:"get",onSuccess:function(l){var f=l.responseText;if(c&&f){var g=f.indexOf("&lt;");while(g>=0){f=f.replace("&lt;","<");f=f.replace("&gt;",">");g=f.indexOf("&lt;");}var k=f.indexOf("&#59;");while(k>=0){f=f.replace("&#59;",";");k=f.indexOf("&#59;");}var j=f.indexOf("&#44;");while(j>=0){f=f.replace("&#44;",",");j=f.indexOf("&#44;");}var i=f.indexOf("&quot;");while(i>=0){f=f.replace("&quot;",'"');i=f.indexOf("&quot;");}var h=f.indexOf("&#039;");while(h>=0){f=f.replace("&#039;","'");h=f.indexOf("&#039;");}c.innerHTML=f;}}});}}function quote(f,c,e,d){jQuery("#topic_reply_cnt_con_"+f).html();var a="<div class='artcon'><div class='quote'><h6>引用<em>"+c+"</em>于 "+e+"发布的：</h6><p>"+jQuery("#topic_reply_cnt_con_"+f).html()+"</p></div><p></p></div>";var b=FCKeditorAPI.GetInstance("reply_content_area");b.SetData(a);window.location.href="#qa5";}function replyTopic(h,e){var g=parseInt(document.getElementById("totalitem").value)+1;var f=document.getElementById("pagesize").value;var l=Math.ceil(g/f);if(h&&parseInt(h)>0&&e&&parseInt(e)>0){getmodule("check_right_container","bo_id=check_right&bid="+h);var j=document.getElementById("check_right_container");if(j){var i=j.innerHTML;if(i.indexOf("err000")>=0){callLoginDIV();return;}else{var n=FCKeditorAPI.GetInstance("reply_content_area");var k=n.GetXHTML();if(!k||trim(k)==""){alert("\u8bf7\u586b\u5199\u56de\u590d\u5185\u5bb9\uff01");checkReplyHit();return false;}if(getLength(n)>10000){alert("回复内容不能超过10000字，请修改！");return false;}var b=document.getElementById("btn_reply_topic_"+e);var a="ajax.do?method=doApp&app_attribute=replyTopic";var c=encodeURI(k).replace(/&/g,"\\u0026");var d="bid="+h+"&tid="+e+"&content="+c;var m=createXMLHTTP();if(!m){alert("Cannot create XMLHTTP instance");return false;}m.onreadystatechange=function(){if(m.readyState==4){if(m.status==200){result=m.responseText;alert(result);if(result.indexOf("\u6210\u529f")){window.location="initPage?topid=board_top&buid=detail&tailid=tail&board_id="+h+"&tid="+e;}else{if(b){b.disabled=false;}}}else{alert("系统错误，请联系我们的系统管理人员。谢谢合作！");}}};m.open("POST",a,true);m.setRequestHeader("Content-type","application/x-www-form-urlencoded");m.send(d);if(b){b.disabled=true;}}}}}function delTopicReply(a,h,b,c,e){var d=confirm("\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f");if(d){getmodule("check_right_container","bo_id=del_topic_reply&bid="+a+"&tid="+h+"&rid="+b+"&r="+Math.random());var g=$("del_topic_reply_"+b+"_act_result_msg");if(g&&(g.innerHTML).indexOf("1")>=0){alert("\u5220\u9664\u6210\u529f\uff01");var f=e;if(e>(c/2)&&c%2==1){f=f-1;}if(f==0){f=1;}getmodule("topic_reply_ls","bo_id=topic_reply_ls&board_id="+a+"&tid="+h+"&currepage="+f);}}}function toEditTopicReply(a,d,b,c){getmodule("topic_and_reply_ls_con","bo_id=edit_topic_reply&bid="+a+"&tid="+d+"&rid="+b+"&page="+c);}function editTopicReply(g,e,n,f,k){if(g&&parseInt(g)>0&&e&&parseInt(e)>0&&n&&parseInt(n)>0){getmodule("check_right_container","bo_id=check_right&bid="+g);var i=document.getElementById("check_right_container");if(i){var h=i.innerHTML;if(h.indexOf("err000")>=0){callLoginDIV();return;}else{var m=FCKeditorAPI.GetInstance("reply_content_area_2");var j=m.GetXHTML();if(!j||trim(j)==""){alert("\u8bf7\u586b\u5199\u56de\u590d\u5185\u5bb9\uff01");return false;}if(getLength(m)>10000){alert("回复内容不能超过10000字，请修改！");return false;}if(j.indexOf("<div>")>=0){j=j.replace("<div>","");}if(j.lastIndexOf("</div>")>=0){j=j.replace("</div>","");}var b=document.getElementById("btn_edit_reply_topic_"+n);var a="ajax.do?method=doApp&app_attribute=editTopicReply";var c=encodeURI(j).replace(/&/g,"\\u0026");var d="bid="+g+"&tid="+e+"&rid="+n+"&fileName="+f+"&content="+c;var l=createXMLHTTP();if(!l){alert("Cannot create XMLHTTP instance");return false;}l.onreadystatechange=function(){if(l.readyState==4){if(l.status==200){result=l.responseText;alert(result);if(result.indexOf("\u6210\u529f")){window.location.reload();}else{if(b){b.disabled=false;}}}else{alert("系统错误，请联系我们的系统管理人员。谢谢合作！");}}};l.open("POST",a,true);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(d);if(b){b.disabled=true;}}}}}function toEditTopic(a,b){getmodule("topic_and_reply_ls_con","bo_id=edit_topic&bid="+a+"&tid="+b);}function editTopic(g,e,f){if(g&&parseInt(g)>0&&e&&parseInt(e)>0){getmodule("check_right_container","bo_id=check_right&bid="+g);var i=document.getElementById("check_right_container");if(i){var h=i.innerHTML;if(h.indexOf("err000")>=0){callLoginDIV();return;}else{var m=document.getElementById("topic_title");if(!m||trim(m.value)==""){alert("\u8bf7\u586b\u5199\u8bdd\u9898\u6807\u9898\uff01");return false;}var n=FCKeditorAPI.GetInstance("topic_content_area_2");var j=n.GetXHTML();if(!j||trim(j)==""){alert("\u8bf7\u586b\u5199\u8bdd\u9898\u5185\u5bb9\uff01");return false;}if(getLength(n)>10000){alert("话题内容不能超过10000字，请修改！");return false;}if(j.indexOf("<div>")>=0){j=j.replace("<div>","");}if(j.lastIndexOf("</div>")>=0){j=j.replace("</div>","");}var k=encodeURI(getAbstract(n));k=k.replace(/&/g,"\\u0026");var a=document.getElementById("btn_reply_topic_"+e);var b="ajax.do?method=doApp&app_attribute=editTopic";var o=encodeURI(m.value).replace(/&/g,"\\u0026");var c=encodeURI(j).replace(/&/g,"\\u0026");var d="bid="+g+"&tid="+e+"&fileName="+f+"&title="+o+"&content="+c+"&abstractCnt="+k;var l=createXMLHTTP();if(!l){alert("Cannot create XMLHTTP instance");return false;}l.onreadystatechange=function(){if(l.readyState==4){if(l.status==200){result=l.responseText;alert(result);if(result.indexOf("\u6210\u529f")){window.location.reload();}else{if(a){a.disabled=false;}}}else{alert("系统错误，请联系我们的系统管理人员。谢谢合作！");}}};l.open("POST",b,true);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.send(d);if(a){a.disabled=true;}}}}}function delTopic(a,d){var b=confirm("\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f");if(b){getmodule("check_right_container","bo_id=del_topic&bid="+a+"&tid="+d);var c=$("del_topic_"+d+"_act_result_msg");if(c&&(c.innerHTML).indexOf("1")>=0){alert("\u5220\u9664\u6210\u529f\uff01");window.location.href="initPage?topid=board_top&buid=topics&tailid=tail&board_id="+a;}}}function beGood(g,e,i){if("true"==i){var l=confirm("\u786e\u5b9a\u8981\u8bbe\u4e3a\u7cbe\u534e\u5417\uff1f");var j="";var h="";var d="";if(l){getmodule("pubwin","bo_id=gongxinji_begood_bo&tid="+e);if(document.getElementById("custmobile")){j=document.getElementById("custmobile").value;}if(document.getElementById("custid")){h=document.getElementById("custid").value;}if(document.getElementById("sssscustmobile")){d=document.getElementById("sssscustmobile").value;}if(d=="13408671971"){var c="ajax.do?method=doApp&app_attribute=addUserCreditValTopic&marketId=1500&CreditId=100004&mobile="+j;var a=new Ajax.Request(c,{asynchronous:false,method:"get",evalScripts:true,onSuccess:function f(m){str=m.responseText;}});if(str.substring(0,5)=="66666"){var b=str.substring(5,6);getmodule("nodiv","bo_id=gxj_insert_topic_bo&custid="+h+"&chanle=306&type="+b);getmodule("nodiv","bo_id=gxj_insert_system&custid="+h);}}getmodule("hidden_msg_con","bo_id=be_good_topic&bid="+g+"&tid="+e+"&flag=true");var k=$("be_good_topic_"+e+"_act_result_msg");if(k){if(k.innerHTML=="1"){alert("\u8bbe\u4e3a\u7cbe\u534e\u6210\u529f\uff01");$("be_good_true_"+e).style.display="none";$("be_good_false_"+e).style.display="inline";}else{alert("\u8bbe\u4e3a\u7cbe\u534e\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\uff01");}}}}else{if("false"==i){var l=confirm("\u786e\u5b9a\u8981\u53d6\u6d88\u7cbe\u534e\u5417\uff1f");if(l){getmodule("hidden_msg_con","bo_id=be_good_topic&bid="+g+"&tid="+e+"&flag=false");var k=$("be_good_topic_"+e+"_act_result_msg");if(k){if(k.innerHTML=="1"){alert("\u53d6\u6d88\u7cbe\u534e\u6210\u529f\uff01");$("be_good_true_"+e).style.display="inline";$("be_good_false_"+e).style.display="none";}else{alert("\u53d6\u6d88\u7cbe\u534e\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\uff01");}}}}else{alert("\u51fa\u9519\u4e86\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\uff01");}}}function onTop(c,e,b){if("true"==b){var d=confirm("\u786e\u5b9a\u8981\u7f6e\u9876\u5417\uff1f");if(d){getmodule("hidden_msg_con","bo_id=on_top_topic&bid="+c+"&tid="+e+"&flag=true");var a=$("on_top_topic_"+e+"_act_result_msg");if(a){if(a.innerHTML=="1"){alert("\u7f6e\u9876\u6210\u529f\uff01");$("on_top_true_"+e).style.display="none";$("on_top_false_"+e).style.display="inline";}else{alert("\u7f6e\u9876\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\uff01");}}}}else{if("false"==b){var d=confirm("\u786e\u5b9a\u8981\u53d6\u6d88\u7f6e\u9876\u5417\uff1f");if(d){getmodule("hidden_msg_con","bo_id=on_top_topic&bid="+c+"&tid="+e+"&flag=false");var a=$("on_top_topic_"+e+"_act_result_msg");if(a){if(a.innerHTML=="1"){alert("\u53d6\u6d88\u7f6e\u9876\u6210\u529f\uff01");$("on_top_true_"+e).style.display="inline";$("on_top_false_"+e).style.display="none";}else{alert("\u53d6\u6d88\u7f6e\u9876\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5\uff01");}}}}else{alert("\u51fa\u9519\u4e86\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458\uff01");}}}function toBeFriend(d){getmodule("check_right_container","bo_id=check_right&bid=1");var c=$("check_right_container");if(c){var b=c.innerHTML;if(b.indexOf("err000")>=0){callLoginDIV();return;}else{getmodule("check_right_container","bo_id=is_my_friend&friend_id="+d);var a=$(d+"_is_my_friend");if(a&&(a.innerHTML).indexOf("1")>=0){alert("该用户应经是我的好友，不要重复添加。");return;}getmodule("pubwin","bo_id=frmanage_group_div&friend_id="+d);}}}function showHideDiv(a){if(a&&a!=""){document.getElementById("new_bt_div_con").style.display="block";}else{document.getElementById("unlogin_tip_div_con").style.display="block";}}function isIE6OrLower(){var b=navigator.userAgent.toLowerCase();var c=b.match(/msie\s+([\d\.]+)/);if(c){var a=parseFloat(c[1]);if(a<=6){return true;}else{return false;}}else{return false;}}function asyncInnerHTML(a,d){var b=document.createElement("span");var c=document.createDocumentFragment();b.innerHTML=a;(function(){if(b.firstChild){c.appendChild(b.firstChild);setTimeout(arguments.callee,0);}else{d(c);}})();}function catMassge(){var d;var c;for(var b=2;b<=11;b++){c=document.getElementById("aaaa_"+b);var a;if(document.getElementById("idvalue_"+b)){a=document.getElementById("idvalue_"+b).value;}d=c.innerText;if(d.length>100){d=d.substring(0,100)+"  .....</a>";}c.innerHTML=d;}}
