$(function()
{
	var sw = $('#switch');
	var post = $('article, #paginate, .shadow');
	var toggle = false;
	
	$(sw).click(function(){
		if(!toggle){
			winWidth = $(window).width();
			toggle = true;
			$(this).css('background-position', '0 -272px');
			
			$(post).animate({left: winWidth+'px'}, 600, 'easeInQuad',
				function(){
					$(post).css('opacity', 0);
				}
			);
			
/*
			$('#words .or').animate({color: '#ff9f41'}, 2000);
			$('#words .bl').animate({color: '#39bfb2'}, 3000);
			$('#words .gr').animate({color: '#8fa82b'}, 4000);
			$('#words .b').animate({color: '#989795'}, 5000);
*/

			$('#words .bl').animate({color: '#39bfb2'}, 2000);
			$('#words .or').delay(500).animate({color: '#ff9f41'}, 2000);
			$('#words .gr').delay(1000).animate({color: '#8fa82b'}, 2000);
			$('#words .b').delay(1500).animate({color: '#989795'}, 2000);
			
		}
		else{
			toggle = false;
			$(this).css('background-position', '0 -240px');
			
			$(post).animate({left: '0px', opacity: 2}, 600, 'easeOutQuart');

			$('#words .or').animate({color: '#e8e7e3'}, 500);
			$('#words .bl').animate({color: '#e8e7e3'}, 500);
			$('#words .gr').animate({color: '#e8e7e3'}, 500);
			$('#words .b').animate({color: '#e8e7e3'}, 500);

		}
	})
});

