// Jj vim co ze je to prasacky napsany, ale pomer cena vykon pri variante "nejdriv se to naucit a pak to napsat genericky proste nestala za to.":o) Jsem amater, ne profik.

// I know that this brood force for scripting is wrong, but I am not a pro and to do it I would need to learnt it first:o).

$(document).ready(function() {


 $("#screen").height(580);

// HLAVNI MENU

	

	$("#projects, #name, #portfolio").click(function() {
		clearAll();

		$("#screen").height(580);
		$(".project").fadeIn(800);
		$("#projects").fadeOut(200);
			
		$("#projects").css("background-position", "left 0");
		$("#projects").fadeIn(400);
		$("#photos").css("background-position", "left -60px");
		$("#about").css("background-position", "left -60px");
	});
	
		
	$("#photos").click(function() {
		  clearAll();
		$("#screen").height(650);
		$("#frame").fadeIn(800);
		$("#photo1").fadeIn(800);
		$("#minigallery1").fadeIn(800);
		$("#G2_right").fadeIn(800);
		$("#a2R").fadeIn(800);
		$("#emptyarrow2").show();
		$("#pad2").show();
	//	$(".arrows").fadeIn(); //Tohle pak prepsat na konkretni sipky
		$(this).fadeOut(200);
		$(this).css("background-position", "left 0px");
		$("#projects").css("background-position", "left -60px");
		$("#about").css("background-position", "left -60px");
		$(this).fadeIn(400);

	});

        $("#about").click(function() {
		  clearAll();
		$("#screen").height(400);
		$("#aboutcontent").fadeIn(800);
		$(this).fadeOut(200);
		$(this).css("background-position", "left 0px");
		$("#photos").css("background-position", "left -60px");
		$("#projects").css("background-position", "left -60px");
		$(this).fadeIn(400);

	
		
	});
		
	$("#projects").hover(
 			function () {
			$("#photosh").hide();
			$("#abouth").hide();
			$("#projectsh").fadeIn(200);
 			 },
			 function () {
 			 $("#projectsh").fadeOut(200);
			
		 });
	
	$("#photos").hover(
 			function () {
			$("#projectsh").hide(); 
			$("#abouth").hide();
			 $("#photosh").fadeIn(200);
 			 },
			 function () {
 			 $("#photosh").fadeOut(200);
			
		 });		
	$("#about").hover(
 			function () {
			$("#projectsh").hide();
			$("#photosh").hide();
			 $("#abouth").fadeIn(200);
 			 },
			 function () {
 			 $("#abouth").fadeOut(200);
			
		 });	

// PROJEKTY
	$("#pStrepy_snu").click(function() {
		clearAll();
		projectDetail();
		$(".arrow_right.#aMafiaR").fadeIn(); //Tohle pak prepsat na konkretni sipky
		$("#Strepy").fadeIn(); 
	});
	
	$("#pMafia").click(function() {
		clearAll();
		projectDetail();
		$("#aStrepy").fadeIn(); //Tohle pak prepsat na konkretni sipky
		$("#aBestiarR").fadeIn();
		$("#Mafia").fadeIn(); 
	});
	
	$("#pBestiar").click(function() {
		clearAll();
		projectDetail();
		$("#Bestiar").fadeIn();
		$("#aMafiaL").fadeIn();
		$("#aJoes_AdventuresR").fadeIn(); 
	});
	$("#pJoes_Adventures").click(function() {
		clearAll();
		projectDetail();
		$("#Joes_Adventures").fadeIn();
		$("#aBestiarL").fadeIn();
		$("#aKreativitaR").fadeIn(); 
	});
	$("#pKreativita").click(function() {
		clearAll();
		projectDetail();
		$("#Kreativita").fadeIn();
		$("#aJoes_AdventuresL").fadeIn();
		$("#aDrDR").fadeIn(); 
	});
	$("#pDrD").click(function() {
		clearAll();
		projectDetail();
		$("#DrD").fadeIn();
		$("#aKreativitaL").fadeIn();
		$("#aOZivotR").fadeIn(); 
	});
	$("#pOZivot").click(function() {
		clearAll();
		projectDetail();
		$("#OZivot").fadeIn(); 
		$("#aDrDL").fadeIn();
		$("#aGameconR").fadeIn(); 
	});
	$("#pGamecon").click(function() {
		clearAll();
		projectDetail();
		$("#Gamecon").fadeIn(); 
		$("#aOZivotL").fadeIn();
		$("#aOldTalksR").fadeIn(); 
	});
	$("#pOldTalks").click(function() {
		clearAll();
		projectDetail();
		$("#OldTalks").fadeIn(); 
		$("#aGameconL").fadeIn();
	});
	
// NAHLEDY	
	$("#tStrepy, #aStrepy").click(function() {
		hideContent();
		$("#Strepy").fadeIn(); 
		$("#aMafiaR").fadeIn();
	});
	$("#tMafia, #aMafiaR, #aMafiaL").click(function() {
		hideContent();
		$("#Mafia").fadeIn(); 
		$("#aStrepy").fadeIn();
		$("#aBestiarR").fadeIn();
	});
	$("#tBestiar, #aBestiarR,#aBestiarL").click(function() {
		hideContent();
		$("#Bestiar").fadeIn(); 
		$("#aMafiaL").fadeIn();
		$("#aJoes_AdventuresR").fadeIn();
	});
	$("#tJoes_Adventures, #aJoes_AdventuresR,#aJoes_AdventuresL").click(function() {
		hideContent();
		$("#Joes_Adventures").fadeIn(); 
		$("#aBestiarL").fadeIn();
		$("#aKreativitaR").fadeIn();
	});
	$("#tKreativita, #aKreativitaR,#aKreativitaL").click(function() {
		hideContent();
		$("#Kreativita").fadeIn(); 
		$("#aJoes_AdventuresL").fadeIn();
		$("#aDrDR").fadeIn();
	});
	$("#tDrD, #aDrDR,#aDrDL").click(function() {
		hideContent();
		$("#DrD").fadeIn(); 
		$("#aKreativitaL").fadeIn();
		$("#aOZivotR").fadeIn(); 
	});
	$("#tOZivot, #aOZivotR,#aOZivotL").click(function() {
		hideContent();
		$("#OZivot").fadeIn(); 
		$("#aDrDL").fadeIn();
		$("#aGameconR").fadeIn(); 
	});
	$("#tGamecon, #aGameconR,#aGameconL").click(function() {
		hideContent();
		$("#Gamecon").fadeIn(); 
		$("#aOZivotL").fadeIn();
		$("#aOldTalksR").fadeIn(); 
	});
	$("#tOldTalks, #aOldTalksR").click(function() {
		hideContent();
		$("#OldTalks").fadeIn(); 
		$("#aGameconL").fadeIn();
	});
	
	
	
// PHOTOGALLERY
	$("#t1, #a1L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo1").fadeIn();
		$("#a2R").fadeIn(); 
	});
	$("#t2, #a2R,#a2L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo2").fadeIn();
		$("#a1L").fadeIn();
		$("#a3R").fadeIn(); 
	});
	$("#t3, #a3R,#a3L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo3").fadeIn();
		$("#a2L").fadeIn();
		$("#a4R").fadeIn(); 
	});
	$("#t4, #a4R,#a4L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo4").fadeIn();
		$("#a3L").fadeIn();
		$("#a5R").fadeIn(); 
	});
	$("#t5, #a5R,#a5L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo5").fadeIn();
		$("#a4L").fadeIn();
		$("#a6R").fadeIn(); 
	});
	$("#t6, #a6R,#a6L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo6").fadeIn();
		$("#a5L").fadeIn();
		$("#a7R").fadeIn(); 
	});
	$("#t7, #a7R,#a7L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo7").fadeIn();
		$("#a6L").fadeIn();
		$("#a8R").fadeIn(); 
	});
	$("#t8, #a8R,#a8L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo8").fadeIn();
		$("#a7L").fadeIn();
		$("#a9R").fadeIn(); 
	});
	$("#t9, #a9R,#a9L").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo9").fadeIn();
		$("#a8L").fadeIn();
		$("#a10R").fadeIn(); 
	});
	$("#a9L, #G1_left").click(function() {
		hidegalleryContent();
		showMini1();
		$("#photo9").fadeIn();
		$("#a8L").fadeIn();
		$("#a10R").fadeIn(); 
	});
	$("#t10, #a10R,#a10L, #G2_right").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo10").fadeIn();
		$("#a9L").fadeIn();
		$("#a11R").fadeIn(); 
	});

	$("#t11, #a11R,#a11L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo11").fadeIn();
		$("#a10L").fadeIn();
		$("#a12R").fadeIn(); 
	});
	$("#t12, #a12R,#a12L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo12").fadeIn();
		$("#a11L").fadeIn();
		$("#a13R").fadeIn(); 
	});
	$("#t13, #a13R,#a13L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo13").fadeIn();
		$("#a12L").fadeIn();
		$("#a14R").fadeIn(); 
	});
	$("#t14, #a14R,#a14L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo14").fadeIn();
		$("#a13L").fadeIn();
		$("#a15R").fadeIn(); 
	});
	$("#t15, #a15R,#a15L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo15").fadeIn();
		$("#a14L").fadeIn();
		$("#a16R").fadeIn(); 
	});
	$("#t16, #a16R,#a16L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo16").fadeIn();
		$("#a15L").fadeIn();
		$("#a17R").fadeIn(); 
	});
	
	$("#t17, #a17R,#a17L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo17").fadeIn();
		$("#a16L").fadeIn();
		$("#a18R").fadeIn(); 
	});
	$("#t18, #a18R,#a18L").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo18").fadeIn();
		$("#a17L").fadeIn();
		$("#a19R").fadeIn(); 
	});
	$("#a18L,#G2_left").click(function() {
		hidegalleryContent();
		showMini2();
		$("#photo18").fadeIn();
		$("#a17L").fadeIn();
		$("#a19R").fadeIn(); 
	});
	$("#t19, #a19R, #a19L, #G3_right").click(function() {
		hidegalleryContent();
		showMini3();
		$("#photo19").fadeIn();
		$("#a18L").fadeIn();
		$("#a20R").fadeIn(); 
	});
	$("#t20, #a20R, #a20L").click(function() {
		hidegalleryContent();
		showMini3();
		$("#photo20").fadeIn();
		$("#a19L").fadeIn();
		$("#a21R").fadeIn(); 
	});
	$("#t21, #a21R, #a21L").click(function() {
		hidegalleryContent();
		showMini3();
		$("#photo21").fadeIn();
		$("#a20L").fadeIn();
		$("#a22R").fadeIn(); 
	});
	$("#t22, #a22R, #a22L").click(function() {
		hidegalleryContent();
		showMini3();
		$("#photo22").fadeIn();
		$("#a21L").fadeIn();
		$("#a23R").fadeIn(); 
	});
	$("#t23, #a23R, #a23L").click(function() {
		hidegalleryContent();
		showMini3();
		$("#photo23").fadeIn();
		$("#a22L").fadeIn();
		$("#a24R").fadeIn(); 
	});

	$("#t24, #a24R").click(function() {
		hidegalleryContent();
		showMini3();
		$("#photo24").fadeIn();
		$("#a23L").fadeIn();
	});

	
});

function hideContent() {
	$(".content").hide();
	$(".arrows").hide();
	$("#emptyarrow").show();
	$("#pad").show();

}
function hidegalleryContent() {
	$(".content_g").hide();
	$(".arrows").hide();
	$(".mini").hide();

}

function showMini1(){
 	$("#emptyarrow2").show();
	$("#pad2").show();
	$("#G2_right").show();
	$("#minigallery1").show();
}
function showMini2(){
 	$("#G1_left").show();
	$("#pad2").show();
	$("#G3_right").show();
	$("#minigallery2").show();
}
function showMini3(){
 	$("#pad2").show();
	$("#G2_left").show();
	$("#minigallery3").show();
}


function clearAll() {
	$(".content").hide();
	$(".project").hide();
	$(".mini").hide();
	$(".content_g").hide();
	$(".arrows").hide();
	$("#frame").hide();
	$(".arrows").hide();

}

function projectDetail() {
	$("#screen").height(650); //Tohle pak vyprat do funkce
	$("#frame").fadeIn(800); //Tohle pak vyprat do funkce
	$("#miniprojects").fadeIn(800); //Tohle pak vyprat do funkce
	$("#emptyarrow").show();
	$("#pad").show();
}
