var scrolling = null;

function scrollDivDown( id ){
    document.getElementById( id ).scrollTop += 1;
    scrolling = window.setTimeout("scrollDivDown('"+ id + "')", 10);
}

function scrollDivUp( id ){
    document.getElementById( id ).scrollTop -= 1;
    scrolling = window.setTimeout("scrollDivUp('"+ id + "')", 10);
}

function stopScrollDiv(){
    window.clearTimeout(scrolling);
}


function rollDivDown( id ) {
    document.getElementById( id ).scrollTop = document.getElementById(id).scrollHeight;
}


function rollDivUp( id ) {
document.getElementById( id ).scrollTop = 0;
}

function wheel(event){
        var delta = 0;
        if (!event) /* For IE. */
                event = window.event;
        if (event.wheelDelta) { /* IE/Opera. */
                delta = event.wheelDelta/120;
                /** In Opera 9, delta differs in sign as compared to IE.
                 */
                if (window.opera)
                        delta = -delta;
        } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
        }

        if (delta) {
                if ( delta < 0 )
document.getElementById( 'tartalom' ).scrollTop += 40;
else

document.getElementById( 'tartalom' ).scrollTop -= 40;
}

        if (event.preventDefault)
                event.preventDefault();
event.returnValue = false;
}

if (window.addEventListener)
        /** DOMMouseScroll is for mozilla. */
        window.addEventListener('DOMMouseScroll', wheel, false);
/** IE/Opera. */
window.onmousewheel = document.onmousewheel = wheel;
