function enlarge(id)
{
	var popup = document.getElementById(id);
	var fader = document.getElementById('fader');

	var selects = document.getElementsByTagName('select');
	for (var i=0;i<selects.length;i++)
	{
		selects[i].style.visibility = 'hidden';
	}

	fader.style.width = getDocumentWidth()+'px';
	fader.style.height = getDocumentHeight()+'px';
	
	popup.style.display = 'block';
	fader.style.display = 'block';
	centerPopup(popup);
	
	return false;
}

function hide(id)
{
	var selects = document.getElementsByTagName('select');
	for (var i=0;i<selects.length;i++)
	{
		selects[i].style.visibility = 'visible';
	}	
	
	var popup = document.getElementById(id);
	var fader = document.getElementById('fader');	
	
	popup.style.display = 'none';
	fader.style.display = 'none';
	
	return false;
}

function centerPopup(popup)
{
	popheight = popup.clientHeight;
	popwidth = popup.clientWidth;
	
	offset_left = (document.documentElement.scrollLeft + Math.floor((getWindowWidth() - popwidth) / 2));
	offset_top = (document.documentElement.scrollTop + Math.floor((getWindowHeight() - popheight) / 2));
	
	popup.style.top = ((popheight <= getWindowHeight()) ? ((offset_top != null && offset_top > 0) ? offset_top : '0') + 'px' : 0);
	popup.style.left = ((popwidth <= getWindowWidth()) ? ((offset_left != null && offset_left > 0) ? offset_left : '0') + 'px' : 0);
}

function getWindowWidth()
{
	return (self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 0);
}

function getWindowHeight()
{
	return (self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0);
}

function getDocumentWidth()
{
	return Math.max(document.body.scrollWidth, getWindowWidth());
}

function getDocumentHeight()
{
	return Math.max(document.body.scrollHeight, getWindowHeight());
}