function quote(c){if(document.selection){document.post.com.focus();sel=document.selection.createRange();sel.text=">>"+c+"\n";}else{if(document.post.com.selectionStart||document.post.com.selectionStart=="0"){var b=document.post.com.selectionStart;var a=document.post.com.selectionEnd;document.post.com.value=document.post.com.value.substring(0,b)+">>"+c+"\n"+document.post.com.value.substring(a,document.post.com.value.length);}else{document.post.com.value+=">>"+c+"\n";}}}function replyhl(b){var a=document.getElementsByTagName("td");for(i=0;i<a.length;i++){if(a[i].className=="replyhl"){a[i].className="reply";}if(a[i].id==b){a[i].className="replyhl";}}}function repquote(a){if(a.match(/q([0-9]+)/)){a=a.replace(/q/,"");if(document.post.com.value==""){quote(a);}}}function reppop(a){day=new Date();id=day.getTime();window.open(a,id,"toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=200");return false;}function init(){arr=location.href.split(/#/);if(arr[1]){if(arr[1].match(/(q)?([0-9]+)/)){rep=arr[1];re=arr[1].replace(/q/,"");replyhl(re);repquote(rep);}}}function setActiveStyleSheet(e){var d,c,b;for(d=0;(c=document.getElementsByTagName("link")[d]);d++){if(c.getAttribute("rel").indexOf("style")!=-1&&c.getAttribute("title")){c.disabled=true;if(c.getAttribute("title")==e){c.disabled=false;}}}}function getActiveStyleSheet(){var c,b;for(c=0;(b=document.getElementsByTagName("link")[c]);c++){if(b.getAttribute("rel").indexOf("style")!=-1&&b.getAttribute("title")&&!b.disabled){return b.getAttribute("title");}}return null;}function getPreferredStyleSheet(){var c,b;for(c=0;(b=document.getElementsByTagName("link")[c]);c++){if(b.getAttribute("rel").indexOf("style")!=-1&&b.getAttribute("rel").indexOf("alt")==-1&&b.getAttribute("title")){return b.getAttribute("title");}}return null;}function createCookie(c,e,f,d){if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));var a="; expires="+b.toGMTString();}else{a="";}if(d){d="; domain="+d;}else{d="";}document.cookie=c+"="+e+a+"; path=/"+d;}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length);}if(f.indexOf(e)==0){return f.substring(e.length,f.length);}}return null;}window.onload=function(b){var a=readCookie(style_group);var c=a?a:getPreferredStyleSheet();setActiveStyleSheet(c);};window.onunload=function(a){var b=getActiveStyleSheet();createCookie(style_group,b,365,".4chan.org");};var cookie=readCookie(style_group);var title=cookie?cookie:getPreferredStyleSheet();setActiveStyleSheet(title);onload=init;
