    var ocapa = 
    {
        topMargin  : -149,
        ceiling        : 1,
        desplazaTime  : 1200,
        capaDiv  : document.all ? document.all.capa : //sigue en la siguiente linea
        (document.layers ? document.capa : document.getElementById('capa'))
    }
    
    window.setInterval("ocapa.coordenadas( )", 35)

    
    ocapa.coordenadas = function( )
    {
        if(document.all)
        {
            this.actualY = this.capaDiv.style.pixelTop;
            this.scrollTop = document.body.scrollTop;
        }
        else if(document.layers)
        {
            this.actualY = this.capaDiv.top;
            this.scrollTop = window.pageYOffset;
        }            
        else if(document.getElementById)
        {
            this.actualY = parseInt(this.capaDiv.style.top);
            this.scrollTop = window.pageYOffset;
         }      
     
        
        var nuevoScrollTop  = Math.max( this.scrollTop + this.topMargin, this.ceiling );
        
        
        if ( this.actualY != nuevoScrollTop ) 
        {
            if ( nuevoScrollTop != this.targetY ) 
            {
                this.targetY = nuevoScrollTop;
                this.desplazaInit( );
            }
            this.desplaza( );  
       }
   }
   

    
    ocapa.desplazaInit = function( )
    {
        var ahora    = new Date( )    
        this.A     = this.targetY - this.actualY ;  
        this.B     = Math.PI / ( 2 * this.desplazaTime );     
        this.C     = ahora.getTime( );
        this.D     = this.actualY;
    }
    
 
    
    ocapa.desplaza = function( )
    {
        var ahora    = new Date( );
        var nuevaY  = this.A * Math.sin( this.B * ( ahora.getTime( ) - this.C ) ) + this.D;
        nuevaY        = Math.round( nuevaY );

        if ( ( this.A > 0 && nuevaY > this.actualY ) ||  ( this.A < 0 && nuevaY < this.actualY ) ) 
       {
           if (document.all)
               this.capaDiv.style.pixelTop = nuevaY;
           else if(document.layers)
               this.capaDiv.top = nuevaY;
           else if(document.getElementById)
               this.capaDiv.style.top = nuevaY;               
       }
    }
