$(document).ready(function(){

// =========================================== FADE IN FADE OUT GALLERY THUMBNAILS ====================================================

	   $(".latest_img").fadeTo("slow", 0.5); // This sets the opacity of the thumbs to fade down to 50% when the page loads
	   $(".latest_img").hover(function(){
	   $(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover
	   },function(){
	   $(this).fadeTo("slow", 0.5); // This should set the opacity back to 30% on mouseout
	   });
						   

// ====================================== SHOW HIDE DIVS FOR MEMORIAL SERVICE AUDIO ====================================================

		// choose text for the show/hide link - can contain HTML (e.g. an image)
		var showText='Memorial Service';
		var hideText='Hide Memorial Service audio player';
		
		// append show/hide links to the element directly preceding the element with a class of "toggle"
		$('#toggle').prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');
		
		// hide all of the elements with a class of 'toggle'
		$('#toggle').hide();
		
		// capture clicks on the toggle links
		$('a.toggleLink').click(function() {
		
		// change the link depending on whether the element is shown or hidden
		$(this).html ($(this).html()==hideText ? showText : hideText);
		
		// toggle the display - uncomment the next line for a basic "accordion" style
		//$('.toggle').hide();$('a.toggleLink').html(showText);
		$(this).parent().next('#toggle').toggle('slow');
		
		// return false so any link destination is not followed
		return false;
		
		});


// ====================================== SHOW HIDE DIVS FOR COME WHAT MAY AUDIO ====================================================

		// choose text for the show/hide link - can contain HTML (e.g. an image)
		var showText2='Our Song';
		var hideText2='Hide audio player';
		
		$('#toggle2').prev().append(' <a href="#" class="toggleLink2">'+showText2+'</a>');
		$('#toggle2').hide();
		$('a.toggleLink2').click(function() {
		$(this).html ($(this).html()==hideText2 ? showText2 : hideText2);
		$(this).parent().next('#toggle2').toggle('slow');
		return false;
		});

// =================================== SHOW MORE TEXT FOR TRIBUTE GALLERY DESCRIPTION ==========================================
	  $('div.expandable').expander({
		slicePoint:       400,  // default is 100
		expandEffect:     'fadeIn',
		expandText:       '<img src="../images/but_more.jpg" />',
		expandPrefix:     ' ',
		expandSpeed:	  '25000',
		widow: 10,
		userCollapseText: '<img src="../images/but_less.jpg" />'  // default is '[collapse expanded text]'
	  });

// ========================================= SHOW HIDE CONTENT FOR EACH TRIBUTE ================================================
	 $('div.tribDetails').toggleElements( { 
		fxAnimation:'show', 
		fxSpeed:'slow', 
		className:'toggler' 
	} );
		
// ======================================================== END DOM CALLS ======================================================
						   
						   
						   });
