function Centralizar(obj)
{
	obj = document.getElementById(obj);
	
	wW = getWindowWidth();
	wH = getWindowHeight();
	
	clH = getHeight(obj);
	clW = getWidth(obj);
	
	obj.style.top = (wH/2) - (clH/2) + 'px';
	obj.style.left = (wW/2) - (clW/2) + 'px';
}

function ShowPopUp()
{
  document.getElementById('dv_popup').style.display = 'block';
  
  hiddenFlash();

  Centralizar('dv_popup');
}

function closePopUp()
{
	document.getElementById('dv_popup').style.display='none'
	showFlash();
}


function hiddenFlash()
{
  if(document.getElementsByTagName)
  {
    var objs = document.getElementsByTagName('object');
    for(x=0;x<objs.length;x++)
    {
      if(objs[x].id != 'swfpop')
      objs[x].style.visibility = 'hidden';
    }
  }
}

function showFlash()
{
  if(document.getElementsByTagName)
  {
    var objs = document.getElementsByTagName('object');
    for(x=0;x<objs.length;x++)
    {
      objs[x].style.visibility = 'visible';
    }
  }
}


function getHeight(obj)
{
	h = (obj.clientHeight || obj.offsetHeight);
	return h;
}

function getWidth(obj)
{
	w = (obj.clientWidth || obj.offsetWidth);
	return w;
}

/******  getWindowHeight and getWindowWidth is copy from http://quirksmode.org *******/
function getWindowHeight()
{
	if (self.innerHeight) 
	{
		// all except Explorer
		return  self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		// Explorer 6 Strict Mode
		return document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		// other Explorers
		return document.body.clientHeight;
	}
}

function getWindowWidth()
{
	if (self.innerWidth) 
	{
		// all except Explorer
		return  self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		// Explorer 6 Strict Mode
		return document.documentElement.clientWidth;
	}
	else if (document.body)
	{
		// Explorer 6 Strict Mode
		return document.body.clientWidth;
	}
}
/* ********************************************************************************** */