var contentURL;

function loadContent(url)
{
	if (url != contentURL)
	{
		contentURL = url;
		
		new Ajax.Updater('content', url,
		{
			method: 'get',
			onSuccess: function()
			{
				if (navigator.userAgent.indexOf('Safari') != -1)
				{
					setTimeout('makeAbsoluteLinks()', 100);
				}
			}
		});
	}
}

function makeAbsoluteLinks()
{
	var links = $$('#content a');
	links.each(function(link)
	{
		var href = link.getAttribute('href');
		var anchor = href.indexOf('#');
		if (anchor != -1)
		{
			link.setAttribute('href', 'content/' + href.substring(anchor+1, href.length) + '.html');
		}
	});
}

function showscreen(n) {
	document.getElementById("screenshot-" + n).style.display = "block";
}

function hidescreen(n) {
	document.getElementById("screenshot-" + n).style.display = "none";
}

function showgallery(img) {
	document.getElementById("main-image").src = img;
}
