function hideLayer(objectId) 
{
	var obj = document.getElementById(objectId);
	obj.style.visibility = 'hidden';
}

function showLayer(objectId)
{
	var obj = document.getElementById(objectId);
	obj.style.visibility = 'visible';
}

function showHideLayer(objectId)
{
	var obj = document.getElementById(objectId);
	var visibility = obj.style.visibility;
	if(visibility == 'hidden')
	{
		obj.style.visibility = 'visible';
	}
	else
	{
		obj.style.visibility = 'hidden';
	}
}

function expandCollapseLayer(objectId)
{
	var obj = document.getElementById(objectId);
	var display = obj.style.display;
	if(display == 'none')
	{
		obj.style.display = 'block';
	}
	else
	{
		obj.style.display = 'none';
	}
}


function showLayer(objectId) 
{
	var obj = document.getElementById(objectId);
	obj.style.visibility = 'visible';
}

function centerObject(objectId)
{
	var obj = document.getElementById(objectId);
	var livePageHeight = findLivePageHeight();
    var livePageWidth = findLivePageWidth();
    var left = livePageWidth/2 - findWidth(objectId)/2;
    var top = livePageHeight/2 - findHeight(objectId)/2;
    obj.style.left = left + 'px';
    obj.style.top = top + 'px';
}

function findWidth(objectID) 
{
	var object = document.getElementById(objectID);
    if (object.offsetWidth) 
    	return object.offsetWidth;
	return (null);
}

function findHeight(objectID) 
{
	var object = document.getElementById(objectID);
    if (object.offsetHeight) 
		return object.offsetHeight;
	return (null);
}


function findLivePageHeight() 
{
	if (window.innerHeight) 
		return window.innerHeight;
    if (document.body.clientHeight) 
    	return document.body.clientHeight;
    return (null);
}

function findLivePageWidth() 
{
	if (window.innerWidth)
    	return window.innerWidth;
	if (document.body.clientWidth)
		return document.body.clientWidth;
	return (null);
}
