var photoToLoad;
var lPhoto = new Image(80, 80);

/*
function showPhoto(img, descr) {
document.getElementById('bigImg').src = img;
document.getElementById('bigImgDescr').innerHTML = descr;
showPop();
}

function showPhotoStuffed(img, stuffId) {
document.getElementById('bigImg').src = img;
document.getElementById('bigImgDescr').innerHTML = document.getElementById(stuffId).innerHTML;
showPop();
}
*/

function showPhoto(photo, descr) {

document.getElementById('bigImg').src = '/images/preloader.gif';
document.getElementById('bigImgDescr').innerHTML = descr;

photoToLoad = lPhoto.src = photo;
lPhoto.onload = loadPhoto;

showPop();

/*
pop = document.getElementById('photoPop');
pop.style.display = 'block';
pop.style.left = document.documentElement.scrollLeft + ((document.body.offsetWidth - document.documentElement.scrollLeft - pop.offsetWidth) / 2) + 'px';
pop.style.top = document.documentElement.scrollTop + ((document.getElementById('layout').offsetHeight - pop.offsetHeight) / 2) + 'px';
*/
}

function showPhotoStuffedId(photo, stuffId) {

document.getElementById('bigImg').src = '/images/preloader.gif';
document.getElementById('bigImgDescr').innerHTML = document.getElementById(stuffId).innerHTML;

photoToLoad = lPhoto.src = photo;
lPhoto.onload = loadPhoto;

showPop();
}

function showPhotoStuffed(photo, text) {

document.getElementById('bigImg').src = '/images/preloader.gif';
//document.getElementById('bigImgDescr').innerHTML = document.getElementById(stuffId).innerHTML;
document.getElementById('bigImgDescr').innerHTML = text;

photoToLoad = lPhoto.src = photo;
lPhoto.onload = loadPhoto;

showPop();

/*
pop = document.getElementById('photoPop');
pop.style.display = 'block';
pop.style.left = document.documentElement.scrollLeft + ((document.body.offsetWidth - document.documentElement.scrollLeft - pop.offsetWidth) / 2) + 'px';
pop.style.top = document.documentElement.scrollTop + ((document.getElementById('layout').offsetHeight - pop.offsetHeight) / 2) + 'px';
*/
}


function loadPhoto() {

document.getElementById('bigImg').src = photoToLoad;
document.getElementById('bigImg').onload = loadPhoto2;


//showPop();
/*
pop = document.getElementById('popup1');
pop.style.display = 'block';
pop.style.left = document.documentElement.scrollLeft + ((document.body.offsetWidth - document.documentElement.scrollLeft - pop.offsetWidth) / 2) + 'px';
pop.style.top = document.documentElement.scrollTop + ((document.getElementById('layout').offsetHeight - pop.offsetHeight) / 2) + 'px';
*/
}

function loadPhoto2() {
showPop();
}



