$(document).ready(function() {
	
	/* PNG Fix */
	$(document).pngFix(); 
	
	/* Enter the Cufon */
	Cufon.replace("h2, #feed p, #gallery p");
	
	/* Active States */
	$("#gallery ol li a").click(function(){
		$("#gallery ol li").removeClass("active");
		$(this).parent().toggleClass("active");
		return false;
	});
	
	/* Gallery */
	$("ol a.videos").click(function(){
		$(this).stop(true, true);
		$("#photos").removeClass();
		$("#videos").addClass("active");
    	$("#photos ul").fadeOut();
    	$("#photos ul").animate({ left: '0px' }, 100);
    	$("#videos ul").fadeIn();
    	$("#videos ul").animate({ left: '0px' }, 100);
    	$("a.scroll-photos-more, a.scroll-photos-back, a.scroll-videos-back").hide();
    	$("a.scroll-videos-more").show();
    	return false;
	});
	$("ol a.photos").click(function(){
		$(this).stop(true, true);
		$("#videos").removeClass();
		$("#photos").addClass("active");
    	$("#videos ul").fadeOut();
    	$("#photos ul").fadeIn();
    	$("a.scroll-videos-more, a.scroll-videos-back, a.scroll-photos-back").hide();
    	$("a.scroll-photos-more").show();
    	return false;
	});
	
	$("a.scroll-photos-more").click(function(){
		$(this).stop(true, true);
		$(this).hide(); 
		$("a.scroll-photos-back").show();
    	$("#photos ul").animate({ left: '-720px' }, 400);
    	return false;
	});
	
	$("a.scroll-videos-more").click(function(){
		$(this).stop(true, true);
		$(this).hide(); 
		$("a.scroll-videos-back").show();
    	$("#videos ul").animate({ left: '-720px' }, 400);
    	return false;
	});
	
	$("a.scroll-photos-back").click(function(){
		$(this).stop(true, true);
		$(this).hide(); 
		$("a.scroll-photos-more").show();
    	$("#photos ul").animate({ left: '0px' }, 400);
    	return false;
	});
	
	$("a.scroll-videos-back").click(function(){
		$(this).stop(true, true);
		$(this).hide(); 
		$("a.scroll-videos-more").show();
    	$("#videos ul").animate({ left: '0px' }, 400);
    	return false;
	});
	
	/* Photos */
	$("#gallery ul li:odd").addClass("alt");
			
	/* Fancyzoom */
	$("#photos a").fancybox();
	$("#videos a.play").fancybox({
		'frameWidth':		480,
		'frameHeight':		360,
		'padding':			0,
		'hideOnContentClick':	false
	});
	$("a.show-breeds").fancybox({
		'frameWidth':		900,
		'frameHeight':		430,
		'padding':			0,
		'imageScale':		false,
		'overlayShow':		true,
		'hideOnContentClick':	false
	});
	$("a.show-accessories").fancybox({
		'frameWidth':		900,
		'frameHeight':		300,
		'padding':			0,
		'imageScale':		false,
		'overlayShow':		true,
		'hideOnContentClick':	false
	});
	$("a.show-care, a.view-care").fancybox({
		'frameWidth':		750,
		'frameHeight':		310,
		'padding':			0,
		'imageScale':		false,
		'overlayShow':		true,
		'hideOnContentClick':	false
	});
	
	$("#head li.facebook, #head li.buy, #head li.plus, #head h1 a, #gallery ol li:not(active)").hover(function(){
		$(this).stop(true, true);
    	$(this).fadeTo("fast", 0.8);
	},
	function(){
		$(this).fadeTo("fast", 1.0);
	});
	
	$(".social a.fans, .social .plus a, a.view-care").hover(function(){
		$(this).stop(true, true);
    	$(this).animate({ marginTop: "-2px" }, 100);
	},
	function(){
		$(this).animate({ marginTop: "0px" }, 200);
	});
	
	$("#photos li").hover(function(){
		$(this).stop(true, true);
    	$(this).animate({ top: "3px" }, 100);
	},
	function(){
		$(this).animate({ top: "0px" }, 200);
	});
	
});