var LastScrollPosition;

function ShowFullPhoto(name){
    var imgFullPhoto = document.getElementById('imgFullPhoto');
    var divFullPhoto = document.getElementById('divFullPhoto');
    //var divThumbPhotos = document.getElementById('divThumbPhotos');
    imgFullPhoto.src = 'images/photogallery/' + name;
    //divThumbPhotos.style['display'] = 'none';
    divFullPhoto.style['display'] = '';
    LastScrollPosition = ScrollPositionY();
    scroll(0,0);
}

function CloseFullPhoto(){
    document.getElementById('imgFullPhoto').src = 'images/photogallery/loading.gif';
    document.getElementById('divFullPhoto').style['display'] = 'none';
    //document.getElementById('divThumbPhotos').style['display'] = '';
    scroll(0,LastScrollPosition);
}

window.onload = setDiv;

function setDiv(){
  var d = document.getElementById('divFullPhoto');
  d.style.height = document.getElementById('tblContent').offsetHeight + 'px';
}

function ScrollPositionY(){
    var ScrollTop = document.body.scrollTop;
    if (ScrollTop == 0){
        if (window.pageYOffset){
            ScrollTop = window.pageYOffset;
        } else {
            ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
        }
    }
    return ScrollTop;
}