var t,t2,obj,op;
var cm;		// для отображения процентов

function appear(x)   // x - конечное значение прозрачности
{
	op = (obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100;
	
	if(op < x) {
		clearTimeout(t2);
		op += 0.05;
		cm.innerHTML = Math.round(op*10)/10*100+'%'; // отображение процентов
		obj.style.opacity = op;
		obj.style.filter='alpha(opacity='+op*100+')';
		t=setTimeout('appear('+x+')',20);
	}
}

function disappear(x) {
	op = (obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100;
	
	if(op > x) {
		clearTimeout(t);
		op -= 0.05;
		cm.innerHTML = Math.round(op*10)/10*100+'%'; // отображение процентов
		obj.style.opacity = op;
		obj.style.filter='alpha(opacity='+op*100+')';
		t2=setTimeout('disappear('+x+')',20);
	}
}
