function lbs_resize(img) {
    var imgWidth = parseInt(img.width);
    var imgHeight = parseInt(img.height);
    
    var imgWrapper = document.getElementById('lightboxesImgWrapper');

    var w = window,
        d = document,
        e = d.documentElement,
        g = d.getElementsByTagName('body')[0],
        width = parseInt((w.innerWidth || e.clientWidth || g.clientWidth)),
        height = parseInt((w.innerHeight|| e.clientHeight|| g.clientHeight));
    
    var wrapperWidth = parseInt(imgWrapper.clientWidth);
    var wrapperHeight = parseInt(imgWrapper.clientHeight);
    
    if(imgHeight/imgWidth < wrapperHeight/wrapperWidth) {
        img.style.width = "100%";
        img.style.height = "auto";
        img.style.left = "0%";
        img.style.top = ((parseInt(imgWrapper.clientHeight) - parseInt(img.clientHeight))/2)+"px";
    } else {
        img.style.height = "100%";
        img.style.width = "auto";
        img.style.top = "0%";
        img.style.left = ((parseInt(imgWrapper.clientWidth) - parseInt(img.clientWidth))/2)+"px";
    }
}
//resizes the images in order to fit them perfectly on the screen (maybe too complicated)
resizes the images in order to fit them perfectly on the screen (maybe too complicated)
resizes the images in order to fit them perfectly on the screen ( maybe too complicated )
function lbs_resize(img) {
    var imgWidth = parseInt(img.width);
    var imgHeight = parseInt(img.height);
    var imgWrapper = document.getElementById('lightboxesImgWrapper');
    var w = window,
        d = document,
        e = d.documentElement,
        g = d.getElementsByTagName('body')[0],
        width = parseInt((w.innerWidth || e.clientWidth || g.clientWidth)),
        height = parseInt((w.innerHeight|| e.clientHeight|| g.clientHeight));
    var wrapperWidth = parseInt(imgWrapper.clientWidth);
    var wrapperHeight = parseInt(imgWrapper.clientHeight);
    if(imgHeight/imgWidth < wrapperHeight/wrapperWidth) {
        img.style.width = "100%";
        img.style.height = "auto";
        img.style.left = "0%";
        img.style.top = ((parseInt(imgWrapper.clientHeight) - parseInt(img.clientHeight))/2)+"px";
    } else {
        img.style.height = "100%";
        img.style.width = "auto";
        img.style.top = "0%";
        img.style.left = ((parseInt(imgWrapper.clientWidth) - parseInt(img.clientWidth))/2)+"px";
    }
}
function lbs_resize ( img ) { var imgWidth = parseInt ( img . width ) ; var imgHeight = parseInt ( img . height ) ; var imgWrapper = document . getElementById ( 'lightboxesImgWrapper' ) ; var w = window , d = document , e = d . documentElement , g = d . getElementsByTagName ( 'body' ) [ 0 ] , width = parseInt ( ( w . innerWidth || e . clientWidth || g . clientWidth ) ) , height = parseInt ( ( w . innerHeight || e . clientHeight || g . clientHeight ) ) ; var wrapperWidth = parseInt ( imgWrapper . clientWidth ) ; var wrapperHeight = parseInt ( imgWrapper . clientHeight ) ; if ( imgHeight / imgWidth < wrapperHeight / wrapperWidth ) { img . style . width = "100%" ; img . style . height = "auto" ; img . style . left = "0%" ; img . style . top = ( ( parseInt ( imgWrapper . clientHeight ) - parseInt ( img . clientHeight ) ) / 2 ) + "px" ; } else { img . style . height = "100%" ; img . style . width = "auto" ; img . style . top = "0%" ; img . style . left = ( ( parseInt ( imgWrapper . clientWidth ) - parseInt ( img . clientWidth ) ) / 2 ) + "px" ; } }
resizes the images in order to fit them perfectly on the screen (maybe too complicated)
resizes the images in order to fit them perfectly on the screen ( maybe too complicated )