// JavaScript Document
var oPopModulo = new function(){

	//C
	this.cargarFrame = function(conf){
		Blocker.show();
		this.mostrarPop();
		this.iFrame.style.display = 'none';
		this.mostrarCargando();
		this.iFrame.src = conf.src;

	}

	//I
	this.init = function(conf){
		
		
		this.iFrame = $(conf.nomFrame);
		this.cuadro = $(conf.cuadroPop);
		this.Loader = $(conf.nombreLoader);
		AddEvent(this.iFrame,'load',mostrarFrame);
		AddEvent($('btnCerrarModulo'),'click',ocultarPop);
	}
	
	//M
	this.mostrarCargando = function(){
		this.Loader.style.display = 'block';		
		this.Loader.style.marginTop = Math.round((this.cuadro.offsetHeight-this.Loader.offsetHeight)/2)+'px';
		this.Loader.style.marginLeft = Math.round((this.cuadro.offsetWidth-this.Loader.offsetWidth)/2)+'px';		
	}
	this.mostrarPop = function(){
		if(!dimSeteada){
			dimSeteada = true;
			this.cuadro.style.height = (HScreen()-10)+'px';
			this.iFrame.style.height = (HScreen()-50)+'px';
			this.iFrame.style.width = (this.cuadro.offsetWidth-7)+'px';			
		}
		CentrarContenido(this.cuadro);
		this.cuadro.style.visibility = 'visible';
	}
	var mostrarFrame = function(){
		this.Loader.style.display = 'none';
		this.iFrame.style.display = 'block';
	}.closure(this);
	
	//O
	var ocultarPop = function(){
		OcultarContenido(this.cuadro);
		Blocker.hide();
	}.closure(this);
	
	var dimSeteada = false;
	
}