﻿function GetScrollPositions(tipo) {
    var risultato = new Number(0);

    if (window.pageXOffset == undefined) {

        if (tipo == "horizontal") {
            risultato = document.documentElement.scrollLeft;
        }
        else if (tipo == "vertical") {
            risultato = document.documentElement.scrollTop;
        }

    }
    else {

        if (tipo == "horizontal") {
            risultato = window.pageXOffset;
        }
        else if (tipo == "vertical") {
            risultato = window.pageYOffset;
        }
    }

    return risultato;
}


function sposta(div) {

        spostamento = GetScrollPositions('vertical');

        if (spostamento < 230) {
            spostamento = 0;
        } else {
            spostamento = spostamento - 230;
        }

        try {
            document.getElementById(div).style.top = spostamento + 'px';
        } 
        catch (e) {
            //alert(e.message);
        }
        
 
}
