Window.onDomReady(function()
{
	function showSection(id)
	{
		var section = $("section_" + id);
		var link = $("section_link_" + id);
		
		if(section)
		{
			$$(".section_link").each(function(link)
			{
				link.removeClass("current");
			});
			
			$$(".section_block").each(function(section)
			{
				section.style.display = "none";
			});
			
			section.style.display = "block";
			link.addClass("current");
		}
	}

	var first = null;
	$$("a.section_link").each(function(link)
	{ 
		var id = link.href.match(/^.*#section_(.*)$/);
		id = id ? id[1] : null;
		if(id)
		{
			first = first || id;
		}
		
		link.onclick = function()
		{
			showSection(id);
			window.location = "#wrapper";
			return false;
		};
	});
	
	if(first)
	{
		showSection(first);
	}
});
