jQuery.fn.closeAll = function(settings) {
//This sets the size of Project#1
		jQuery("div#project1 div.description").hide(1, function() {
			jQuery(this).parents("div#project1").animate({
				width: "50px",
				height: "50px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});
		
//This sets the size of Project#2
		jQuery("div#project2 div.description").hide(1, function() {
			jQuery(this).parents("div#project2").animate({
				width: "150px",
				height: "70px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});
		
//This sets the size of Project#3
		jQuery("div#project3 div.slider-wrap").hide(1, function() {
			jQuery(this).parents("div#project3").animate({
				//backgroundColor: "#0090C6",
				width: "70px",
				height: "100px",
				bottom: "90px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});

//This sets the size of Project#4
		//jQuery("div#project4 div.slider-wrap").hide(1, function() {
			jQuery("div#project4 div.slider-wrap").css("opacity", "0");
			jQuery("div#project4 div.stripNav").fadeOut();
			jQuery("div#project4").animate({
				//backgroundColor: "#0090C6",
				width: "200px",
				height: "60px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				//});
		});
		
//This sets the size of Project#5
		jQuery("div#project5 div.description").hide(1, function() {
			jQuery(this).parents("div#project5").animate({
				width: "150px",
				height: "90px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});
//This sets the size of Project#6
		//this will need to change very soon!
		jQuery("div#project6 div.slider-wrap").hide(1, function() {
			jQuery(this).parents("div#project6").animate({
				width: "120px",
				height: "80px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});

//This sets the size of Project#7
		jQuery("div#project7 div.stripViewer").hide(1, function() {
			jQuery(this).parents("div#project7").animate({
				//backgroundColor: "#0090C6",
				width: "70px",
				height: "70px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});

//This sets the size of Project#8
		jQuery("div#project8 div.description").hide(1, function() {
			jQuery(this).parents("div#project8").animate({
				width: "90px",
				height: "90px"
			}, 1, function() {
				jQuery(this).addClass("closed");
				});
		});	
};


jQuery.fn.openClose = function(settings) {
		/////////////////////
		 //Project 1 open and close
		 /////////////////////
		 jQuery("div#project1 h2").click(function () {
			if ( (jQuery("div#project1").hasClass("closed")) && (jQuery("div#project2").hasClass("open")) ) {
				jQuery("div.description", "div#project2").fadeOut(750, function() {
					jQuery("div#project1").animate({right: "-=120"}, 750);
					jQuery(this).parents("div#project2").animate({ width: "150px", height:"70px" }, 750, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery("div#project1 h2").openBox1();
					});
				});
			}
			
			if ( jQuery("div#project1").hasClass("open") ) {
				jQuery(this).closeBox1();
			}
			
			if ( (jQuery("div#project1").hasClass("closed")) && (jQuery("div#project2").hasClass("closed")) ) {
				jQuery(this).openBox1();
			}
		 });
		 
		 /////////////////////
		 //Project 2 open and close
		 /////////////////////
		 jQuery("div#project2 h2").click(function () {
			if ( (jQuery("div#project2").hasClass("closed")) && (jQuery("div#project1").hasClass("open")) ) {
				jQuery("div.description", "div#project1").fadeOut(500, function() {
					jQuery("div#project1").animate({ width: "50px", height:"50px" }, 500, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery(this).openBox2();
					});
				});
			}
			
			if ( jQuery("div#project2").hasClass("open") ) {
					jQuery(this).closeBox2();
			}
			
			if ( (jQuery("div#project2").hasClass("closed")) && (jQuery("div#project1").hasClass("closed")) ) {
				jQuery(this).openBox2();
			}
		 });
		
		/////////////////////
		 //Project 3 open and close
		 /////////////////////
		 jQuery("div#project3 h2").click(function () {
			if ( (jQuery("div#project3").hasClass("closed")) && (jQuery("div#project4").hasClass("open")) ) {
				jQuery("div.slider-wrap", "div#project4").animate({ opacity: "0" }, 500, function() {
					jQuery("div#project3").animate({bottom: "-=170"}, 500);
					jQuery(this).parents("div#project4").animate({ width: "200px", height:"60px" }, 500, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery("div#project4 div.stripNav").fadeOut();
						jQuery("div#project3 h2").openBox3();
					});
				});
			}
			
			if ( jQuery("div#project3").hasClass("open") ) {
				jQuery(this).closeBox3();
			}
			
			if ( (jQuery("div#project3").hasClass("closed")) && (jQuery("div#project4").hasClass("closed")) ) {
				jQuery(this).openBox3();		
			}
		 });
		
		/////////////////////
		 //Project 4 open and close
		 /////////////////////
		 jQuery("div#project4 h2").click(function () {
			if ( (jQuery("div#project4").hasClass("closed")) && (jQuery("div#project3").hasClass("open")) ) {
				jQuery("div.slider-wrap", "div#project3").fadeOut(500, function() {
					jQuery(this).parents("div#project3").animate({ width: "70px", height:"100px" }, 500, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery(this).openBox4();
					});
				});
			}
			
			if ( jQuery("div#project4").hasClass("open") ) {
				jQuery(this).closeBox4();
			}
			
			if ( (jQuery("div#project4").hasClass("closed")) && (jQuery("div#project3").hasClass("closed")) ) {
				jQuery(this).openBox4();
			}
		 });
		
		/////////////////////
		 //Project 5 open and close
		 /////////////////////
		 jQuery("div#project5 h2").click(function () {
			if ( (jQuery("div#project5").hasClass("closed")) && (jQuery("div#project6").hasClass("open")) ) {
				jQuery("div.slider-wrap", "div#project6").fadeOut(500, function() {
					jQuery("div#project6").animate({ width: "120px", height:"80px" }, 500, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery(this).openBox5();
					});
				});
			}
			
			if ( jQuery("div#project5").hasClass("open") ) {
				jQuery(this).closeBox5();
			}
			
			if ( (jQuery("div#project5").hasClass("closed")) && (jQuery("div#project6").hasClass("closed")) ) {
				jQuery(this).openBox5();
			}
		 });
		 
		 /////////////////////
		 //Project 6 open and close
		 /////////////////////
		 jQuery("div#project6 h2").click(function () {
			if ( (jQuery("div#project6").hasClass("closed")) && (jQuery("div#project5").hasClass("open")) ) {
				jQuery("div.description", "div#project5").fadeOut(500, function() {
					jQuery("div#project5").animate({ width: "150px", height:"90px" }, 500, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery(this).openBox6();
					});
				});
			}
			
			if ( jQuery("div#project6").hasClass("open") ) {
				jQuery(this).closeBox6();
			}
			
			if ( (jQuery("div#project6").hasClass("closed")) && (jQuery("div#project5").hasClass("closed")) ) {
				jQuery(this).openBox6();
			}
		 });
		
		/////////////////////
		//Project 7 open and close
		/////////////////////
		jQuery("div#project7 h2").click(function () {
			if ( (jQuery("div#project7").hasClass("closed")) && (jQuery("div#project8").hasClass("open")) ) {
				jQuery("div.description", "div#project8").fadeOut(500, function() {
					jQuery(this).parents("div#project8").animate({ width: "90px", height:"90px" }, 500, function() {	
						jQuery(this).removeClass("open");
						jQuery(this).addClass("closed");
						jQuery(this).openBox7();
					});
				});
			}
			
			if ( jQuery("div#project7").hasClass("open") ) {
				jQuery(this).closeBox7();
			}
			
			if ( (jQuery("div#project7").hasClass("closed")) && (jQuery("div#project8").hasClass("closed")) ) {
					jQuery(this).openBox7();
			}
		 });
		 
		 
		 /////////////////////
		 //Project 8 open and close
		 /////////////////////
		 jQuery("div#project8 h2").click(function () {
			if ( jQuery("div#project8").hasClass("closed") && (jQuery("div#project7").hasClass("open")) ) {
				jQuery("div#project7").animate({ width: "70px", height:"70px" }, 500, function() {	
					jQuery(this).removeClass("open");
					jQuery(this).addClass("closed");
					jQuery("div.stripViewer", this).hide(1, function() {
						jQuery("div#project8 h2").openBox8();
					});
				});
			}
			
			if ( jQuery("div#project8").hasClass("open") ) {
					jQuery(this).closeBox8();
			}
			
			if ( jQuery("div#project8").hasClass("closed") && (jQuery("div#project7").hasClass("closed")) ) {
				jQuery(this).openBox8();
			}
		 });

};

//Box 1 Functions
jQuery.fn.openBox1 = function() {
	jQuery(this).parents("div#project1").animate({ width: "150px", height:"150px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.description", "div#project1").fadeIn(1000);
	});
};

jQuery.fn.closeBox1 = function() {
	jQuery("div.description", "div#project1").fadeOut(500, function() {
		jQuery("div#project1").animate({ width: "50px", height:"50px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
		});
	});
};

//Box 2 Functions
jQuery.fn.openBox2 = function() {
	jQuery("div#project1").animate({right: "+=120"}, 1000);
	jQuery("div#project2").animate({ width: "270px", height:"130px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.description", "div#project2").fadeIn(1000);
	});
};

jQuery.fn.closeBox2 = function() {
	jQuery("div.description", "div#project2").fadeOut(500, function() {
		jQuery("div#project1").animate({right: "-=120"}, 500);
		jQuery("div#project2").animate({ width: "150px", height:"70px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
		});
	});
};

//Box 3 Functions
jQuery.fn.closeBox3 = function() {
	jQuery("div.slider-wrap", "div#project3").fadeOut(500, function() {
		jQuery(this).parents("div#project3").animate({ width: "70px", height:"100px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
		});
	});
};

jQuery.fn.openBox3 = function() {
	jQuery(this).parents("div#project3").animate({ width: "360px", height:"220px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.slider-wrap", "div#project3").fadeIn(1000);
	});
};

//Box 4 Functions
jQuery.fn.closeBox4 = function() {
	jQuery("div.slider-wrap", "div#project4").animate({ opacity: "0" }, 500, function() {
		jQuery("div#project3").animate({bottom: "-=170", width: "70px", height: "100px" }, 500);
		jQuery(this).parents("div#project4").animate({ width: "200px", height:"60px" }, 500, function() {	
				jQuery(this).removeClass("open");
				jQuery(this).addClass("closed");
				jQuery("div#project4 div.stripNav").fadeOut();
		});
	});
};

jQuery.fn.openBox4 = function() {
	jQuery("div#project3").animate({bottom: "+=170", width: "100px", height: "50px" }, 1000);
	jQuery("div#project4").animate({ width: "420px", height:"230px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.slider-wrap", "div#project4").animate({ opacity: "1" }, 1000);
		jQuery("div#project4 div.stripNav").fadeIn(1000);
	});
};

//box5 functions
jQuery.fn.openBox5 = function() {
	jQuery("div#project5").animate({ width: "360px", height:"230px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.description", "div#project5").fadeIn(1000);
	});
};

jQuery.fn.closeBox5 = function() {
	jQuery("div.description", "div#project5").fadeOut(500, function() {
		jQuery("div#project5").animate({ width: "150px", height:"90px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
		});
	});
};

//box6 functions
jQuery.fn.openBox6 = function() {
	jQuery("div#project6").animate({ width: "315px", height:"227px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.slider-wrap", "div#project6").fadeIn(1000);
	});
};

jQuery.fn.closeBox6 = function() {
	jQuery("div.slider-wrap", "div#project6").fadeOut(500, function() {
		jQuery(this).parents("div#project6").animate({ width: "120px", height:"80px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
		});
	});
};

//box7 functions
jQuery.fn.openBox7 = function(callback) {
	jQuery("div.stripViewer","div#project7").show(1);
	jQuery("div#project7").animate({ width: "270px", height:"270px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
	});
};

jQuery.fn.closeBox7 = function(callback) {
	jQuery(this).parents("div#project7").animate({ width: "70px", height:"70px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
			jQuery("div.stripViewer", this).hide(1);
	});
};

jQuery.fn.openBox8 = function(callback) {
	jQuery("div#project8").animate({ width: "190px", height:"190px" }, 1000, function() {
		jQuery(this).removeClass("closed");
		jQuery(this).addClass("open");
		jQuery("div.description", "div#project8").fadeIn(1000);
		
	});
};

jQuery.fn.closeBox8 = function() {
	jQuery("div.description", "div#project8").fadeOut(500, function() {
		jQuery(this).parents("div#project8").animate({ width: "90px", height:"90px" }, 500, function() {	
			jQuery(this).removeClass("open");
			jQuery(this).addClass("closed");
		});
	});
};
