// JavaScript Document

$(document).ready(function() {
	
	$('#subMenuButton , #m3pg').click(function() {
		$('#subMenuButton').delay(10).animate({
			top:'200px'
			}, 1000);
			
		$('#subMenuBirreArrow').animate({
			marginTop:'0px',
			rotate:'180deg',
			});
		$('#submenuBirre').animate({
			top: '102px'
			}, 1000)
	});		
	$('.nascondi').show();
	
		$('.hbLogo').delay(2500).fadeIn();
		$('.carlsbergLogo').delay(3000).fadeIn();
		$('.spatenLogo').delay(3500).fadeIn();
		$('.hoegaardenLogo').delay(4000).fadeIn();
	
	$('.nascondi').click(function() {
		$('#subMenuButton').animate({
			top:'100px'
			}, 1000);
		$('#subMenuBirreArrow').animate({
			rotate:'0deg',
			});
		$('#submenuBirre').delay(10).animate({
			top: '-10px'
			}, 1000)
	});
	
	$("#slider").easySlider({ continuous: true, auto: true });
	$("#sliderIndex").easySlider({ continuous: true, auto: true });
	
	// FORMS STYLES
	$("input , textarea").focus(function() {
		$(this).addClass("active");
	});
	$("input , textarea").focusout(function() {
		$(this).removeClass("active");
	});
	
	// PRIVACY STYLES
	$(".privacy").click(function() {
		$(".policyPopup").fadeIn(1000);
	});
	$(".close").click(function() {
		$(".policyPopup").fadeOut(1000);
		return false;
	});
	
	// CARLSBER BANNER ANIMATION
	$('#arrowBottom').mouseover(function(){
		$('#arrowBottom').animate({ top: '810px'}, 200);
	});
	$('#arrowBottom').mouseout(function(){
		$('#arrowBottom').animate({ top: '800px'}, 200);
	});
	
	$('#arrowBottom').click(function(){
		$('#carlsberg').animate({ top: '-420px'}, 200);
		$('#carlsbergContainer').css({ height: '700px'});
		$('#arrowTop').fadeIn();
		$('#arrowBottom').fadeOut();
	
	$('#arrowTop').click(function(){
		$('#carlsberg').animate({ top: '0px' }, 200);
		$('#carlsbergContainer').css({ height: '400px'});
		$('#arrowTop').fadeOut();
		$('#arrowBottom').fadeIn();
	});
	});
});
