function largeImageLoaded() {
if(!earlyResetLarge) {
var top = Math.round(($(window).height() - (largeImg.height + 50)) /2);
var left = Math.round(($(window).width() - (largeImg.width + 50)) /2);
if(top < 0)
top = 0;
if(left < 0)
left = 0;
if((largeImg.height + 40) > $(window).height()) {
$('#largeImageContainer').css('height', (largeImg.height + 50)+'px');
$('#largeImageBackground').css('height', (largeImg.height + 50)+'px');
}
if((largeImg.width + 40) > $(window).width()) {
$('#largeImageContainer').css('width', (largeImg.width + 50)+'px');
$('#largeImageBackground').css('width', (largeImg.width + 50)+'px');
}
$('#largeImageSource').html('
close
');
$('#loadingLargeContainer').animate({
width: largeImg.width,
height: largeImg.height,
top: top,
left: left
}, 300);//, 'linear', function() {
//});
$('#largeImageSource').click(function() {
$('#largeImageContainer').fadeOut('fast', function() {
$('#largeImageContainer').remove();
});
});
$('#loadingLargeImage').fadeOut('500', function() {
$('#largeImageLoader').fadeIn('500');
});
}
}
function earlyResetLargeLoad() {
earlyResetLarge = true;
$('#largeImageLoader').fadeOut('fast');
$('#largeImageContainer').fadeOut('500', function() {
$('#largeImageContainer').remove();
});
}
function loadFullSize(id) {
var html = "";
//html += "";
html += "
";
//html += "
";
html += "
";
html += "
";
html += "
";
html += "
";
html += "
";
html += "
";
html += "
";
html += "
";
$('body').append(html);
$('#largeImageContainer').fadeIn('fast', function() {
largeImg = new Image();
largeImg.onload = largeImageLoaded;
largeImg.src = baseUrl + "/templateImages/imageLoad.php?id="+id+"&maxWidth=980&maxHeight=740&proportion=true";
});
}