
function TamVentana() { 
  var Tamanyo = [0,0]; 
  if (typeof window.innerWidth != 'undefined')  { 
    Tamanyo = [window.innerWidth,window.innerHeight]; 
  } else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)   { 
	Tamanyo = [document.documentElement.clientWidth,document.documentElement.clientHeight]; 
  } else { 
    Tamanyo = [document.getElementsByTagName('body')[0].clientWidth,document.getElementsByTagName('body')[0].clientHeight]; 
  } 
  return Tamanyo; 
} 


function recalcularTamanoCapas(){
	var Tam = TamVentana(); 
	//alert(Tam[0]);
	tamano = (Tam[0]);
	if (tamano <0)
		tamano = 0;
	window.document.getElementById("capa"+antiguaCapa).style.left=(tamano/2)-360;
}


function cargarCapa(capa) {
	window.document.getElementById("capa"+antiguaCapa).style.display="none";
	window.document.getElementById("capa"+antiguaCapa).style.visibility="hidden";
	antiguaCapa = capa
	window.document.getElementById("capa"+capa).style.display="";
	window.document.getElementById("capa"+capa).style.visibility="visible";
	window.document.getElementById("capa"+capa).style.height="440px";
	recalcularTamanoCapas();
	window.document.getElementById("capa"+capa).style.width="610px";
	window.document.getElementById("capa"+capa).style.top="70px";
	window.document.getElementById("capa"+capa).style.position="absolute";
	window.document.getElementById("capa"+capa).style.overflow="auto";
}


