// JavaScript Document

$(function(){
	
	// Remove the title attributes wordpress puts into the main nav so it doesn't screw up my hover effects
	$('#nav a').removeAttr('title');

	
	// Cool focus effect. Probably the only legitimate use of javascript here.	
	 
	if (!$('body').hasClass('page-id-36')) {
		$('#nav>li>a').after('<div></div>');	
		$('#nav>li').hover(function(){
					
					//$(this).children('div').css('z-index', -900);
					$(this).siblings('li').children('a').stop().animate({opacity : 0});
									
			}, function(){
					
					//$(this).children('div').css('z-index', 900);
					$(this).siblings('li').children('a').stop().animate({opacity: 1});
					
			});		
	}
	if ($('body').hasClass('page-id-21') || $('body').hasClass('page-id-122')) {
		
		
		$('.audioClip').next().hide();
		$('.audioClip').click(function(){
			
			var divContent = $(this).next().html();
			console.log(divContent);
			if ($(this).next().html() != '<br><a class="close">Close</a>')
			{$(this).next().slideDown();}
		
		});
		$('.close').click(function(){
		
			$(this).parent().slideUp();
		
		});
	
	}
	
});