/**
 * Slide Box : a jQuery Plug-in
 * Samuel Garneau <samgarneau@gmail.com>
 * http://samgarneau.com
 * 
 * Released under no license, just use it where you want and when you want.
 */

$(function() {
		// Buttons action
		$("#b1").click(function(){

			// close Tab2 and Tab3 first, then open Tab1 w/ callback
			
			$(".content2").animate({height: "0"}, 1000);
			$(".content3").animate({height: "0"}, 1000,	
								   
				function(){ //callback to open Tab2
					$(".slide-panel1").css("z-index", 3000);
					$(".slide-panel2").css("z-index", 4000);
					$(".slide-panel3").css("z-index", 5000);
			
					$(".content1").animate({height: "210px"}, 1000);
				}
			);
		});
});

/*************** box 2 **************/
$(function() {		
		// Buttons action
		$("#b2").click(function(){

			$(".content1").animate({height: "0"}, 1000);
			$(".content3").animate({height: "0"}, 1000,
								   
				function(){
					$(".slide-panel1").css("z-index", 4000);
					$(".slide-panel2").css("z-index", 3000);
					$(".slide-panel3").css("z-index", 5000);
			
					$(".content2").animate({height: "210px"}, 1000);
				}
			);		
		});
});
/*************** box 3 **************/	
$(function() {		
		// Buttons action
		$("#b3").click(function(){
			
			$(".content2").animate({height:"0"}, 1000);
			$(".content1").animate({height:"0"}, 1000,
								   
				function(){
					$(".slide-panel2").css("z-index", 4000);
					$(".slide-panel1").css("z-index", 5000);
					$(".slide-panel3").css("z-index", 3000);
					
					$(".content3").animate({height: "210px"}, 1000);
				}
			);		
		});
});		