/******

	In Memory of Paul Gordon
		Site JavaScript

*****/

var funeralOpen = false;

$(document).ready(function(){
	/*$('a.more').click(function(){
		var anchor = this;
		$(this).parent().prev('div.more').slideToggle('normal', function(){
			if ($(this).css('display') == 'none') $(anchor).html('Read More &raquo;');
			else $(anchor).html('Read Less &laquo;');
		});
		return false;
	});*/
	
	
	// if the funeral / visitations are open, close them if you click somewhere else on the page
	$('body').click(function(){
		if (funeralOpen == true) $('#nav-funeral').click();
	});
	
	// clicking some links will open and close the funeral / visitation info
	$('a.nav-funeral').click(function(){
		$('#funeral').slideToggle('normal', function(){
			funeralOpen = !funeralOpen;
		});
		return false;
	});
	
	// prevent clicking nav from closing the nav
	//$('#funeral').click(function(){return false;});
	//$('#funeral a').click(function(){return true;});
	
	// initialize arrow
	$('#memory-arrow').data('arrow', true);
	
	// open the memory submit box and adjust the arrow to show whether it is open or not
	$('#respond').click(function(){
		$('#comment-form').slideToggle();
		if ($('#memory-arrow').data('arrow') == true)
			$('#memory-arrow').html('&darr;');
		else
			$('#memory-arrow').html('&rarr;');
			
		$('#memory-arrow').data('arrow', !$('#memory-arrow').data('arrow'));
		
		return false;
	});
	
	$('.dottylink').click(function(){/*$('#dotty').slideToggle();*/tb_remove();return false;});
});