function setOpacity(Objeto, o) {
	var Obj = document.getElementById(Objeto);
    Obj.style.opacity = (o / 100);
    Obj.style.MozOpacity = (o / 100);
    Obj.style.KhtmlOpacity = (o / 100);
    Obj.style.filter = 'alpha(opacity=' + o + ')';
}


function Mostrar_Mensaje_Fondo(Ancho, Alto, Msg){
	
	var Fondo = document.getElementById('fondo_transparente');
  	var Mensaje = document.getElementById('mensaje_fondo');

  	
  	document.body.style.overflow='hidden';

	Fondo.style.top = document.body.scrollTop;  
	Fondo.style.left = 0;
	Fondo.style.width = '100%';
	Fondo.style.height = '100%' ;

	Aparecer_Objeto('fondo_transparente', 70, 15, 70,0)
	Aparecer_Objeto('mensaje_fondo', 70, 15, 100,0)

	Mensaje.style.width = Ancho;
	Mensaje.style.height = Alto;
	
	Mensaje.style.left = (screen.width - Ancho) / 2 + document.body.scrollLeft;
	Mensaje.style.top = ((document.body.clientHeight - Alto) / 2) + document.body.scrollTop;
	
	Mensaje.innerHTML = Msg;
//	formulario.style.visibility = "visible";

}


function Ocultar_Mensaje_Fondo(Velocidad, Paso){
	
	var Fondo = document.getElementById('fondo_transparente');
  	var Mensaje = document.getElementById('mensaje_fondo');
  	

	Desaparecer_Objeto('fondo_transparente', 70, 15, 70)
	Desaparecer_Objeto('mensaje_fondo', 70, 15, 100)
	document.body.style.overflow="auto";

}


function Aparecer_Objeto(Objeto, Velocidad, Pasos, ValorMax, PasIncr){

	var Obj = document.getElementById(Objeto);
	PasIncr = PasIncr + Pasos;
	
	if ( PasIncr > ValorMax ){ PasIncr = ValorMax; }

	Obj.style.visibility = "visible";
	setOpacity (Objeto, PasIncr);

	var Linea = "Aparecer_Objeto('"+Objeto+"',"+Velocidad+","+Pasos+","+ValorMax+","+PasIncr+")";
	if ( PasIncr < ValorMax ){ setTimeout( Linea, Velocidad); }
	
}

function Desaparecer_Objeto(Objeto, Velocidad, Pasos, PasIncr){

	var Obj = document.getElementById(Objeto);
	PasIncr = PasIncr - Pasos;
	 
	if ( PasIncr < 0 ){ 
		PasIncr = 0;
		Obj.style.visibility = "hidden";
	 }
	setOpacity (Objeto, PasIncr );
	var Linea = "Desaparecer_Objeto('"+Objeto+"',"+Velocidad+","+Pasos+","+PasIncr+")";
	if ( PasIncr > 0 ){ setTimeout( Linea, Velocidad); }
	
}

