var style_cookie; var style_cookie_txt; var style_cookie_site; var kumod_set = false; var quick_reply = false; var ispage; /* IE/Opera fix, because they need to go learn a book on how to use indexOf with arrays */ if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(elt /*, from*/) { var len = this.length; var from = Number(arguments[1]) || 0; from = (from < 0) ? Math.ceil(from) : Math.floor(from); if (from < 0) from += len; for (; from < len; from++) { if (from in this && this[from] === elt) return from; } return -1; }; } /** * * UTF-8 data encode / decode * http://www.webtoolkit.info/ * **/ var Utf8 = { // public method for url encoding encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // public method for url decoding decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } var gt = new Gettext({ 'domain' : 'kusaba' }); function _ (msgid) { return gt.gettext(msgid); } function toggle(button, area) { var tog=document.getElementById(area); if(tog.style.display) { tog.style.display=""; } else { tog.style.display="none"; } button.innerHTML=(tog.style.display)?'+':'−'; set_cookie('nav_show_'+area, tog.style.display?'0':'1', 30); } function removeframes() { var boardlinks = document.getElementsByTagName("a"); for(var i=0;i -1 ) { str = str.replace( from, to ); idx = str.indexOf( from ); } return str; } function insert(text) { if(!ispage || quick_reply) { var textarea=document.forms.postform.message; if(textarea) { if(textarea.createTextRange && textarea.caretPos) { // IE var caretPos=textarea.caretPos; caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==" "?text+" ":text; } else if(textarea.setSelectionRange) { // Firefox var start=textarea.selectionStart; var end=textarea.selectionEnd; textarea.value=textarea.value.substr(0,start)+text+textarea.value.substr(end); textarea.setSelectionRange(start+text.length,start+text.length); } else { textarea.value+=text+" "; } textarea.focus(); return false; } } return true; } function quote(b, a) { var v = eval("document." + a + ".message"); v.value += (">>" + b + "\r"); v.focus(); } function checkhighlight() { var match; if(match=/#i([0-9]+)/.exec(document.location.toString())) if(!document.forms.postform.message.value) insert(">>" + match[1] + "\n"); if(match=/#([0-9]+)/.exec(document.location.toString())) highlight(match[1]); } function highlight(post, checknopage) { if ((checknopage && ispage) || ispage) { // Uncomment the following line to always send the user to the thread if the link was clicked on the board page. //return; } var cells = document.getElementsByTagName("td"); for(var i=0;iNormal