//
// stopcensorship.js
//
// Author: Doug Martin (@dougmartin or http://dougmart.in/)
//
// Usage: Add to head or body of any page to automatically censor the content to protest censorship of the Internet
//
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php

(function(){function m(){document.cookie="__REMOVE_STOP_CENSORSHIP__=1;path=/";window.location.reload();return!1}function n(){function a(c,g,d){function h(a){if(a)for(i in a)if(a.hasOwnProperty(i))try{j.style[i]=a[i]}catch(c){}}var i,j;j=document.createElement(c);j.innerHTML=g;h(b);h(d);return j}var b,c,g;b={background:"#000 none repeat scroll 0% 0%",borderCollapse:"separate",borderSpacing:"0",border:"medium none #000",bottom:"auto",captionSide:"top",clear:"none",clip:"auto",color:"#fff",cursor:"auto",
direction:"ltr",display:"inline",emptyCells:"show","float":"none",fontStyle:"normal",fontVariant:"normal",fontWeight:"bold",fontSize:"12px",fontFamily:"verdana,helvetica,arial,sans-serif",height:"auto",left:"auto",letterSpacing:"normal",lineHeight:"normal",listStyle:"disc outside none",margin:"0",maxHeight:"none",maxWidth:"none",minHeight:"0",minWidth:"0",orphans:"2",outline:"invert none medium",overflow:"visible",padding:"0",pageBreakAfter:"auto",pageBreakBefore:"auto",pageBreakInside:"auto",position:"static",
right:"auto",tableLayout:"auto",textAlign:"left",textDecoration:"none",textIndent:"0",textTransform:"none",top:"auto",unicodeBidi:"normal",verticalAlign:"baseline",visibility:"visible",whiteSpace:"normal",widows:"2",width:"auto",wordSpacing:"normal",zIndex:"auto"};d=a("div","",{position:"absolute",top:"0",left:"0",textAlign:"center",margin:"0",padding:"5px 0",width:"100%",borderTop:"2px solid #fff",borderBottom:"2px solid #fff",zIndex:2147483647});c=a("a","STOP CENSORSHIP",{textDecoration:"underline"});
c.href="http://americancensorship.org/";g=a("a","Remove this",{textDecoration:"underline"});g.href="#";g.onclick=m;d.appendChild(c);d.appendChild(a("span","|",{padding:"0 10px"}));d.appendChild(g);document.body.appendChild(d)}function l(){function d(a){var b,f,h;b=a.nodeValue.split(/\s/);for(f=0,h=b.length;f<h;f++)0.5>Math.random()&&(b[f]=c.slice(0,b[f].length).join(""));a.nodeValue=b.join(" ")}var b,c;b=String.fromCharCode(9608);for(c=[];1024>c.length;)c.push(b);if(document.createTreeWalker)for(e=
document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,!1);e.nextNode();)d(e.currentNode);else{k=document.body;for(a=k.childNodes[0];null!=a;)if(3==a.nodeType&&d(a),a.hasChildNodes())a=a.firstChild;else{for(;null==a.nextSibling&&a!=k;)a=a.parentNode;a=a.nextSibling}}n()}function o(a){function b(){if(!e){if(!document.body)return setTimeout(b,1);e=!0;a()}}function c(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",c,!1),b()):document.attachEvent&&"complete"===
document.readyState&&(document.detachEvent("onreadystatechange",c),b())}function d(){if(!e){try{document.documentElement.doScroll("left")}catch(a){setTimeout(d,1);return}b()}}var e=!1;if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",b,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",c);window.attachEvent("onload",b);try{null===window.frameElement&&document.documentElement.doScroll&&d()}catch(f){}}}var e,a,k,d;
/__REMOVE_STOP_CENSORSHIP__=1/.test(document.cookie)||(document.body?l():o(l))})();
