
$(document).ready(function(){
	$(".second_menu li a").hoverIntent(function() {
		$(this).stop().animate({ backgroundColor: "#373534" }, 700);
		},function() {
		$(this).stop().animate({ backgroundColor: "#1D1D1B" }, 700);
	});
});


$(function(){
	$('.logo').hoverIntent(
		function(){
				if($('.hidden_menu_wrapper').css('display') == 'none' ) {
					$('.hidden_menu_wrapper').fadeIn(1200);
				}
		},
		function () {
			$.noop();
		}
	);
	
	$('.logo_wrapper').mouseleave(function () {
			$('.hidden_menu_wrapper').fadeOut(1200);
	});
});

$(function(){
	$('.toggle').hoverIntent(
		function(){
				if($('.feature_wrapper .feature_content').css('display') == 'none' ) {
					$('.feature_wrapper .feature_content').slideToggle(1000);
				}
		},
		function () {
			$.noop();
		}
	);
	
	$('.feature_content').mouseleave(function () {
			$('.feature_wrapper .feature_content').stop(true, true).slideToggle(1000);
	});
});

$(document).ready(function(){
	$("img.a").hover(
		function() {
		$(this).stop().animate({"opacity": "0"}, 600);
	},
		function() {
		$(this).stop().animate({"opacity": "1"}, 600);
	});
});

$(document).ready(function () { 
    $('.menu li, .submenu').hover (
        function () {
            $('.submenu_wrapper', this).stop(true, true).delay(100).fadeIn(800);
        },
        function () {
            $('.submenu_wrapper', this).stop(true, true).delay(100).fadeOut(600);
        } 
    );
});

$(document).ready(function () {
	$('.newsletter_toggler').click (
		function () {
			$('.bottom_wrapper').stop().animate({ bottom: 0 }, 800);
		}
	);
	
	$('.bottom_wrapper').mouseleave(function () {
			$('.bottom_wrapper').stop().animate({ bottom: -130 }, 800);
	});
});

$(document).ready(function () { 
    $('#supersized').hover (
        function () {
            $('#nextslide', '#prevslide').stop(true, true).animate({"opacity": "1"}, 600);
        },
        function () {
            $('#nextslide', '#prevslide').stop(true, true).animate({"opacity": "0"}, 600);
        } 
    );
});

$(function() {
	$(window).scroll(function() {
		if($(this).scrollTop() != 0) {
			$('#toTop').fadeIn();	
		} else {
			$('#toTop').fadeOut();
		}
	});
 
	$('#toTop').click(function() {
		$('body,html').animate({scrollTop:0},800);
	});	
});

$(document).ready(function () { 
	$('#ingredient_herb').click(function() {
		$.scrollTo('.ingredient_herb', 800);
	});
	
	$('#ingredient_environmental').click(function() {
		$.scrollTo('.ingredient_environmental', 800);
	});
	
	$('#beauty_award').click(function() {
		$.scrollTo('.beauty_award', 800);
	});
	
	$('#design_award').click(function() {
		$.scrollTo('.design_award', 800);
	});
	
	$('#2011').click(function() {
		$.scrollTo('li.2011', 800);
	});
	
	$('#2010').click(function() {
		$.scrollTo('li.2010', 800);
	});
});

$(window).load(function() {
	$("#catalog_wrapper").smoothDivScroll({ 
	});
	
	$("#scroll_first").click(function() {
		$("#catalog_wrapper").smoothDivScroll("moveToElement", "first");
	});

	$("#scroll_last").click(function() {
		$("#catalog_wrapper").smoothDivScroll("moveToElement", "last");
	});
	//$("div#catalog_wrapper").bind("mouseover", function() {
	//	$(this).smoothDivScroll("stopAutoScroll");
	//}).bind("mouseout", function() {
	//	$(this).smoothDivScroll("startAutoScroll");
	//});
});

/*
$(function() {
	$('.catalog_box').click(function() {
		if($('.content', this).css('display') == 'none' ) {
			$('.content', this).toggle('slide', { direction: 'left' }, 1000);
		}
		else if($('.content', this).css('display') == 'block' ) {
			$('.content', this).toggle('slide', { direction: 'left' }, 1000);
		}
	});
});
*/

/*
$(function(){
	$(".catalog_box").accordion('slide', { direction: 'left' }, 1000);
});
*/

$(document).ready(function() {
  	$('.catalog_box').click(function() {
		if($('.content', this).css('z-index') == '0' ) {    	
			$('.content', this).css('z-index', '2');
			$('.content', this).animate({"opacity": "1"}, 600);
		}
		else if($('.content', this).css('z-index') == '2' ) {    
			$('.content', this).animate({"opacity": "0"}, 600);
			$('.content', this).css('z-index', '0');
		}
  	});
});


