function setOpacity(obj, nOpacity){
	if( nOpacity > .99 ) {
		nOpacity = .99;
		return;
	}
	obj.style.opacity = nOpacity;
	obj.style.MozOpacity = nOpacity;
	obj.style.filter = 'alpha(opacity=' + (nOpacity*100) + ')';
}

nOpacity = 0
//setOpacity(document.getElementById('descripcionPantalla1'), nOpacity);
//document.getElementById('descripcionPantalla1').style.display = "block";
alturaPad = 325;
altura = 0;
FlagAparecer = 0;
FlagDesaparecer = 0;

tempId = 0;
function aparecerM(id) {
	//nOpacity = 0
//	setOpacity(document.getElementById('descripcionPantalla' + id ), nOpacity);
	document.getElementById( id ).style.display = "block";
	

	tempId = id;
	aparecer();
}

function aparecer() {
	//alert(nOpacity)
	if ( FlagDesaparecer == 1 ) {
		FlagDesaparecer = 0;
		clearTimeout( timeDesaparecer );
	}
	FlagAparecer = 1;
	if ( nOpacity < 1 ) {
		nOpacity += .04;
		setOpacity(document.getElementById( tempId ), nOpacity)
	}
	if ( nOpacity < 1 ) {
		timeAparecer = setTimeout(aparecer,30);
	} 
}

function desaparecer() {
	if ( FlagAparecer == 1 ) {
		FlagAparecer = 0;
		clearTimeout( timeAparecer );
	}
	FlagDesaparecer = 1;
	if ( nOpacity > 0 ) {
		nOpacity -= .04;
		setOpacity(document.getElementById( tempId ), nOpacity);
	}
	if ( nOpacity > 0 ) {
		timeDesaparecer = setTimeout(desaparecer,30);
	}
	else{
		document.getElementById( tempId ).style.display = "none";
	}
}
