Event.observe(window,'load',function() {
	$$('pre.geshifilter').each(function(el) {
		var div = el.parentNode.insertBefore(document.createElement('div'),el);
		    div.addClassName('geshiBox');
		    div.appendChild(document.createTextNode('^copy box^'));
		    div.appendChild(document.createElement('br'));
		    div.onclick = function() {
			this.onclick = function() {};

			this.removeChild(this.childNodes[0]);
			this.removeChild(this.childNodes[0]);

			var txt = this.childNodes[0];
			    txt.show();

			var code = txt.parentNode.nextSibling.innerHTML.replace(/<\/li>/g,'|---|').replace(/<\/?.+?>/g,'').replace(/\|---\|/g,'\n').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&nbsp;/g,' ').replace(/&amp;/g,'&');

			    txt.value = code;
			    txt.onfocus = function() {
				this.select();
			    };
			    txt.focus();
		    };
		
		var txt = div.appendChild(document.createElement('textarea'));
		    txt.hide();
	});
});
