function findPositionOfObject(object)
{
    // get total y offset
    var totaltop = 0;
    if (object.offsetParent)
    {
        do
        {
            // walk up the dom and keep adding the y offsets
            totaltop += object.offsetTop;
        }
        while (object = object.offsetParent);
    return [totaltop];
    }
}

function scrollToId(id)
{
    window.scroll(0,findPositionOfObject(document.getElementById(id)));
}
