// Initialize
$(document).ready(function() {
	$("#cover").show();
});
$(window).load(function() {
	$("#cover").fadeOut(1500);
});


// Key Functions
$(document).keydown(function(event) {
	//Left
	if(event.keyCode == 37 && $(".prev").length!=0){
		$("#cover").fadeIn("slow");
		window.location = $(".prev").attr("href");
	}
	//Right
	if(event.keyCode == 39 && $(".next").length!=0){
		$("#cover").fadeIn("slow");
		window.location = $(".next").attr("href");
	}
});

// Next/Prev
$(".image").click(function (){
	$("#cover").fadeIn("slow");
	window.location = $(".next").attr("href");
});
$(".next").click(function (){
	$("#cover").fadeIn("slow");
});
$(".prev").click(function (){
	$("#cover").fadeIn("slow");
});

// Index
$("#about").click(function() {
	$("#boxes .column").fadeOut(function() {
		$("#aboutContain .column").show();
		$("#aboutContain").fadeIn();
	});
});
$(".column").mouseenter(function(){
	if($(this).children(".viewProject").length != 0){
		$(this).children(".viewProject").fadeIn();
		$(this).mouseleave(function() {
			$(this).children(".viewProject").fadeOut();
		});
	}
});
$(".viewProject").mouseenter(function(){
	
});

// Rotate
function rotatr(what,degree,speed){
	var currentPosition = $(what).attr("style");	
}

// For the time being
		$("#blogLink").mouseenter(function(){
			$(this).fadeOut(function(){
				$(this).text("coming very soon");
				$(this).fadeIn();
			});
			$(this).mouseout(function(){
				$(this).fadeOut(function(){
					$(this).text("blog");
					$(this).fadeIn();
				});
			});
		});
		$("#shopLink").mouseenter(function(){
			$(this).fadeOut(function(){
				$(this).text("coming very soon");
				$(this).fadeIn();
			});
			$(this).mouseout(function(){
				$(this).fadeOut(function(){
					$(this).text("shop");
					$(this).fadeIn();
				});
			});
		});