 var currentPost;

function breakPost()
{
	$(".sublink").unbind('mouseover').unbind('mouseout');
	$("farmLink").unbind('click');
	$("homeLink").unbind('click');
	$("shedLink").unbind('click');
	$("uncleLink").unbind('click');
}

function setupPost()
{
	currentPost = "";
	
	$("#blurbDiv").css("width","650px");
	$("#blurbDiv").css("top","30px");
	
	$('.sublink').hover(function() { //mouse in 
	      $(this).stop().animate({ paddingTop: '0px' }, 400); 
	   }, function() { //mouse out  
		   $(this).stop().animate({ paddingTop: '5px' }, 400); 
	   }); 
	
	$(this).oneTime(100, function() {
		$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration, postReady);
		$(".linksBanner").fadeIn(2000);
	});

	$("#farmLink").click(function() {
		if (currentPost=="farm")
			return;
		
		currentPost="farm";
		$("#blurbDiv").fadeOut(500);
		$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration, loadFarm);	
		$("#middleContentDiv").stop().animate({ height: '370px' }, 400);
		$("#contentDiv").stop().animate({ height: '810px' }, 400); 
	});

	$("#homeLink").click(function() {
		if (currentPost=="home")
			return;
		
		currentPost="home";
		$("#blurbDiv").fadeOut(500);
		$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration, loadHome);
		$("#middleContentDiv").stop().animate({ height: '380px' }, 400);
		$("#contentDiv").stop().animate({ height: '820px' }, 400); 
	});

	$("#shedLink").click(function() {
		if (currentPost=="shed")
			return;
		
		currentPost="shed";
		$("#blurbDiv").fadeOut(500);
		$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration, loadShed);
		$("#middleContentDiv").stop().animate({ height: '340px' }, 400);
		$("#contentDiv").stop().animate({ height: '780px' }, 400); 
	});

	$("#uncleLink").click(function() {
		if (currentPost=="uncle")
			return;
		
		currentPost="uncle";
		$("#blurbDiv").fadeOut(500);
		$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration, loadUncle);
		$("#middleContentDiv").stop().animate({ height: '415px' }, 400);
		$("#contentDiv").stop().animate({ height: '850px' }, 400); 
	});
}

function loadFarm()
{
	$("#imgLeft").attr("src","images/polaroids/POL_Farm.png");
	$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration);
	$("#blurbDiv").load("content/post_farm.html", farmLoaded);
	
}
function farmLoaded()
{
	$("#blurbDiv").fadeIn(500);
	$("#blurbDiv").columnize({width:150, height:300, buildOnce:true});
}

function loadHome()
{
	$("#imgLeft").attr("src","images/polaroids/POL_HOME.png");
	$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration);
	$("#blurbDiv").load("content/post_home.html", homeLoaded);
}
function homeLoaded()
{
	$("#blurbDiv").fadeIn(500);
	$("#blurbDiv").columnize({width:150, height:300, buildOnce:true});
}

function loadShed()
{
	$("#imgLeft").attr("src","images/polaroids/POL_Shed.png");
	$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration);
	$("#blurbDiv").load("content/post_shed.html", shedLoaded);
}
function shedLoaded()
{
	$("#blurbDiv").fadeIn(500);
	$("#blurbDiv").columnize({width:200, height:200, buildOnce:true});
	$(".column").css("padding-left", "50px");
}

function loadUncle()
{
	$("#imgLeft").attr("src","images/polaroids/POL_Uncle.png");
	$("#imgLeft").toggle(fx, {direction:animDirection, easing:'easeOutCirc'}, duration);
	$("#blurbDiv").load("content/post_uncle.html", uncleLoaded);
}
function uncleLoaded()
{
	$("#blurbDiv").fadeIn(500);
	$("#blurbDiv").columnize({width:150, height:330, buildOnce:true});
}

function postReady()
{
	$("#blurbDiv").fadeIn(500);
	$(".sepDiv01").fadeIn(500);
	$("#blurbDiv").columnize({width:150, height:250, buildOnce:true});
}