// JavaScript Document
$(document).ready(function(){
		
	   // cookie for bottom page toggle 
	  if( $.cookie( 'state' ) == null || $.cookie( 'state' ) == 'open' ){ 
		  $('a.social-toggle').attr('rel', 'open' );
		  $('a.social-toggle').removeClass('up');
		  $('a.social-toggle').addClass('down');
	  } else { 
		  $('.footer_blurb').addClass('none');
		  $('a.social-toggle').attr('rel', 'closed' );
		  $('a.social-toggle').removeClass('down');
		  $('a.social-toggle').addClass('up');
	   }
	  
	  // bottom page toggle	  
	  $('a.social-toggle').click(function () {
			$('.footer_blurb').toggle();
			
			var current_state = $(this).attr('rel');
			
			if( current_state == 'open' ) {
				$('a.social-toggle').attr('rel', 'closed' );
				$('a.social-toggle').removeClass('down');
				$('a.social-toggle').addClass('up');	
				var set_state = 'closed';
			}else{
				$('a.social-toggle').attr('rel', 'open' );
				$('a.social-toggle').removeClass('up');
		  		$('a.social-toggle').addClass('down');
				var set_state = 'open'
			}		
 
 			$.cookie('state', ''+ set_state +'', { path: '/', expires: 1 });
		});
		
		// Twitter Feed												 
		$(".tweet").tweet({
				username: 'fnfpetresort',
				join_text: "auto",
				avatar_size: 32,
				count: 3,
				auto_join_text_default: "",
				auto_join_text_ed: "we",
				auto_join_text_ing: "we were",
				auto_join_text_reply: "we replied to",
				auto_join_text_url: "we were checking out",
				loading_text: "loading tweets..."
		});	

		$('a[href=#top]').click(function(){
			$('html, body').animate({scrollTop:0}, 500);
			return false;
		});
													 
		// Drop off date
		$( "#drop-off-date" ).datepicker();
		// Pick up date
		$( "#pick-up-date" ).datepicker();
		
		
	  //Default Action
		 $(".tab_content").hide(); 
		 $("ul.tabs li:first").addClass("active").show(); 
		 $(".tab_content:first").show(); 
		
		 //On Click Event
		 $("ul.tabs li").click(function() {
			 $("ul.tabs li").removeClass("active"); 
			 $(this).addClass("active"); 
			 $(".tab_content").hide(); 
				var activeTab = $(this).find("a").attr("href"); 
			 $(activeTab).fadeIn(); 
				return false;
		 });															
															 
    $(".download1").hover(function(){
																	
		// bouncing images
        $(".download1 img")
            .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200)
            .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100)
            .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100);
    	});// end bouncing images
	
    $(".download2").hover(function(){
		// bouncing images
        $(".download2 img")
            .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200)
            .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100)
            .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100);
    	});// end bouncing images
	
    $(".download3").hover(function(){
		// bouncing images
        $(".download3 img")
            .animate({top:"-10px"}, 200).animate({top:"-4px"}, 200)
            .animate({top:"-7px"}, 100).animate({top:"-4px"}, 100)
            .animate({top:"-6px"}, 100).animate({top:"-4px"}, 100);
    	});// end bouncing images	
		
		// fancymap
		$(".map").fancybox({
			'titleShow'			: false,
			'autoDimensions'    : true,
			'scrolling'			: 'no',			
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'showCloseButton'	: true,
			'hideOnOverlayClick': false,
			'modal'				: false	
		});
		
		// fancymap
		$(".calendar").fancybox({
			'titleShow'			: false,
			'autoDimensions'    : true,
			'scrolling'			: 'no',			
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'showCloseButton'	: true,
			'hideOnOverlayClick': false,
			'modal'				: false	
		});	

		// newsletter
		$(".newsletter").fancybox({
			'type'			: 'iframe',														
			'height'		:	320,
			'width'		:	520,
			'padding'			:    10,
			'hideOnContentClick': false,
			'hideOnOverlayClick': false,
			'scrolling' : 'no'
		});
		
		// begin grooming
		$("a.groominglink").fancybox({
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'titleShow'			: false,
			'scrolling'			: 'no',
			'autoScale': true,
			'speedIn'		:	600, 
			'speedOut'		:	200,
			'overlayShow'	:	true,
			'modal'				: false
		});
		
		// begin docs
		$("a.docs").fancybox({
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'titleShow'			: false,
			'speedIn'		:	600, 
			'speedOut'		:	200,
			'overlayShow'	:	true,
			'modal'				: false
		});	
		
		// begin single image
		$("a.single").fancybox({
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'titleShow'	: false,
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'overlayShow'	:	true,
			'modal'				: false,
			'titlePosition':'over'
		});	
		
		// begin training slide
		$("a.grouped").fancybox({
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'overlayShow'	:	true,
			'modal'				: false,
			'titlePosition':'over'
		});
		
		// begin single image
		$("a.hoverpulse").fancybox({
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'titleShow'	: false,
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'overlayShow'	:	true,
			'modal'				: false,
			'titlePosition':'over'
		});	
		
		// table row alternate colors 
		$(".ratestr:even").css("background-color", "#f6f6f6");
		$(".ratestr:odd").css("background-color", "#e6e6e6");
		
		// table row alternate colors 
		$(".groomingtr:even").css("background-color", "#f6f6f6");
		$(".groomingtr:odd").css("background-color", "#e6e6e6");	

		// begin training slide
		$(".faqs").fancybox({
			'transitionIn'	:	'fade',
			'transitionOut'	:	'fade',
			'speedIn'		:	600, 
			'speedOut'		:	200, 
			'overlayShow'	:	true,
			'modal'				: false,
			'type'				:'iframe',
			'width'				: 600,
			'height'			: 450
		});
		// activate kitty hover pulse
		$('div.kittythumb img').hoverpulse({
        size: 40,  // number of pixels to pulse element (in each direction)
        speed: 400 // speed of the animation 
    	});
		
		// activate kitty hover pulse
		$('div.bigdogthumb img').hoverpulse({
        size: 40,  // number of pixels to pulse element (in each direction)
        speed: 400 // speed of the animation 
    	});
	
		// activate kitty hover pulse
		$('div.smalldogthumb img').hoverpulse({
        size: 40,  // number of pixels to pulse element (in each direction)
        speed: 400 // speed of the animation 
    	});

		// activate kitty hover pulse
		$('div.dogsuitethumb img').hoverpulse({
        size: 40,  // number of pixels to pulse element (in each direction)
        speed: 400 // speed of the animation 
    	});
		
		// activate kitty hover pulse
		$('div.dogturfthumb img').hoverpulse({
        size: 40,  // number of pixels to pulse element (in each direction)
        speed: 400 // speed of the animation 
    	});
		
		// activate kitty hover pulse
		$('div.birdthumb img').hoverpulse({
        size: 40,  // number of pixels to pulse element (in each direction)
        speed: 400 // speed of the animation 
    	});
		
});// end functions
	
