var b_open=0,i_open=0,u_open=0,s_open=0,indent_open=0,left_open=0,right_open=0,center_open=0,quote_open=0,code_open=0,bbtags=[],myAgent=navigator.userAgent.toLowerCase(),myVersion=parseInt(navigator.appVersion),is_ie=myAgent.indexOf("msie")!=-1&&myAgent.indexOf("opera")==-1,is_win=myAgent.indexOf("win")!=-1||myAgent.indexOf("16bit")!=-1;function isAlphaNumeric(a){return a.match(/^[a-zA-Z0-9]+$/)?true:false}
function CheckAddnews(){var a=document.t_post_form.title.value,b=document.t_post_form.t_mes.value;if(a.length<1){alert("Please enter your title at least 1 characters.");document.t_post_form.title.focus();return false}else if(b.length<5){alert("Please enter your messages at least 5 characters.");document.t_post_form.t_mes.focus();return false}else return true}
function CheckAddprivilege(){var a=document.Addprivilege.account.value;if(a.length<1){alert("Please enter account ID at least 1 characters.");document.Addprivilege.account.focus();return false}else return true}
function CheckAddreport(){var a=document.Addreport.poster.value,b=document.Addreport.report.value;if(a.length<4||a.length>24){alert("Please enter your name between 4 - 24 characters.");document.Addreport.poster.focus();return false}else if(b.length<5){alert("Please enter your messages at least 5 characters.");document.Addreport.report.focus();return false}else return document.Addreport.Submit.disabled=true}
function CheckPostmessage(a){var b=document.getElementById(a).t_title.value,c=document.getElementById(a).t_mes.value;if(b.length<3){alert("You must enter messages of Topic Title at least 3 characters to post.");document.getElementById(a).t_title.focus();return false}else if(c.length<3){alert("You must enter messages at least 3 characters to post.");document.getElementById(a).t_mes.focus();return false}else{if(document.getElementById(a).newpoll.value=="1")return CheckPoll();return document.getElementById(a).Submit.disabled=
true}}function CheckReplymessage(a){var b=document.getElementById(a).t_mes.value;if(b.length<3){alert("You must enter messages at least 3 characters to post.");document.getElementById(a).t_mes.focus();return false}else return document.getElementById(a).Submit.disabled=true}
function CheckEdittopic(a){a=document.Edit_Topic_Form.t_title.value;if(a.length<3){alert("You must enter messages of Topic Title at least 3 characters to post.");document.Edit_Topic_Form.t_title.focus();return false}else return document.Edit_Topic_Form.Submit.disabled=true}
function CheckPostlength(a,b){var c=document.getElementById(a).t_mes.value.length;if(c>b){alert("Please input your post messages less than "+b+" characters ["+c+"]");document.getElementById(a).t_mes.focus();return false}return true}function CheckMod(){return document.topic_option.code.value=="00"?false:true}
function CheckRank(){var a=document.Ranking_Sort.job.value,b=document.Ranking_Sort.ptype.value,c=document.Ranking_Sort.key.value,d=document.Ranking_Sort.status.value,f=document.Ranking_Sort.rows.value,e=document.Ranking_Sort.charname.value,g=document.Ranking_Sort.ctype.value;if(f<1||f>100){alert("Please input 1-100 row(s) only");return false}else{document.Ranking_Sort.Button.disabled=true;window.location.href="index.php?act=p_rank&charname="+e+"&ctype="+g+"&job="+a+"&ptype="+b+"&key="+c+"&status="+
d+"&rows="+f+"&st=0";return true}}function hide_menu(a,b){if(document.getElementById(a).style.display==""){document.getElementById(a).style.display="none";a=new Date;a.setTime(a.getTime()+2592000);document.cookie=" "+b+"=1;expires="+a.toGMTString()+";path=/ "}else{document.getElementById(a).style.display="";a=new Date;a.setTime(a.getTime()-2592000);document.cookie=""+b+"=1;expires="+a.toGMTString()+";path=/"}}
function adds_tags(a,b,c,d){var f=false;a=document.getElementById(a).t_mes;var e=navigator.userAgent.toLowerCase(),g=parseInt(navigator.appVersion),h=e.indexOf("msie")!=-1&&e.indexOf("opera")==-1;e=e.indexOf("win")!=-1||e.indexOf("16bit")!=-1;if(g>=4&&h&&e)if(a.isTextEdit){a.focus();g=document.selection;h=g.createRange();if((g.type=="Text"||g.type=="None")&&h!=null){if(c!=""&&h.text.length>0)b+=h.text+c;else if(d)f=true;h.text=b}}else{if(d)f=true;a.value+=b}else{if(d)f=true;a.value+=b}a.focus();return f}
function hyperlink(a){window.location.href=""+a+""}function tag_url(a){var b=window.prompt("Enter the complete URL for the hyperlink","http://"),c=window.prompt("Enter the title of the webpage","My Webpage");if(b=="http://"){alert("Error! You must enter a URL");return false}b&&adds_tags(a,"[url="+b+"]"+c+"[/url]","",false)}
function tag_image(a){var b=window.prompt("Enter the complete URL for the the image","http://");if(b=="http://"){alert("Error! You must enter a URL");return false}b&&adds_tags(a,"[img]"+b+"[/img]","",false)}function tag_email(a){var b=window.prompt("Enter the email address","");if(b==""){alert("You must enter an email address");return false}b&&adds_tags(a,"[email]"+b+"[/email]","",false)}function tag_list(a,b){b=b?"=1":"";adds_tags(a,"[list"+b+"]\n","",false);adds_list(a)}
function adds_list(a){var b=window.prompt("Enter a list item","");if(b==""||b==null){adds_tags(a,"[/list]","",false);return false}if(b){adds_tags(a,"[*]"+b+"\n","",false);adds_list(a)}}function emotion(a,b){adds_tags(a," "+b+" ","",false)}function openwindows(a,b,c,d,f){window.open(""+a+"","","menubar="+b+",scrollbars="+c+",width="+d+",height="+f+"")}
function page_jump(a,b,c){c=window.prompt("Please enter a page number to jump to between 1 and "+c+"","2");if(c>0)window.location.href=""+a+"&st="+b*(c-1)+""}function page_jump_(a,b,c,d){d=window.prompt("Please enter a page number to jump to between 1 and "+d+"","2");d>0&&page_select(""+a+"",""+b+"st="+c*(d-1)+"")}function delete_post(a){if(confirm("Are you sure you want to delete this message?"))window.location.href=a;else alert("Ok, no action has been taken")}
function link_to_post(a){window.prompt("Manually copy the direct link to this post below to store the link in your computer's clipboard",""+a+"")}function change_page(){var a=document.Adminmenu.admin_options.value;window.location.href=a}var prompt_start="Enter the text to be formatted";function hstat(a){}function cstat(){var a=stacksize(bbtags);if(a<1||a==null)a=0;bbtags[0]||(a=0)}function stacksize(a){for(i=0;i<a.length;i++)if(a[i]==""||a[i]==null||a=="undefined")return i;return a.length}
function pushstack(a,b){arraysize=stacksize(a);a[arraysize]=b}function get_easy_mode_state(){return false}function popstack(a){arraysize=stacksize(a);theval=a[arraysize-1];delete a[arraysize-1];return theval}
function simpletag(a,b){var c=eval(b+"_open");if(get_easy_mode_state()){inserttext=prompt(prompt_start+"\n["+b+"]xxx[/"+b+"]");inserttext!=null&&inserttext!=""&&doInsert(a,"["+b+"]"+inserttext+"[/"+b+"] ","",false)}else if(c==0){if(doInsert(a,"["+b+"]","[/"+b+"]",true)){eval(b+"_open = 1");eval("document.getElementById(x)."+b+".value += '*'");pushstack(bbtags,b);cstat();hstat("click_close")}}else{for(i=lastindex=0;i<bbtags.length;i++)if(bbtags[i]==b)lastindex=i;for(;bbtags[lastindex];){tagRemove=
popstack(bbtags);doInsert("x,[/"+tagRemove+"]","",false);if(tagRemove!="FONT"&&tagRemove!="SIZE"&&tagRemove!="COLOR"){eval("document.getElementById(x)."+tagRemove+".value = ' "+tagRemove+" '");eval(tagRemove+"_open = 0")}}cstat()}}
function doInsert(a,b,c,d){var f=false;a=document.getElementById(a).t_mes;if(myVersion>=4&&is_ie&&is_win)if(a.isTextEdit){a.focus();var e=document.selection,g=e.createRange();if((e.type=="Text"||e.type=="None")&&g!=null){if(c!="")b+=g.text+c;else if(d)f=true;g.text=b}}else{if(d)f=true;a.value+=b}else{d=a.selectionStart;e=a.selectionEnd;g=a.value.substr(d,e-d);b+=g+c;a.value=a.value.substr(0,d)+b+a.value.substr(e)}a.focus();return f}
function alterfont(a,b,c){if(b!=0){doInsert(a,"["+c+"="+b+"]","[/"+c+"]",true)&&pushstack(bbtags,c);cstat()}}
function ShowHide(a){if(a=="hide_bbcode"){document.getElementById("ffont").style.visibility="hidden";document.getElementById("fsize").style.visibility="hidden";document.getElementById("fcolor").style.visibility="hidden"}else if(document.getElementById(a).style.visibility=="hidden")document.getElementById(a).style.visibility="visible";else document.getElementById(a).style.visibility="hidden"}
function menu_build_menu(a,b,c){for(var d="",f=document.getElementById(a).innerHTML,e=0;c[e]!=null;e++)d+="<tr><td style='padding-bottom:5px;font-family:Verdana;font-size:8pt'><img src='theme/"+theme+"/images/menu_item.gif' border='0'>&nbsp;"+c[e]+"</td></tr>";document.getElementById(a).onclick=function(){ShowHide(""+a+"_menu");return false};document.getElementById(a).innerHTML="<span style='position:relative;padding:0px;'>"+f+"<span id='"+a+"_menu' class='rte-menu-hidden' style='width:"+b+";visibility:hidden;text-decoration:none;'><table border='0' cellspacing='0' cellpadding='0' align='left' style='padding-top:5px;'>"+
d+"</table></span></span>"};
