$(document).ready(function() {
   
	$('div.sidebar > ul > li > ul > li > a').bind('click', function()
	{
		$('div.sidebar li.current_page_item').removeClass('current_page_item');
		
		$(this).parent('li').addClass('current_page_item');
		$(this).parent('li').removeClass('highlighted_page_item');
	});
	
	$('div.sidebar > ul > li > ul > li > a').bind('mouseover', function()
	{		
		if ($(this).parent('li').hasClass('current_page_item') == false)
		{
			$(this).parent('li').addClass('highlighted_page_item');
		}
	});
	
	$('div.sidebar > ul > li > ul > li > a').bind('mouseout', function()
	{		
		$(this).parent('li').removeClass('highlighted_page_item');
	});
	
	$('div.sidebar > ul > li > ul > li > ul > li > a').bind('click', function()
	{		
		alert(this.get('text'));
		return false;
	});
	
	$('#gallery a').lightBox();
	
	$('div.entry').hide();

	if (FlashDetect.installed == false){
	showText();
	}	
	
});


//window.addEvent('domready', function()
//{	
//	// when a page link is clicked, we want to highlight it immediately
//	// instead of waiting for it to be highlighted after the page refreshes
//	// and assigns the <li> the current_page_item class
//	
//	$$('div.sidebar > ul > li > ul > li > a').addEvent('click', function()
//	{	
//		$$('div.sidebar li.current_page_item').removeClass('current_page_item');
//
//		this.getParent('li').addClass('current_page_item');
//	});
//	
//	// when a sub-page is clicked, we want to prevent the default behavior
//	// and instead program a smooth scroll to an anchor which has the same 
//	// title as the page clicked.
//	
//	$$('div.sidebar > ul > li > ul > li > ul > li > a').addEvent('click', function()
//	{		
//		alert(this.get('text'));
//		return false;
//	});
//	
//});

function showText()
{
	$('div.entry').fadeIn('slow');
//	$('div.entry').show('slide', {direction: 'vertical'}, 2000);
}

