$(document).ready(function(){
	$('.dot').css({
		opacity: '0'
	})
	
	$('.button').mouseover(function(){
		$('.dot.'+ $(this).attr('class').split(' ')[1]).animate({
			opacity: '0.4'
	    }, 250 );
		$('.agencyInfo h3').next('p:visible').hide('slow');
		$('.agencyInfo h3.' + $(this).attr('class').split(' ')[1]).next('p').show('slow');
	}).mouseout(function(){
		$('.dot.'+ $(this).attr('class').split(' ')[1]).animate({
			opacity: '0'
	    }, 250 );
		$('.agencyInfo h3').next('p:visible').hide('slow');
	});
	
	$('.agencyInfo').click(function(){
		$(this).parent('.box_content').find('p:visible').not($(this).children('p')).hide('slow');
		$(this).children('p:hidden').show('slow');
	})
	
	$('.agencyInfo h3, .agencyInfo p').mouseover(function(){
		$('.dot.'+ $(this).parent('.agencyInfo').children('h3').attr('class')).animate({
			opacity: '0.4'
	    }, 250 )
	})
	
	$('.agencyInfo h3, .agencyInfo p').mouseout(function(){
		$('.dot.'+ $(this).parent('.agencyInfo').children('h3').attr('class')).animate({
			opacity: '0'
		}, 250)
	})
});
