function initScroll() {
    scrollActive = 0
    scrollContainer = "scroll"
    scrollContentShown = "txtscroll"
    if (document.getElementById(scrollContainer) && document.getElementById(scrollContentShown)) {
        alt_container = getHeight(scrollContainer)
        alt_content = getHeight(scrollContentShown)
        scrollLimit = alt_container - alt_content
        pos = getPos(scrollContentShown)   
    }
}


function getHeight(obj) {
    var val = document.getElementById(obj).offsetHeight    
    return val
}

function getPos(obj) {
    var curtop = 0;
    if (obj.offsetParent) {
        curtop = obj.offsetTop
        while (obj = obj.offsetParent) {
            curtop += obj.offsetTop
        }
    }
    return curtop;
}

function scroll(direction) {
    if (scrollActive) {
        var x = document.getElementById(scrollContentShown);
        limite = x.style.height;
        if (direction == "up" && pos < 0) {             // ver si ya esta arriba del todo
          var inc = 10    // mover de 10 en 10 px
          x.style.top = pos + inc;
          pos += inc;
	
          setTimeout("scroll('up')",20)
        }

        if (direction == "down" && pos > scrollLimit) {  // ver si ya esta abajo del todo
          var inc = -10   // mueve de 10 en 10 px
          x.style.top = pos + inc;
          pos += inc;		  
	
          setTimeout("scroll('down')",20)
        }
    }
}