//Anonymous function that is applied to all internal-links
var jump=function(e)
{
	//prevent the "normal" behaviour which would be a "hard" jump
	e.preventDefault();

	var target = $(this).attr("href");
	var targetScroll = target.split('#')[1] + "-content-scroll";
	
	$("#container").find(".content-box-left:visible").animate({
	    opacity: '0'
	}, 200,
	function() {
		$(target).css('opacity', '0');
		$("#container").find(".content-box-left:visible").hide();

		//add the scroll bar style since there can only be one per page
		$(target).show();
		fleXenv.fleXcrollMain(targetScroll);
		
		$("#container").find(target).animate({
		    opacity: '100'
		}, 600);
	});
}

$(document).ready(function()
{
	$("a[href*=#]").bind("click", jump);
	$("#container").find(".content-box-left").hide();
	$("#home").show();
	$("#container").find(".content-box-left:not(:visible)").css("opacity", "0");
	return false;
});
