// ------------------------------------------
// Rutting Reds Venison
// snippets.js
//
// jQuery Document
// Contains misc events and functions for
// x-browser bugs and general enhancements.
//
// Copyright (c) Brave Creative
// bravecreative.co.uk
// ------------------------------------------

$(function() {
  
  // Cycle Plugin - Homepage Fade
  	$('#carousel').cycle({delay: 2000, speed: 1500 });
  	
  // IE psuedo :last-child Fixes
  	$('#content p:last, #right section:last-child').css('margin', 0); 
  	$('#right section:last-child, #sitemap ul li:last-child').css('background', 'transparent');
  	
  // Freinds ODD and EVEN for alternating red+blue speech bubbles
  	$('#friends li:nth-child(even)').addClass('friend-red');
  	$('#friends li:nth-child(odd)').addClass('friend-blue');	
  	
  // Recipes ODD and EVEN for alterating blue+green panels  		
  	$('#recipesList li:nth-child(even)').addClass('recipe-green');
  	$('#recipesList li:nth-child(odd)').addClass('recipe-blue');	

  // Content Height Hack  
  $(window).load(function(){
  	var leftHeight = $('#left').height();
  	var rightHeight = $('#right').height();  
  	$('#left').css('height', leftHeight);
  	$('#right').css('height', rightHeight);  	  	
  		if(leftHeight < rightHeight) {
  			$('#left').css('height', rightHeight);
  		}  
  });
  		
  // FancyBox 
	$("a.iframe, .gal").fancybox({
		transitionIn	:	'elastic',
		transitionOut	:	'elastic',
		speedIn		:	300, 
		speedOut	:	300, 
		overlayShow	:	true,
		autoScale   :	true,
		autoDimensions :   true,
		centerOnScroll :   true
	});  		
  		
});

