Event.observe(document, 'dom:loaded', function() {
	$$('ul#nav li').each(function(li) {
		if (li.down('ul')) {
			li.onmouseover = function() { $(this).addClassName('selected'); }
			li.onmouseout = function() { $(this).removeClassName('selected'); }
		}
	});
});
Event.observe(document, 'click', function(event) {
	var element = Event.element(event);
	if ($('category-nav') && !$(element).up('#category-nav')) $('category-nav').down('ul').hide();
});
function get_window_height() {
	// retrieve the height of the document including scrollable area
	var document_height, window_height;
	
	if (window.innerHeight && window.scrollMaxY) document_height = window.innerHeight + window.scrollMaxY;
	else if (document.body.scrollHeight > document.body.offsetHeight) document_height = document.body.scrollHeight;
	else document_height = document.body.offsetHeight;
	
	if (self.innerHeight) window_height = self.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight) window_height = document.documentElement.clientHeight;
	else if (document.body) window_height = document.body.clientHeight;
	
	return (document_height < window_height) ? window_height : document_height;
}
