function set_opacity(div, value) { 
    div.style.opacity = value; 
    div.style.MozOpacity = value; 
    div.style.KhtmlOpacity = value; 
    div.style.filter = 'alpha(opacity=' + value*100 + ')'; 
    div.style.zoom=1;//necesario para Explorer 
} 
var transicion=function(inicio,fin,segundos){ 
    var _this=this; 
    this.test=0; 
    if(_this.intervalo)clearInterval(_this.intervalo); 
    if(this.val && Math.abs(fin-_this.val)<0.01)return; 
    this.val=!this.val?inicio<1?inicio+.0001:inicio:this.val; 
    set_opacity(this, this.val); 
    this.pasos=(fin-inicio)/30; 
    this.pausa=segundos*10; 
    this.intervalo=setInterval( 
    function(){ 
        if(_this.test>99 || Math.abs(fin-_this.val)<0.01){ 
          clearInterval(_this.intervalo); 
        } 
        _this.test++; 
        //document.getElementById("log").innerHTML=_this.test; 
        _this.val=_this.val+_this.pasos; 
        if(_this.val<=.01)  
            _this.style.display='none'; 
        else 
            _this.style.display='block'; 
        set_opacity(_this, _this.val); 
    },this.pausa); 
} 
function ver(objeto){ 
    var obj=document.getElementById(objeto); 
    transicion.call(obj,0,1,1); 
} 
function cerrar(objeto){ 
    var obj=document.getElementById(objeto); 
    transicion.call(obj,1,0,1); 
}
