var poppedOut = false;
var currentPopper = null;

$(document).ready(function() {

	$(".bioPicLink").hoverIntent(function() {
	
		var bioContent = $(this).parent(".bioPic").children(".bioContent").html();
		if (bioContent == null)
			bioContent = "";
		
		if (bioContent != "" && bioContent != null)
		{
			$(".bioPopper .popperHead .popperContent").html(bioContent);
			if ($.browser.msie != true) {
				$(".bioPopper").fadeIn();
			} else {
				$(".bioPopper").css("display", "block");
			}		
		
		
			currentPopper = $(this);
			poppedOut = true;
		}
		
	}, function() {
	
		hidePopper();
	
	});



	

	$(".bioPicLink img").hover(function() {
		
		var currentImage = $(this).attr("src");
		$(this).attr("src", $(this).attr("hover"));
		$(this).attr("hover", currentImage);
		
	}, function() {
	
		var currentImage = $(this).attr("src");
		$(this).attr("src", $(this).attr("hover"));
		$(this).attr("hover", currentImage);
	
	});






	$(".projectLink").hoverIntent(function() {
	
		var projectID = "#" + $(this).attr("rel");
		$(".projectsHover").hide();		
		$(projectID).fadeIn();
		
	}, function() {
	
		var projectID = "#" + $(this).attr("rel");
		$(projectID).hide();	
		
	});






});

function hidePopper() {
	if (poppedOut)
	{
		if ($.browser.msie != true) {
			$(".bioPopper").fadeOut("normal");
		} else {
			$(".bioPopper").css("display", "none");
		}
		currentPopper = null;
		poppedOut = false;
	}
}

