$(function(){
	var current_color = 0;
	var colors = ["1f679d", "E5252C", "3e5f86", "3e5f86", "c8c965", "e9bf00"];
	

		$(".alt h1:first").click(function(){
		
			current_color++;
			if(current_color >= colors.length) current_color = 0;
			$("body:first").css("border-color","#"+colors[current_color]);
			$("headers:first").css("border-color","#"+colors[current_color]);
			$("#main a").css("color","#"+colors[current_color]);
			$("nav a.active").css("color","#"+colors[current_color]);
			return false;
		
		
		});

	$("#theRest").hide();
	$("#more").click(function(){
		$(this).fadeOut(400);
		$("#theRest").slideDown(600);
		return false;
	});
	
	$(".bw_fader").each(function(){
		var i = $(this).children().eq(0);
		var new_i = $(i).clone().appendTo($(this));
		$(new_i).hide().css("top",-$(this).outerHeight()+"px");
		var t = $(this);
		$(this).parent().hover(
			function(){
				$(t).stop().clearQueue().fadeTo("normal",1);
				$(new_i).stop().clearQueue().fadeTo("normal",1);
			},
			function(){
				$(t).stop().clearQueue().fadeTo("normal",0.9);
				$(new_i).stop().clearQueue().fadeOut("normal");
			}
		);
	});
	
	$(".fader").each(function(){
		var i = $(this).children().eq(0);
		var t = $(this);
		$(this).parent().hover(
			function(){
				$(t).stop().clearQueue().fadeTo("normal",1);
			},
			function(){
				$(t).stop().clearQueue().fadeTo("normal",0.4);
			}
		);
	});
	
	$(document).ready(function(){
		
		$("a[rel=instagram_photos]").fancybox({
			overlayColor: "#111"
			});
		
	});
	
	$(window).resize(function(){
		$("#theRest").css("width", $("#theRest").parent().outerWidth());
	});
	$(window).resize();
});

