// show full image in popup
function show_image(media_id, width, height)
{
	isMSIE = (navigator.appName == "Microsoft Internet Explorer");

	padding_top = 50;
	padding_left = 50;

	if (isMSIE)
	{
		width += 40;
		height += 30;
	}
	else
	{
		width += 20;
		height += 20;
	}

	if (width > screen.availWidth)
		width = screen.availWidth - padding_top;
	if (height > screen.availHeight)
		height = screen.availHeight - padding_left;
	window.open(window.document.getElementsByTagName('base')[0].href + "media_show/media_id/" + media_id, "uniBoxMediaShowImage", "width=" + width + ",height=" + height + ",left=" + padding_left + ",top=" + padding_top + ",dependent=yes,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
}

function switch_hidden()
{
    _menu = document.getElementById('hidden_menu');
    _swapper = document.getElementById('swapper');
    if (_menu.style.display == 'none')
    {
        _menu.style.display = 'inline';
        _swapper.style.color = '#FFCE00';
    }
    else
    {
        _menu.style.display = 'none';
        _swapper.style.color = '#FFFFFF';
    }
}

function external_links()
{
	if (!document.getElementsByTagName)
	 	return;
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++)
	{
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";
	}
}
