$(document).ready(function() {

	$("#menu_pane li a").hover(
		function() {
			$(this).stop().animate({height: "50px"}, 250);
		},
		function() {
			$(this).stop().animate({height: "15px"}, 250);
		}
	);

	$("#siteRotator").siteRotator();
			
	if (jQuery.support.opacity)
	{
		var animLength = 400;
		var fadeTo = 0;
		var $cakeBullet = $("#cakeBullet");
		$cakeBullet.hover(function() {
			$("#birthdayCakeImg").animate({
				opacity: fadeTo
			}, animLength, "swing", function() {
				$(this).animate({
					opacity: 1
				}, animLength);				
			});
			$("#birthdayCakeNoFlameImg").animate({
				opacity: 1
			}, animLength, "linear", function() {
				$(this).animate({
					opacity: fadeTo
				}, animLength);
			});
			
		});
	
		var $bathtubBullet = $("#bathtubBullet");
		$bathtubBullet.hover(function() {
			$("#bathtubBulletImg").css("position", "relative");
			if(jQuery.browser['safari'])
			{
				$("#bathtubBulletImg").animate({rotate: '+=360deg'}, 500);
			}
			else
			{
				$("#bathtubBulletImg").animate({
					width: '+=150', 
					opacity: 0.5,
					left: '-=75'
				}, 240, "linear", function() {
					$(this).animate({
						width: '-=150', 
						opacity: 1,
						left: '+=75'
					}, 240);
				});
			}
		});
	}

	var $ticketBullet = $("#ticketBullet");
	
	$ticketBullet.hover(function() {
		$this = $(this);
		if ($this.data("executing")) return;
		$this.data("executing", true);
		
		$("#sunIcon").animate({
			left: "+=25px",
			top: "-=30px"
		}, 750, "linear", function() {
			
			$(this).animate({
				left: "-=25px",
				top: "+=30px"
			}, 750, "linear", function() {
				$this.data("executing", false);
			});
			
		});
	});
	
	
	var intId = window.setInterval(flashContactUs, 4000);
	function flashContactUs() {
		$("#phoneTag").animate({
			opacity: 0
		}, 1000, "swing", function() {
			$(this).animate({
				opacity: 0
			},1000, "swing", function() {
				
				$(this).animate({
					opacity: 1
				}, 1000);
				
			});				
		});
	}
});