window.addEvent('domready', function() {
	$$('pre').each(function(elm){
		myHTMLRequest = new Request.HTML({url:'hilite', onSuccess:function(t,e,html){ 
			new Element('span',{styles:{'font-family':'monospace','font-size':'11px'}}).set('html', html).replaces(elm);
		} }).post({src:elm.get('html')});
	});
});

function setScroll() { Cookie.write('scrolled_y', window.getScrollTop()); }

function restoreScroll() {
	//scroll restoration
	var scrolled_y = Cookie.read('scrolled_y');
	if ( scrolled_y > 0 ) { window.scrollTo(0,scrolled_y); Cookie.dispose('scrolled_y'); }	
}