mouseOvered = false;

function rePlacePopup(popup)
{
	offsetFromTop = 125;
	
	servicesLeftOffset = 330;
	
	if(popup == 'servicesPopup')
	{
		// Calculate the necessary offset from the left side
		bodyWidth = document.body.clientWidth;
		containerWidth = document.getElementById('mainContainer').clientWidth;
		
		if(bodyWidth < containerWidth)
		{
			bottomLeftCornerX = 0;
		}
		else
		{
			bottomLeftCornerX = ((bodyWidth - containerWidth) / 2) - 4;
		}
		
		if((bottomLeftCornerX % 2) != 0)
		{
			bottomLeftCornerX += 1;
		}
		
		bottomLeftCornerX += servicesLeftOffset;
		
		document.getElementById(popup).style.left = bottomLeftCornerX + 'px';
		
		// Calculate the necessary offset from the bottom
		containerHeight = document.getElementById('mainContainer').clientHeight;
		
		bottomLeftCornerY = containerHeight - offsetFromTop;
		
		document.getElementById(popup).style.bottom = bottomLeftCornerY + 'px';
	}
}

function hideMenuOrKeepDisplayed(popup)
{
	if(mouseOvered)
	{
	}
	else
	{
		document.getElementById(popup).style.visibility = 'hidden';
	}
}