function blackback(){
var fondero = document.createElement('div');
fondero.setAttribute('id','black');
fondero.setAttribute('onclick','desaparecer();');
document.body.appendChild(fondero);

}

function blackfront(){
var encimado = document.getElementById('formul');
var encir = document.createElement('div');
encir.setAttribute('id','encima');
encimado.appendChild(encir);
}

color=0;
sube=10;
function colorea(){
var obj = document.getElementById('black');
color+=sube;
if(!(color>=90)){
obj.style.filter = 'alpha(opacity='+color+')';
			 obj.style.opacity = color /100;
			 obj.style.MozOpacity = color /100;
			 obj.style.KHTMLOpacity = color /100;
		window.setTimeout ("colorea();", 10);
}
if (color==80){
hincho();
blackfront();
}
}

colorete=100;
suben=10;
function decolorea(){
var obj2 = document.getElementById('encima');
colorete-=suben;
if(!(colorete<=-10)){
obj2.style.filter = 'alpha(opacity='+colorete+')';
			 obj2.style.opacity = colorete /100;
			 obj2.style.MozOpacity = colorete /100;
			 obj2.style.KHTMLOpacity = colorete /100;
		window.setTimeout ("decolorea();", 50);
}
if (colorete == 0){
obj2.style.display = "none";
}
}

var uno = 0;
var multiplo = 10;
var dos = 0;
var submultiplo = 5;

function mano() {
		var objective = document.getElementById('formul');
		objective.style.display = "block";
				uno += multiplo;
		dos += submultiplo;
		if (!(uno >= 390)) {
			objective.style.height = uno + 'px';
			objective.style.marginTop = '-' + dos + 'px';
			window.setTimeout ("mano();", 5);
		} 
		
		if (uno==380){
		decolorea();
		}
		
	}

	
var tres = 0;
var multiplicado = 10;
var cuatro = 0;
var submultiplicado = 5; 	
function hincho() {
		var objective2 = document.getElementById('formul');
		objective2.style.top="50%";
		objective2.style.display = "block";
				tres += multiplicado;
		cuatro += submultiplicado;
		if (!(tres >= 510)) {
			objective2.style.width = tres + 'px';
			objective2.style.marginLeft = '-' + cuatro + 'px';
			window.setTimeout ("hincho();", 30);
		} 
		
		if (tres==500){
		mano();
		}
		
	}

function desaparecer(){
var movido = document.getElementById('black');
document.body.removeChild(movido);
var ensir = document.getElementById('encima');
document.getElementById('formul').removeChild(ensir);
document.getElementById('formul').style.display = "none";
document.getElementById('formul').style.height = "0px";
document.getElementById('formul').style.width = "0px";

color=0;
colorete=100;
uno=0;
dos=0;
tres=0;
cuatro=0;
}

function llama(){
blackback();
colorea();


}



