$(function(){
	/*
	$('#member_login_form').submit(function() { 
		$('#response #error').html('');
		$(this).ajaxSubmit({
			success: function(response){
				var state = ($(response).find('#content h1').html());
				if (state == 'The following errors were encountered') {
					$('#response #error').html($(response).find('#content ul').html());
				} else {
					location.href=location.href=$('input[name=RET]').val();
				}
			}
		}); 
		return false; 
	});
	*/
	$('#bulletin').submit(function(){
		$('.bulletin-response').removeClass('error').html('');
		$(this).ajaxSubmit({
			url: 'http://awesomeanything.us2.list-manage.com/subscribe/post-json?u=bbae34da6bd6ad5f678c01a3d&id=24b3a8089d&c=?', 
			type: 'GET', 
			dataType: 'json', 
			contentType: "application/json; charset=UTF-8",
			success: function(response){
				$('.bulletin-response').html(response.msg);
				if (response.result == "error") {$('.bulletin-response').addClass('error')};
			}
		});
		return false;
	});
	
	$('#footer-open, .footer-content h6').click(function(){
		$('.wrapper').css('margin-bottom', '-250px');
		$('.footer-gap').css('height', '250px');
		$('.footer-bar').css('height', '250px');
		$('.footer').css('height', '250px');
		
		 $('html, body').animate({scrollTop: $(document).height()}, 'slow');
		 $('#footer-open').hide();
		 $('#footer-close').show();
		
	});
	
	$('#footer-close').click(function(){
		$('.wrapper').css('margin-bottom', '-40px');
		$('.footer-gap').css('height', '40px');
		$('.footer-bar').animate({height:'40px'}, 'fast');
		$('.footer').animate({height:'40px'}, 'fast');
		$('#footer-close').hide();
		$('#footer-open').show();
	});
	
	//article summary
	$('.article-box').hover(function(){
		$(this).find('.article-meta').css('background-color', 'rgba(255,255,255,0.8)').fadeIn();
		$(this).find('.article-summary').fadeIn();
	},function(){
		$(this).find('.article-meta').css('background-color', 'transparent').fadeOut();
		$(this).find('.article-summary').fadeOut();
	});
});
