$(document).ready(function(){
	$('#fig1').click(function() {
	});
	
	$('#fig1-bubble').click(function(){
		$('#fig1-bubble').animate({
			left: '+1000px',
			opacity: '0',
			queue: true
		  }, "fast", function() {
			$("#fig1-bubble").css("display","none");
			$("#fig1-bubble").css("left","-1000px");

		  });

	});

	
	$("#fig1-a").hover(function(){
			  $(this).css("z-index","100");
			  $("#fig1-a div").css("display","block");
			  $('#fig1-a div').animate({
				left: '-190px',
				opacity: '1',
				queue:true
			  }, "fast", function() {
			  });
	},
	function(){
		$('#fig1-a div').animate({
			left: '-400px',
			opacity: '0',
			queue: true
		  }, "fast", function() {
			$("#fig1-a div").css("display","none");
			$("#fig1-a div").css("left","-1000px");
		  });

	});

	$("#fig1-b").hover(function(){
		  $(this).css("z-index","100");
		  $("#fig1-b div").css("display","block");
		  $('#fig1-b div').animate({
			left: '40px',
			opacity: '1',
			queue:true
		  }, "fast", function() {
		  });
	},
	function(){
		$('#fig1-b div').animate({
			left: '3000px',
			opacity: '0',
			queue: true
		  }, "fast", function() {
			$("#fig1-b div").css("display","none");
			$("#fig1-b div").css("left","+3000px");
		  });
	});


	$("#fig2").hover(function(){
		$(this).css("z-index","100");
		$("#fig2 img").animate({marginLeft:"20px",marginTop:"130px"},"fast",function(){
			$("#fig2-bubble").css("display","block");
			$('#fig2-bubble').animate({
				left: '0px',
				opacity: '1',
				queue:true
			  }, "fast", function() {
				// Animation complete.
			  });

		});
	},
	function(){
		$(this).css("z-index","5");
		$("#fig2 img").animate({marginLeft:"110px",marginTop:"100px"},"fast",function(){
			$('#fig2-bubble').animate({
				left: '-1000px',
				opacity: '0',
				queue:true
			  }, "fast", function() {
				$("#fig2-bubble").css("display","block");
				$("#fig2-bubble").css("left","1000px");
			  });

		
		});
	});
	
	$("#fig3").hover(function(){
		$(this).css("z-index","100");
		$("#fig3").animate({marginLeft:"320px",marginTop:"10px"},"fast",function(){
			$("#fig3 a").css("display","block");
			$('#fig3 a').animate({
				left: '-150px',
				opacity: '1',
				queue:true
			  }, "fast", function() {
				// Animation complete.
			  });

		});
	},
	function(){
		$(this).css("z-index","5");
		$("#fig3").animate({marginLeft:"350px",marginTop:"0px"},"fast",function(){
			$('#fig3 a').animate({
				left: '1000px',
				opacity: '0',
				queue:true
			  }, "fast", function() {
			  });

		
		});
	});
	
});

