$(document).ready(function(){

	/* cufon - font replacer */

	Cufon.replace('#logo', { color: '-linear-gradient(#fff, #e5e5e5)', hover: false });
	Cufon.replace('#body-top h2', { color: '-linear-gradient(#fff, #e5e5e5)', textShadow: '#333 1px 1px' });
	Cufon.replace('#body-top h3', { textShadow: '#333 1px 1px' });
	Cufon.replace('#body-content h4', { textShadow: '0px 1px #fff' });
	Cufon.replace('#body-content h5');
	Cufon.replace('#footer h3');
	Cufon.replace('p.cufon');
	Cufon.replace('ul#project-nav a', { hover: true });
	Cufon.replace('dl.expander dt');
	Cufon.now();

	/* projects - profile selector */

	$('ul#project-nav a').attr('href','javascript:void()').click(function()
	{
		active = $(this).text();

		$('div#body-content div.post').each(function()
		{
			if( $(this).attr('title') == active ) $(this).slideDown('slow'); else $(this).slideUp('slow');
		});
	});

	/* fancybox */

	$('.fancybox').fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'titlePosition'	:	'over',
		'overlayShow'	:	true
	});

	/* -----------------------
		expander box script
	----------------------- */

	$('dl.expander dt').click(function()
	{
		$('~ dd', this).slideToggle('slow');

		if( $(this).parent().hasClass('expand') )
		{
			$(this).parent().removeClass('expand').addClass('collapse');
		}
		else
		{
			$(this).parent().removeClass('collapse').addClass('expand');
		}
	});

	$('dl.expander dd').hide();

	/* --------------------------
		facebook sliding panel
	-------------------------- */

	$('#facebookPanel').hover(function()
	{
		$('#facebookPanel').stop(true, false).animate({left:'0'},'medium');
	},function()
	{
		$('#facebookPanel').stop(true, false).animate({left:'-210'},'medium');
	},500);

});
