//Desarrollado por LABRYS TECHONOLOGIES
//www.labrys-tech.com
//info@labrys-tech.com

function creaIPop(urlpopup){
	//alert("DEntro de creacion");
	if (document.getElementById("iframePop")==null){
		//alert("creacion de iframe 'iframePop'");
		var elBody = document.getElementsByTagName('body')[0];
		var elIframe = document.createElement('iframe'); // Creando nuevo iframe
		elIframe.style.overflow = 'hidden'; 
		elIframe.style.position = 'absolute';
		elIframe.marginHeight = '0';
		elIframe.marginWidth = '0';
		//elIframe.style.display = 'none';
		elIframe.style.height = '1px';
		elIframe.id = 'iframePop';
		elIframe.style.zIndex = '99';
		elIframe.backgroundColor = "transparent";
		elIframe.allowTransparent = true;
		elIframe.frameBorder='0';
		elIframe.scrolling="no";
		
		elBody.appendChild(elIframe); 
		
	}
	mostrarIPop(urlpopup);
}
function mostrarIPop(urlpopup){
	var elIframe= document.getElementById('iframePop');
	
	elIframe.src = urlpopup;
	elIframe.style.left = ((screen.width-116)/2) + "px";
	elIframe.style.top = "140px";
	elIframe.style.width = "116px";
	elIframe.style.height = "190px";
	elIframe.style.visibility = "visible";
}
function ocultarIPop(){
	var elIframe= document.getElementById('iframePop');
	elIframe.style.visibility = "hidden";
	elIframe.src="";
	elIframe.style.width="";
	elIframe.style.height="";
}
function resizeIframe(idIframe)
{
	var miIframe=document.getElementById(idIframe);
	//alert("en el resize "+idIframe);
	var alturaPagina=miIframe.contentWindow.document.getElementById("capaPop").offsetHeight;
	miIframe.style.height=alturaPagina+"px";
	miIframe.style.minHeight=alturaPagina+"px";
	var anchuraPagina=miIframe.contentWindow.document.getElementById("capaPop").offsetWidth;
	//alert("ANCHO VISOR: "+screen.width);
	//alert("ANCHO PAGINA: "+anchuraPagina);
	miIframe.style.left = ((screen.width-eval(anchuraPagina))/2) + "px";
	miIframe.style.top = ((screen.height-eval(alturaPagina))/2) + "px";
	miIframe.style.width=anchuraPagina+"px";
}
