$(function() {
	$('#Header div.background').hide();
	$(window).load(function() {
		Stats.init();
		$(document.body).removeClass('loading');
	})
});

var Stats = {
	
	Recycling: null,
	GreenPower: null,
	Links: null,
	LinkLi: null,
	
	init: function() {
		var cc = this;
		cc.Recycling = $('#Recycling');
		cc.GreenPower = $('#GreenPower');
		cc.Links = $('#Links li a');
		cc.LinksLi = $('#Links li');
		
		cc.events();
		cc.render()	
	},
	
	events: function() {
		var cc = this;
		
		cc.Links.bind('mouseenter', function(){
			var link = $(this).parent();
			link.stop();
			link.animate({ 
				marginTop: "-10"
		 	}, 500, 'easeOutExpo');
		});
		
		cc.Links.bind('mouseleave', function(){
			var link = $(this).parent();
			link.stop();
			link.animate({ 
				marginTop: "-20"
		 	}, 500, 'easeOutExpo');
		});
	},
	
	render: function() {
		var cc = this;
		
		cc.LinksLi.hide();
	
		cc.Recycling.css('marginTop','-130px');
		cc.Recycling.animate({ 
	        marginTop: "-10"
	    }, 500, 'easeInOutExpo');
	
		cc.Recycling.animate({ 
		        marginTop: "-80"
	    }, 500, 'easeOutBounce');
	
		cc.GreenPower.css('marginTop','-150px');
		cc.GreenPower.animate({ 
	        marginTop: "-10"
	    }, 600, 'easeInOutExpo');

		cc.GreenPower.animate({ 
		        marginTop: "-80"
	    }, 600, 'easeOutBounce', 
			function() {
				cc.LinksLi.css({marginTop: '-60px', display: 'block'});
				cc.LinksLi.animate({ 
					marginTop: "-20"
			 	}, 800, 'easeOutBounce');
			}
		);

	}
}