// переменная класса описанного ниже
var z;

// класс объекта имеющего свойства плавного появления и исчезновения
function ZAppearObj(x,x2,obj)   // x - конечное значение прозрачности, x2 - начальное 
{ 
	var t,t2;
	
	// ф-я плавного появления
    this.Appear = function() 
    {
        var op = (obj.style.opacity)?parseFloat(obj.style.opacity):0;//(obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100;
        if(op < x)  
        { 
            clearTimeout(t2);
            op += 0.05; 
            obj.style.opacity 		= op; 
			obj.style.MozOpacity 	= op;
			obj.style.filter 		= "progid:DXImageTransform.Microsoft.Alpha(opacity="+op+")";
            obj.style.filter		= 'alpha(opacity='+op*100+')'; 
            t = setTimeout(arguments.callee,50); 
        } 
    }
	// ф-я плавного исчезновения
    this.Disappear = function() 
    { 
         var op = (obj.style.opacity)?parseFloat(obj.style.opacity):0;//(obj.style.opacity)?parseFloat(obj.style.opacity):parseInt(obj.style.filter)/100;
        if(op > x2)  
        { 
            clearTimeout(t); 
            op -= 0.05; 
            obj.style.opacity 		= op; 
			obj.style.MozOpacity 	= op;
			obj.style.filter 		= "progid:DXImageTransform.Microsoft.Alpha(opacity="+op+")";
            obj.style.filter		= 'alpha(opacity='+op*100+')'
            t2 = setTimeout(arguments.callee,50); 
        } 
    } 
}

// ф-я для задания начальх данных прозрачности
function StartAppear(obj,x)
{
	obj.style.opacity = x;
	obj.style.filter='alpha(opacity='+x*100+')';
}
