var center=(screen.availWidth/2)-225;
var tech1 = false;
var tech2 = false;
var tech3 = false;
var tech4 = false;
var tech5 = false;
var tech6 = false;

$(document).ready(function(){
	$("#tech1").load("./tech/heat.html", "", function(){
		tech1 = true;
	});
	$("#tech2").load("./tech/friction.html", "", function(){
		tech2 = true;
	});
	$("#tech3").load("./tech/advanced.html", "", function(){
		tech3 = true;
	});
	$("#tech4").load("./tech/manufacturing.html", "", function(){
		tech4 = true;
	});
	$("#tech5").load("./tech/fiber.html", "", function(){
		tech5 = true;
	});
	$("#tech6").load("./tech/carbon.html", "", function(){
		tech6 = true;
	});
	$("#tech1").css({left: center+"px"});
	$("#tech2").css({left: center+"px"});
	$("#tech3").css({left: center+"px"});
	$("#tech4").css({left: center+"px"});
	$("#tech5").css({left: center+"px"});
	$("#tech6").css({left: center+"px"});
	$("#tech1").click(function() {
		$("#tech1").animate({opacity: "hide"}, "fast");
	});
	$("#tech2").click(function() {
		$("#tech2").animate({opacity: "hide"}, "fast");
	});
	$("#tech3").click(function() {
		$("#tech3").animate({opacity: "hide"}, "fast");
	});
	$("#tech4").click(function() {
		$("#tech4").animate({opacity: "hide"}, "fast");
	});
	$("#tech5").click(function() {
		$("#tech5").animate({opacity: "hide"}, "fast");
	});
	$("#tech6").click(function() {
		$("#tech6").animate({opacity: "hide"}, "fast");
	});
	$("#link_1").click(function() {
		if(tech1==true){
			$("#tech2").animate({opacity: "hide"}, "fast");
			$("#tech3").animate({opacity: "hide"}, "fast");
			$("#tech4").animate({opacity: "hide"}, "fast");
			$("#tech5").animate({opacity: "hide"}, "fast");
			$("#tech6").animate({opacity: "hide"}, "fast");
			$("#tech1").animate({opacity: "show"}, "slow");
		}
	});
	$("#link_2").click(function() {
		if(tech2==true){
			$("#tech1").animate({opacity: "hide"}, "fast");
			$("#tech3").animate({opacity: "hide"}, "fast");
			$("#tech4").animate({opacity: "hide"}, "fast");
			$("#tech5").animate({opacity: "hide"}, "fast");
			$("#tech6").animate({opacity: "hide"}, "fast");
			$("#tech2").animate({opacity: "show"}, "slow");
		}
	});
	$("#link_3").click(function() {
		if(tech3==true){
			$("#tech1").animate({opacity: "hide"}, "fast");
			$("#tech2").animate({opacity: "hide"}, "fast");
			$("#tech4").animate({opacity: "hide"}, "fast");
			$("#tech5").animate({opacity: "hide"}, "fast");
			$("#tech6").animate({opacity: "hide"}, "fast");
			$("#tech3").animate({opacity: "show"}, "slow");
		}
	});
	$("#link_4").click(function() {
		if(tech4==true){
			$("#tech1").animate({opacity: "hide"}, "fast");
			$("#tech2").animate({opacity: "hide"}, "fast");
			$("#tech3").animate({opacity: "hide"}, "fast");
			$("#tech5").animate({opacity: "hide"}, "fast");
			$("#tech6").animate({opacity: "hide"}, "fast");
			$("#tech4").animate({opacity: "show"}, "slow");
		}
	});
	$("#link_5").click(function() {
		if(tech5==true){
			$("#tech1").animate({opacity: "hide"}, "fast");
			$("#tech2").animate({opacity: "hide"}, "fast");
			$("#tech3").animate({opacity: "hide"}, "fast");
			$("#tech4").animate({opacity: "hide"}, "fast");
			$("#tech6").animate({opacity: "hide"}, "fast");
			$("#tech5").animate({opacity: "show"}, "slow");
		}
	});
	$("#link_6").click(function() {
		if(tech6==true){
			$("#tech1").animate({opacity: "hide"}, "fast");
			$("#tech2").animate({opacity: "hide"}, "fast");
			$("#tech3").animate({opacity: "hide"}, "fast");
			$("#tech4").animate({opacity: "hide"}, "fast");
			$("#tech5").animate({opacity: "hide"}, "fast");
			$("#tech6").animate({opacity: "show"}, "slow");
		}
	});
});