(function($){
	$(function(){
		$('#footertab').html($('#pagewrap').html());
		$('#pagewrap').html('');
		$('#footertab .links_container .links').find('a').eq(0).addClass("selected");
		$('#footertab .links_container .links').find('a').each(function(){
			$(this).click(function(){
				if($(this).hasClass("selected"))
					return false;
				var idx = $('#footertab .links_container .links a').index(this);
				$('#footertab').find('a.selected').removeClass("selected");
				$('#footertab .links_container .links').find('a').eq(idx).addClass("selected");
				$('#footertab .tab_container .tab').css("display", "none");
				$('#footertab .tab_container').find('.tab').eq(idx).css("display", "block");
			});
		});
		$('#footertab .tab_container .tab a.readmore').click(function(){
			$(this).parent().find('.remainder_of_long_version').css("display", "block");
			$(this).parent().find('a.collapse').css("display", "block");
			$(this).css("display", "none");

		});
		$('#footertab .tab_container .tab a.collapse').click(function(){
			$(this).parent().find('.remainder_of_long_version').css("display", "none");
			$(this).parent().find('a.readmore').css("display", "block");
			$(this).css("display", "none");
		});
	});
})(jQuery)
