$(document).ready(function() {

var i;
for (i in document.images) {
    if (document.images[i].src) {
        var imgSrc = document.images[i].src;
        if (imgSrc.substr(imgSrc.length-4) === '.png' || imgSrc.substr(imgSrc.length-4) === '.PNG') {
            document.images[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='crop',src='" + imgSrc + "')";
        }
    }
}


// Page Load Effects
$('#feature_top').children().hide();
$('#quotes').children(".active").fadeIn(600);
$('#collection_text').children(".active").fadeIn(600);
$("#dim_wrapper").animate({opacity: "0"});

// What's Hot Animation
$("#whats_hot_show").hover(function(){
	
$("#whats_hot_hide").fadeIn({duration: 1000, easing: 'easeInCubic'});
$("#dim_wrapper").show().animate({height: "375"}, 200, function(){ $("#dim_wrapper").animate({opacity: "1.0"}, 1200) });
$('#feature_base').animate({height: "120"}, "slow", function(){ $("#whats_hot").fadeIn(1200); });
$('#feature_top').animate({height: "20"}, "slow");
$('#feature_top').children().fadeIn(1200);
$('#whats_hot_show').hide();
$('.carousel-control').hide();
$('.carousel-pagination').hide();
return false;
	
	});
	
$("#whats_hot_hide").click(function(){

$('#whats_hot_hide').fadeOut(1200);
$("#dim_wrapper").animate({opacity: "0.4"}, function(){
$('#whats_hot').fadeOut(400, function(){$("#feature_base").animate({height: "40"}, "slow");
$('#feature_top').children().fadeOut(100);
$('#feature_top').animate({height: "5"}, "slow");
$('#whats_hot_show').show();
$('.carousel-control').show();
$('.carousel-pagination').show();
});
$("#dim_wrapper").css("height", "0");
$("#dim_wrapper").animate({opacity: "0"}).hide(); });

return false;
	
	});

// Bottom Fragrance Navigation
$(".fragrance").hover(function(){
$('.' + $(this).attr("rel") + '_quote').siblings().hide();
$('.' + $(this).attr("rel") + '_quote').fadeIn(200);
$('.' + $(this).attr("rel") + '_text').siblings().hide();
$('.' + $(this).attr("rel") + '_text').fadeIn(200);

return false;
	
	},
function(){
	$('#quotes').children().hide();
	$('#quotes').children(".active").fadeIn(200);
	$('#collection_text').children().hide();
	$('#collection_text').children(".active").fadeIn(200);
});

// Interior Navigation
$(".story").click(function(){
	
	$('.story_container').siblings().fadeOut(1200);
	$('.story_container').fadeIn(1200);
	
	return false;
	
	});
	
$(".collection").click(function(){
	
	$('.collection_container').siblings().fadeOut(1200);
	$('.collection_container').fadeIn(1200);
	
	return false;
	
	});
	
$(".notes").click(function(){
	
	$('.notes_container').siblings().fadeOut(1200);
	$('.notes_container').fadeIn(1200);
	
	return false;
	
	});
	
// Notes Dots Rollover
$('.ingredient_title').children(":first").fadeIn(1200);

$(".dot").hover(function(){
$(this).css("background-image", "url(images/dot-white.png)");
$(this).siblings(".dot").css("background-image", "url(images/dot-gold.png)");
$('.' + $(this).attr("rel")).fadeIn("slow");
$('.' + $(this).attr("rel")).siblings().fadeOut("slow");

return false;
	
	});

});
