$(document).ready(function(){
	/* *********************************************************** */
	// Giveaway promo, Gift Box animation
	/* *********************************************************** */
	// Get the starting CSS values for the top of both halves of the 
	// gift box.
	// NOTE: These values are returned as strings, so they will need
	//       to be converted before doing calculations
	var giftBoxTopStartingPos = $(".gift-box-top").css("top");
	var giftBoxBottomStartingPos = $(".gift-box-bottom").css("top");
	// Remove 'px' from the returned css property value string for the
	// tops of the two halves of the gift box
	giftBoxTopStartingPos = giftBoxTopStartingPos.replace("px", "");
	giftBoxBottomStartingPos = giftBoxBottomStartingPos.replace("px", "");
	// Set the increment values you want the box halves to move up/down
	var giftBoxTopInc = 150;
	var giftBoxBottomInc = 90;
	// Set the speed (milliseconds) you want the box halves to move
	var movementSpeed = 1200;
	// Set the new position of the two halves of the Gift Box
	// NOTE: Have to change the starting position to a number (int works)
	//       before doing mathematical calculations, using parseInt()
	var giftBoxTopNewPos = parseInt(giftBoxTopStartingPos) - giftBoxTopInc;
	var giftBoxBottomNewPos = parseInt(giftBoxBottomStartingPos) + giftBoxBottomInc;
	$(".giveaway-promo-container").mouseenter(function(event){
		// The stop() function keeps the animation from repeating the
		// animation for each time the user enters/leaves the containing
		// div.
		// Without the addition of this code, if the user moves the mouse
		// in and out of the containing div quicker than the 
		// animation can complete, more animation sequences are qued and 
		// even when the user moves the mouse out of the div, and 
		// leaves it out for a while, the animation continues to repeat.
		$(".gift-box-top").stop();
		$(".gift-box-bottom").stop();
		// do something when the mouse enters the promo box
		$(".gift-box-top").animate( { top:giftBoxTopNewPos }, movementSpeed );
		$(".gift-box-bottom").animate( { top:giftBoxBottomNewPos }, movementSpeed );
	});
	$(".giveaway-promo-container").mouseleave(function(event){
		$(".gift-box-top").stop();
		$(".gift-box-bottom").stop();
		// do something when the mouse leaves the promo box
		$(".gift-box-top").animate( { top:giftBoxTopStartingPos }, movementSpeed );
		$(".gift-box-bottom").animate( { top:giftBoxBottomStartingPos }, movementSpeed );
	});
});
