var style_cookie;var style_cookie_txt;var style_cookie_site;var kumod_set=false;var ispage;if(!Array.prototype.indexOf){Array.prototype.indexOf=function(B){var A=this.length;var C=Number(arguments[1])||0;C=(C<0)?Math.ceil(C):Math.floor(C);if(C<0){C+=A}for(;C<A;C++){if(C in this&&this[C]===B){return C}}return -1}}var Utf8={encode:function(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C)}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128)}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128)}}}return A},decode:function(A){var B="";var C=0;var D=c1=c2=0;while(C<A.length){D=A.charCodeAt(C);if(D<128){B+=String.fromCharCode(D);C++}else{if((D>191)&&(D<224)){c2=A.charCodeAt(C+1);B+=String.fromCharCode(((D&31)<<6)|(c2&63));C+=2}else{c2=A.charCodeAt(C+1);c3=A.charCodeAt(C+2);B+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));C+=3}}}return B}};function replaceAll(B,D,C){var A=B.indexOf(D);while(A>-1){B=B.replace(D,C);A=B.indexOf(D)}return B}function insert(D){var B=document.forms.postform.message;if(B){if(B.createTextRange&&B.caretPos){var C=B.caretPos;C.text=C.text.charAt(C.text.length-1)==" "?D+" ":D}else{if(B.setSelectionRange){var E=B.selectionStart;var A=B.selectionEnd;B.value=B.value.substr(0,E)+D+B.value.substr(A);B.setSelectionRange(E+D.length,E+D.length)}else{B.value+=D+" "}}B.focus()}}function quote(b,a){var v=eval("document."+a+".message");v.value+=">>"+b+"\n";v.focus()}function checkhighlight(){var A;if(A=/#i([0-9]+)/.exec(document.location.toString())){if(!document.forms.postform.message.value){insert(">>"+A[1])}}if(A=/#([0-9]+)/.exec(document.location.toString())){highlight(A[1])}}

function highlight(D,F){if(F&&ispage){return }var B=document.getElementsByTagName("td");for(var C=0;C<B.length;C++){if(B[C].className=="reply highlight"){B[C].className="reply"}}var E=document.getElementById("reply"+D);if(E){E.className="reply highlight";var A=/^([^#]*)/.exec(document.location.toString());document.location=A[1]+"#"+D}}

function get_password(A){var E=getCookie(A);if(E){return E}var D="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var E="";for(var C=0;C<8;C++){var B=Math.floor(Math.random()*D.length);E+=D.substring(B,B+1)}set_cookie(A,E,365);return(E)}function togglePassword(){var C=(navigator.userAgent.indexOf("Safari")!=-1);var F=(navigator.userAgent.indexOf("Opera")!=-1);var B=(navigator.appName=="Netscape");var A=document.getElementById("passwordbox");var E;if((C)||(F)||(B)){E=A.innerHTML}else{E=A.text}E=E.toLowerCase();var D="<td></td><td></td>";if(E==D){var D="<td class=\"postblock\">Mod</td><td><input type=\"text\" name=\"modpassword\" size=\"28\" maxlength=\"75\">&nbsp;<acronym title=\"Distplay staff status (Mod/Admin)\">D</acronym>:&nbsp;<input type=\"checkbox\" name=\"displaystaffstatus\" checked>&nbsp;<acronym title=\"Lock\">L</acronym>:&nbsp;<input type=\"checkbox\" name=\"lockonpost\">&nbsp;&nbsp;<acronym title=\"Sticky\">S</acronym>:&nbsp;<input type=\"checkbox\" name=\"stickyonpost\">&nbsp;&nbsp;<acronym title=\"Raw HTML\">RH</acronym>:&nbsp;<input type=\"checkbox\" name=\"rawhtml\">&nbsp;&nbsp;<acronym title=\"Name\">N</acronym>:&nbsp;<input type=\"checkbox\" name=\"usestaffname\"></td>"}if((C)||(F)||(B)){A.innerHTML=D}else{A.text=D}return false}function toggleOptions(D,C,B){if(document.getElementById("opt"+D)){if(document.getElementById("opt"+D).style.display==""){document.getElementById("opt"+D).style.display="none";document.getElementById("opt"+D).innerHTML=""}else{var A="<td class=\"label\"><label for=\"formatting\">Formatting:</label></td><td colspan=\"3\"><select name=\"formatting\"><option value=\"\" onclick=\"javascript:document.getElementById('formattinginfo"+D+"').innerHTML = 'All formatting is performed by the user.';\">Normal</option><option value=\"aa\" onclick=\"javascript:document.getElementById('formattinginfo"+D+"').innerHTML = '[aa] and [/aa] will surround your message.';\"";if(getCookie("kuformatting")=="aa"){A+=" selected"}A+=">Text Art</option></select> <input type=\"checkbox\" name=\"rememberformatting\"><label for=\"rememberformatting\">Remember</label> <span id=\"formattinginfo"+D+"\">";if(getCookie("kuformatting")=="aa"){A+="[aa] and [/aa] will surround your message."}else{A+="All formatting is performed by the user."}A+="</span></td><td><input type=\"button\" value=\"Preview\" class=\"submit\" onclick=\"javascript:postpreview('preview"+D+"', '"+B+"', '"+D+"', document."+C+".message.value);\"></td>";document.getElementById("opt"+D).innerHTML=A;document.getElementById("opt"+D).style.display=""}}}function getCookie(name){with(document.cookie){var regexp=new RegExp("(^|;\\s+)"+name+"=(.*?)(;|$)");var hit=regexp.exec(document.cookie);if(hit&&hit.length>2){return Utf8.decode(unescape(replaceAll(hit[2],"+","%20")))}else{return""}}}function set_cookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{A=""}document.cookie=C+"="+D+A+"; path=/"}function set_stylesheet(H,B,D){if(B){set_cookie("kustyle_txt",H,365)}else{if(D){set_cookie("kustyle_site",H,365)}else{set_cookie("kustyle",H,365)}}var C=document.getElementsByTagName("link");var F=false;for(var E=0;E<C.length;E++){var A=C[E].getAttribute("rel");var G=C[E].getAttribute("title");if(A.indexOf("style")!=-1&&G){C[E].disabled=true;if(H==G){C[E].disabled=false;F=true}}}if(!F){set_preferred_stylesheet()}}function set_preferred_stylesheet(){var B=document.getElementsByTagName("link");for(var C=0;C<B.length;C++){var A=B[C].getAttribute("rel");var D=B[C].getAttribute("title");if(A.indexOf("style")!=-1&&D){B[C].disabled=(A.indexOf("alt")!=-1)}}}function get_active_stylesheet(){var B=document.getElementsByTagName("link");for(var C=0;C<B.length;C++){var A=B[C].getAttribute("rel");var D=B[C].getAttribute("title");if(A.indexOf("style")!=-1&&D&&!B[C].disabled){return D}}return null}function get_preferred_stylesheet(){var B=document.getElementsByTagName("link");for(var C=0;C<B.length;C++){var A=B[C].getAttribute("rel");var D=B[C].getAttribute("title");if(A.indexOf("style")!=-1&&A.indexOf("alt")==-1&&D){return D}}return null}
function delandbanlinks(){if(!kumod_set){return }var B=document.getElementsByTagName("span");var E;var A;for(var C=0;C<B.length;C++){E=B[C];if(E.getAttribute("class")){if(E.getAttribute("class").substr(0,3)=="dnb"){A=E.getAttribute("class").split("|");var D="<span class=\"extrabtns\"><a href=\""+ku_cgipath+"/manage_page.php?action=delposts&boarddir="+A[1]+"&del";if(A[3]=="y"){D+="thread"}else{D+="post"}D+="id="+A[2]+"\" title=\"Delete\" onclick=\"return confirm('Are you sure you want to delete this post/thread?');\"><img src=\"http://plus4chan.org/boards/css/icons/blank.gif\" border=\"0\" class=\"moddelete\"></a>&nbsp;<a href=\""+ku_cgipath+"/manage_page.php?action=delposts&boarddir="+A[1]+"&del";if(A[3]=="y"){D+="thread"}else{D+="post"}D+="id="+A[2]+"&postid="+A[2]+"\" title=\"Delete &amp; Ban\" onclick=\"return confirm('Are you sure you want to delete and ban the poster of this post/thread?');\"><img src=\"http://plus4chan.org/boards/css/icons/blank.gif\" border=\"0\" class=\"modand\"></a>&nbsp;<a href=\""+ku_cgipath+"/manage_page.php?action=bans&banboard="+A[1]+"&banpost="+A[2]+"\" title=\"Ban\"><img src=\"http://plus4chan.org/boards/css/icons/blank.gif\" border=\"0\" class=\"modban\"></a></span>";B[C].innerHTML=D}}}}


function togglethread(A){if(hiddenthreads.toString().indexOf(A)!==-1){document.getElementById("unhidethread"+A).style.display="none";document.getElementById("thread"+A).style.display="block";hiddenthreads.splice(hiddenthreads.indexOf(A),1);set_cookie("hiddenthreads",hiddenthreads.join("!"),30)}else{document.getElementById("unhidethread"+A).style.display="block";document.getElementById("thread"+A).style.display="none";hiddenthreads.push(A);set_cookie("hiddenthreads",hiddenthreads.join("!"),30)}return false}function toggleblotter(C){var B=document.getElementsByTagName("li");var A=new Array();var D;for(i=0,iarr=0;i<B.length;i++){att=B[i].getAttribute("class");if(att=="blotterentry"){D=B[i];if(D.style.display=="none"){D.style.display="";if(C){set_cookie("ku_showblotter","1",365)}}else{D.style.display="none";if(C){set_cookie("ku_showblotter","0",365)}}}}}


/*function expandthread(C,A){if(document.getElementById("replies"+C+A)){var B=document.getElementById("replies"+C+A);B.innerHTML="Expanding thread...<br><br>"+B.innerHTML;new Ajax.Request(ku_boardspath+"/expand.php?board="+A+"&threadid="+C,{method:"get",onSuccess:function(E){var D=E.responseText||"something went wrong (blank response)";B.innerHTML=D;delandbanlinks()},onFailure:function(){alert("Something went wrong...")}})}return false}
*/

function expandthread(C,A){
if(document.getElementById("replies"+C+A)){
	var B=document.getElementById("replies"+C+A);
	B.innerHTML="<span class=\"omittedposts\"/>Expanding thread...</span><br><br>"+B.innerHTML;
	jQuery.ajax({type:"get", url: [ku_boardspath+"/expand.php?board="+A+"&threadid="+C], 
	success: function(E){
			var D=E||"something went wrong (blank response)";
			B.innerHTML=D;delandbanlinks();
	},
	error: function(){
		alert("Something went wrong...");
	}
	})
	}
return false}



function quickreply(A){if(A==0){document.getElementById("posttypeindicator").innerHTML="new thread"}else{document.getElementById("posttypeindicator").innerHTML="reply to "+A+" [<a href=\"#postbox\" onclick=\"javascript:quickreply('0');\" title=\"Cancel\">x</a>]"}document.postform.replythread.value=A}function getwatchedthreads(C,B){if(document.getElementById("watchedthreadlist")){var A=document.getElementById("watchedthreadlist");A.innerHTML="Loading watched threads...";new Ajax.Request(ku_boardspath+"/threadwatch.php?board="+B+"&threadid="+C,{method:"get",onSuccess:function(E){var D=E.responseText||"something went wrong (blank response)";A.innerHTML=D},onFailure:function(){alert("Something went wrong...")}})}}function addtowatchedthreads(B,A){if(document.getElementById("watchedthreadlist")){new Ajax.Request(ku_boardspath+"/threadwatch.php?do=addthread&board="+A+"&threadid="+B,{method:"get",onSuccess:function(D){var C=D.responseText||"something went wrong (blank response)";alert("Thread successfully added to your watch list.");getwatchedthreads("0",A)},onFailure:function(){alert("Something went wrong...")}})}}function removefromwatchedthreads(B,A){if(document.getElementById("watchedthreadlist")){new Ajax.Request(ku_boardspath+"/threadwatch.php?do=removethread&board="+A+"&threadid="+B,{method:"get",onSuccess:function(D){var C=D.responseText||"something went wrong (blank response)";getwatchedthreads("0",A)},onFailure:function(){alert("Something went wrong...")}})}}function hidewatchedthreads(){set_cookie("showwatchedthreads","0",30);if(document.getElementById("watchedthreads")){document.getElementById("watchedthreads").innerHTML="The Watched Threads box will be hidden the next time a page is loaded.  [<a href=\"#\" onclick=\"javascript:showwatchedthreads();return false\">undo</a>]"}}function showwatchedthreads(){set_cookie("showwatchedthreads","1",30);window.location.reload(true)}function checkcaptcha(A){if(document.getElementById(A)){if(document.getElementById(A).captcha){if(document.getElementById(A).captcha.value==""){alert("Please enter the captcha image text.");document.getElementById(A).captcha.focus();return false}}}return true}


function guideme(type){
var gbox = document.getElementById("guidebox");
if(type == "close"){gbox.innerHTML = '';}
else if(type == "name"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>Name Field</b><br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Tripcodes</b><br><br>Tripcodes can help verify a user\'s identity to others, and are a type of pseudo-registration. To use a normal tripcode, place an octothorpe ("#") followed by a word or short phrase after what you\'ve entered into the [Name] field (ex. "User#password"). Upon submission, the server will generate the hash unique to that particular word or phrase. The previous example would display "User !ozOtJW9BFA" after being posted. (And will display that same tripcode no matter what site you\'re on).<br><br>Important note: A tripcode is generated only using the text entered after the octothorpe. Your entered name, IP address, cookie information, etc. do not affect the output. Normal tripcodes are *not* secure; they can be cracked with relative ease.<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Secure Tripcodes</b><br><br>A secure tripcode can be generated by placing two octothorpes in the [Name] field, as opposed to one as with a normal tripcode (ex. "User##password"). Secure tripcodes use a secret key file on the server to help obscure their password. Because of this, <b>Secure Tripcodes give different results on every site.</b> The previous example would display "User !!t4BTH4MQH1" after being posted on plus4chan, but "User !!Oo43raDvH61" on 4chan.<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Double Ultra Super Faggy Tripcodes</b><br><br>Normal tripcode: "User#password",  becomes "User!ozOtJW9BFA"<br>Secure tripcode: "User##securepass",  becomes "User!!OxAwtjAwtm"<br>DUSF tripcode: "User#password#securepass",  becomes "User!ozOtJW9BFA!!OxAwtjAwtm"</td></tr></table>';
}
else if(type == "email"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>Email Field</b><br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Sage</b><br><br>Normally when posting, you cause the thread you\'re in to \'bump\' to the top of the front page of that board. By typing <b>sage</b> in the email field, your post does not bump. This is used when you either thing the thread is of no value, or when you feel your post adds nothing to the conversation.<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Noko</b><br><br>While the "noko" checkbox is checked, once you have posted, you will be redirected to the thread you posted in, rather than the front page of that board.<br> Typing "noko" in the email field has the same effect.</td></tr></table>';
}
else if(type == "subject"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>Subject Field</b><br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>NSFW</b><br><br>(only applies to image uploads) When this box is checked, instead of generating a thumbnail image to display in the thread, it uses an image with the text "NSFW", indicating that the attached image is \'not safe for work\'.<br><br>This checkbox doesn\'t show up on NSFW boards for obvious reasons.<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Spoiler</b><br><br>(only applies to image uploads) When this box is checked, instead of generating a thumbnail image to display in the thread, it uses an image with the word "SPOILER", indicating that the attached image is spoils some plot point. Alternatively used when the user wants the image to be a surpise.</td></tr></table>';
}
else if(type == "message"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>Message Field</b><br><br>The content of your post. You are limited to 16,384 characters. <br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Tags</b><br><br>Our board supports the following tags:<br><br> [b]Bold[/b] ---> <b>Bold</b><br> [i]Italic[/i] ---> <i>Italic</i><br> [u]Underline[/u] ---> <u>Underline</u><br> [s]Strikeout[/s] ---> <strike>Strikeout</strike><br> [spoiler]Spoiler[/spoiler] ---> <span class="spoiler" onmouseover="this.style.color=\'white\';" onmouseout="this.style.color=\'black\'">Spoiler</span><br> [aa]AsciiArt[/aa] ---> <div style="font-family: Mona,\'MS PGothic\' !important;">AsciiArt</div></td></tr></table>';
}
else if(type == "file"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>File Field</b><br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Upload Limitations</b><br><ul><li><b>Max File Size:</b> 7 MB (7,168 KB) </li><li><b>File Types:</b> JPG, GIF, PNG</li><li><b>Flash (SWF) files</b> can be posted on /baw/, /durp/, and /pco/</li></ul><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>NSFW</b> <br><br>(only applies to image uploads) When the checkbox labeled "NSFW" (next to the submit button on the subject line) is checked, instead of generating a thumbnail image to display in the thread, it uses an image with the text "NSFW", indicating that the attached image is \'not safe for work\'.<br><br>This checkbox doesn\'t show up on NSFW boards for obvious reasons.<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Spoiler</b><br><br>(only applies to image uploads) When the checkbox labeled "Spoiler" (next to the submit button on the subject line) is checked, instead of generating a thumbnail image to display in the thread, it uses an image with the word "SPOILER", indicating that the attached image is spoils some plot point. Alternatively used when the user wants the image to be a surpise.</td></tr></table>';
}
else if(type == "embed"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>Embed Field</b><br><br>Embed IDs allow you to post embedded videos that can be played on the page. Each site has a different text string you must copy for the video to display correctly. <br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Youtube</b><br><br>For this url: <br><u>http://www.youtube.com/watch?v=<b>Ex29l7Sj62Y</b></u> -or- <u>http://www.youtube.com/watch?v=<b>Ex29l7Sj62Y</b>&amp;feature=related</u><br>The text string you must copy is: <br><u><b>Ex29l7Sj62Y</b></u><br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Google Video</b><br><br>For this url:<br><u>http://video.google.com/videoplay?docid=<b>4288272213353199531</b></u><br>The text string you must copy is: <br><u><b>4288272213353199531</b></u><br><br>NOTE: If there\'s a minus sign after the \'docid=\', you must copy that as well. (example: "<u>-4288272213353199531</u>")<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>LiveLeak</b><br><br>For this url:<br><u>http://www.liveleak.com/view?i=<b>01a_1212187414</b></u><br>The text string you must copy is: <br><u><b>01a_1212187414</b></u></td></tr></table>';
}
else if(type == "password"){gbox.innerHTML = '<table width="100%" border="0" cellspacing="0" cellpadding="20" class="reply"><tr><td width="16" valign="top" ><a href="javascript:;" onclick="guideme(\'close\');"><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="closex"></a></td><td><b>Password Field</b><br><br>The password in the box is randomly generated the first time you visit this site, and stays the same until you delete your cookies or manually change it.<br><br><img src="http://plus4chan.org/boards/css/icons/blank.gif" border="0" class="questionmark"> <b>Deleting Posts</b><br><br>1. Find the post (of yours) that you want to delete, and check the checkbox next to your name.<br>2. Scroll down to the bottom-right of the page.<br>3. Press \'Delete\'.<br><br>Assuming you haven\'t messed with the password, and are on the same computer you made the post from, this should work fine.</td></tr></table>';
}
}

function expandimg(post_id, img_url, thumb_url, img_w, img_h, thumb_w, thumb_h)
{
var img_cont = document.getElementById("thumb" + post_id);
var img;

for(var i = 0; i < img_cont.childNodes.length; i++)
if(img_cont.childNodes[i].nodeName == "IMG")
img = img_cont.childNodes[i];

if(img)
{
var new_img = document.createElement("img");
new_img.setAttribute("class", "thumb");
new_img.setAttribute("className", "thumb");
new_img.setAttribute("alt", "" + post_id);

if( (img.getAttribute("width") == ("" + thumb_w)) && (img.getAttribute("height") == ("" + thumb_h)) )
{ // thumbnail -> fullsize
new_img.setAttribute("src", "" + img_url);
new_img.setAttribute("width", "" + img_w);
new_img.setAttribute("height", "" + img_h);
}
else
{ // fullsize -> thumbnail
new_img.setAttribute("src", "" + thumb_url);
new_img.setAttribute("width", "" + thumb_w);
new_img.setAttribute("height", "" + thumb_h);
}

while(img_cont.lastChild)
img_cont.removeChild(img_cont.lastChild);

img_cont.appendChild(new_img);
}
} 
function postpreview(D,A,C,B){if(document.getElementById(D)){	jQuery.ajax({type:"GET",success:function(F){var E=F.responseText||"something went wrong (blank response)";document.getElementById(D).innerHTML=E},error:function(){alert("Something went wrong...")}})}}
/*
function postpreview(D,A,C,B){if(document.getElementById(D)){
new Ajax.Request(ku_boardspath+"/expand.php?preview&board="+A+"&parentid="+C+"&message="+escape(B),
{method:"get",
onSuccess:function(F){var E=F.responseText||"something went wrong (blank response)";document.getElementById(D).innerHTML=E},onFailure:function(){alert("Something went wrong...")}})}}

function postpreview(D,A,C,B){if(document.getElementById(D)){
new Ajax.Request(ku_boardspath+"/expand.php?preview&board="+A+"&parentid="+C+"&message="+escape(B),
{method:"get",
onSuccess:function(F){var E=F.responseText||"something went wrong (blank response)";document.getElementById(D).innerHTML=E},onFailure:function(){alert("Something went wrong...")}})}}
*/
function set_inputs(id){
if(document.getElementById(id)){
with(document.getElementById(id)){
if(!name.value){name.value=getCookie("name")}
if(!em.value){em.value=getCookie("email")}
if(!postpassword.value){postpassword.value=get_password("postpassword");}
if(getCookie("noko")=="true"){noko.checked="true"}
}}}


function set_delpass(id){
if(document.getElementById(id).postpassword){
with(document.getElementById(id)){
if(!postpassword.value){
postpassword.value=get_password("postpassword")
}}}
}

function keypress(F){if(F.altKey){var C=document.location.toString();if((C.indexOf("catalog.html")==-1&&C.indexOf("/res/")==-1)||(C.indexOf("catalog.html")==-1&&F.keyCode==80)){if(F.keyCode!=18&&F.keyCode!=16){if(C.indexOf(".html")==-1||C.indexOf("board.html")!=-1){var D=0;var G=C.substr(0,C.lastIndexOf("/")+1)}else{var D=C.substr((C.lastIndexOf("/")+1));D=(+D.substr(0,D.indexOf(".html")));var G=C.substr(0,C.lastIndexOf("/")+1)}if(D==0){var B=G}else{var B=G+D+".html"}if(F.keyCode==222||F.keyCode==221){if(match=/#s([0-9])/.exec(C)){var A=(+match[1])}else{var A=-1}if(F.keyCode==222){if(A==-1||A==9){var E=0}else{var E=A+1}}else{if(F.keyCode==221){if(A==-1||A==0){var E=9}else{var E=A-1}}}document.location.href=B+"#s"+E}else{if(F.keyCode==59||F.keyCode==219){if(F.keyCode==59){D=D+1}else{if(F.keyCode==219){if(D>=1){D=D-1}}}if(D==0){document.location.href=G}else{document.location.href=G+D+".html"}}else{if(F.keyCode==80){document.location.href=B+"#postbox"}}}}}}}window.onunload=function(A){if(style_cookie){var B=get_active_stylesheet();set_cookie(style_cookie,B,365)}if(style_cookie_txt){var B=get_active_stylesheet();set_cookie(style_cookie_txt,B,365)}if(style_cookie_site){}};window.onload=function(D){delandbanlinks();checkhighlight();if(document.getElementById("watchedthreads")){var C=new Draggable("watchedthreads",{handle:"watchedthreadsdraghandle",onEnd:function(){E()}});var A=new Resizeable("watchedthreads",{resize:function(){B()}});function E(){set_cookie("watchedthreadstop",document.getElementById("watchedthreads").style.top,30);set_cookie("watchedthreadsleft",document.getElementById("watchedthreads").style.left,30)}function B(){var F=document.getElementById("watchedthreads").offsetWidth;var G=document.getElementById("watchedthreads").offsetHeight;set_cookie("watchedthreadswidth",F,30);set_cookie("watchedthreadsheight",G,30)}}document.onkeydown=keypress};if(style_cookie){var cookie=getCookie(style_cookie);var title=cookie?cookie:get_preferred_stylesheet();set_stylesheet(title)}if(style_cookie_txt){var cookie=getCookie(style_cookie_txt);var title=cookie?cookie:get_preferred_stylesheet();set_stylesheet(title,true)}if(style_cookie_site){var cookie=getCookie(style_cookie_site);var title=cookie?cookie:get_preferred_stylesheet();set_stylesheet(title,false,true)}if(getCookie("kumod")=="yes"){kumod_set=true}