$(document).ready(function(){
	
	//preload the background image for the entry open state
	$.preloadImages('/images/bkg_entryOpen.jpg');
	
	//hide all of the recipe divs
	$('.recipe').hide();
	
	//fixes height issue that screws up the animation
	$(".recipe").each(function(){
    
		$(this).css("height", $(this).height() + "px");
    
	});
	
	//open function
	$('.reveal').click(function(){
		
		//opens div
		$(this).parent().parent().next().show('fast'),
		
		//changes background image
	 	$(this).parent().parent().parent().css({backgroundImage: 'url(/images/bkg_entryOpen.jpg)'});
		
		return false ;
		   
   });
	
	//close function
	$('.close').click(function(){
		
		//closes div and changes background image back
		$(this).parent().hide('fast', function(){
			
			$(this).parent().css( {backgroundImage: 'url(/images/bkg_entry.jpg)'});
			
			return false ;	
		});
   
   });
	
 
 //printing the targeted recipes
 $(function(){
 
	// setting up the print button
	$( "a.print" )
		.attr( "href", "javascript:void( 0 )" )
		.click(function(){
			
			// printing the entry div
			$( this ).parent().parent().printArea();
	 
			return( false );
		});
 
	});  

});

function reloadPartialPage()
{
	
	sIFR.activate(mrsEaves, mrsEavesItalic);
	
	sIFR.replace(mrsEaves, {
  selector: 'h2', 
  css: '.sIFR-root { color: #4F2800; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEaves, {
  selector: '#appTitle p', 
  css: '.sIFR-root { color: #4F2800;text-align:center; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEaves, {
  selector: '#drinkTitle p', 
  css: '.sIFR-root { color: #4F2800;text-align:center; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEaves, {
  selector: '#ingredientsTitle p', 
  css: '.sIFR-root { color: #4F2800; text-align:left; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEaves, {
  selector: 'h3', 
  css: '.sIFR-root { color: #4F2800; text-align: center; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEaves, {
  selector: 'h4', 
  css: '.sIFR-root { color: #4F2800; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEavesItalic, {
  selector: 'blockquote', 
  css: '.sIFR-root { color: #4F2800; }'
  ,wmode: 'transparent'
});

sIFR.replace(mrsEavesItalic, {
  selector: '#enterAge h5', 
  css: '.sIFR-root { color: #C8A751; text-align: center; }'
  ,wmode: 'transparent'
});

	
	
	
	
	//preload the background image for the entry open state
	$.preloadImages('/images/bkg_entryOpen.jpg');
	
	//hide all of the recipe divs
	$('.recipe').hide();
	
	//fixes height issue that screws up the animation
	$(".recipe").each(function(){
    
		$(this).css("height", $(this).height() + "px");
    
	});
	
	//open function
	$('.reveal').click(function(){
		
		//opens div
		$(this).parent().parent().next().show('fast'),
		
		//changes background image
	 	$(this).parent().parent().parent().css({backgroundImage: 'url(/images/bkg_entryOpen.jpg)'});
		
		return false ;
		   
   });
	
	//close function
	$('.close').click(function(){
		
		//closes div and changes background image back
		$(this).parent().hide('fast', function(){
			
			$(this).parent().css( {backgroundImage: 'url(/images/bkg_entry.jpg)'});
			
			return false ;	
		});
   
   });
	
 
 //printing the targeted recipes
 $(function(){
 
	// setting up the print button
	$( "a.print" )
		.attr( "href", "javascript:void( 0 )" )
		.click(function(){
			
			// printing the entry div
			$( this ).parent().parent().printArea();
	 
			return( false );
		});
 
	});  
}
 
 
 
 
 
