$(document).ready(function() {
	
	$(".portfolio").mouseover(function() {
		$(this).fadeTo("fast", 1, function() {
			$(this).children(".portf_title").animate({height: 23}, "fast");
		});
		$(this).clearQueue();
		$(this).children(".portf_title").clearQueue();
	});
	
	$(".portfolio").mouseout(function() {
		$(this).children(".portf_title").animate({height: 0}, "fast");
		$(this).fadeTo("fast", .33);
		$(this).clearQueue();
	});
	
	
	
});

// this is the part where I am about to build the lightbox mode, dynamic practicing

/*

	I need to:
		- rip the path called in the rel attribute
		- catch the image, and do some math:
			- calculate width
			- calculate height
			- use those for width and height of the box and to center the box (tricky)
			

*/

$(document).ready(function() {
	
	// static jquery code
	
	$(".portfolio").click(function() {
	
		var getRelAttr = $(this).children("img").attr("rel");
		var getAltAttr = $(this).children("img").attr("alt");
		var getHrfAttr = $(this).children("img").attr("title");
		
		if($(this).children("img").hasClass("interaction")) {
			$("#interaction_bt").css("visibility", "visible");
			$("#pr_link").attr("href", getHrfAttr);
			$("#interaction_bt").css("width", 100);
		} else {
			$("#interaction_bt").css("visibility", "hidden");
			$("#interaction_bt").css("width", 0);
		}
	
		$("#vb_overlay").css("visibility", "visible");
		$("#vb_overlay").fadeTo("fast", 1, function() {
			$("#vb_description").fadeTo("fast", 0);
			$("#vb_image").fadeTo("fast", 0, function() {
				$("#vb_image").attr("src", "img/load.gif");
				$("#vb_image").load(getRelAttr, function() {
					$("#vb_image").attr("src", getRelAttr);
					$("#vb_image").fadeTo("fast", 1, function() {
						$("#vb_overlay > #vb_description").text(getAltAttr);
						$("#vb_overlay > #vb_description").fadeTo("fast", 1);
					});
				});
			});
		});
	});
	
	$("#close_overlay").click(function() {
		$("#vb_overlay").fadeTo("fast", 0, function() {
			$("#vb_overlay").css("visibility", "hidden");
			$("vb_image").attr("src", "img/load.gif");
			$("vb_image").fadeTo("fast", 0);
		});
	});
	
});

/* DYNAMIC SELECTION DRIVE STARTED AT THIS POINT, LOVE IT!!!!!!!! */
