function lbs_pose(caller) {
    //get starting index from clicked image
    lbs_lightboxindex = parseInt(caller.getAttribute("lbs_lbx_index"));
    var lbs_currLightbox = lbs_lightboxes[lbs_lightboxindex];
    
    //add lightbox html
    document.body.innerHTML = document.body.innerHTML + '<div id="lightboxesBox">\n'
        + '<div id="lightboxesImgWrapper">\n'
        + ' <img class="lightboxesImg" id="lbs_currImg">\n'
        + '</div>\n'
        + ' <div id="lightboxesLoading">\n'
        + ' <div id="lightboxesLoadingInner">Loading...</div>\n'
        + '</div>\n'
        + '<button class="lightboxesButton" id="lightboxesButtonBack"></button>\n'
        + '<button class="lightboxesButton" id="lightboxesButtonForward"></button>\n'
        + '<button id="lightboxesButtonClose" onmousedown="lbs_dispose();"></button>\n'
        + '<div id="lightboxesPreviewGallery"></div>'
        + '<div id="lightboxesProgressBar">'
        + ' <div id="lightboxesProgressBarIndicator"></div>'
        + '</div>'
        + '<div id="lightboxesImageInfo">'
        + ' <div id="lightboxesImageInfoSlider"></div>'
        + ' <div id="lightboxesImageInfoText">'
        + '     <div id="lightboxesImageInfoHeadline"></div>'
        + '     <div id="lightboxesImageInfoSize"></div>'
        + '     <div id="lightboxesImageInfoDescr"></div>'
        + ' </div>'
        + '</div>'
        + '</div>';
    
    //check if the preview attribute is set and preparing chosen preview/progress mode
    var lbs_progressIndicator = lbs_currLightbox.getAttribute('lbs_progressIndicator');
    var lbs_previewGallery = lbs_currLightbox.getAttribute('lbs_previewGallery');
    var lbs_lightbox = document.getElementById("lightboxesBox");
    if(lbs_previewGallery == 'true'){
        lbs_previewMode = true;
        document.getElementById('lightboxesImgWrapper').style.height = "calc(90% - 60px)";
        document.getElementById('lightboxesPreviewGallery').style.display = "block";
    } else {
        lbs_previewMode = false;
        document.getElementById('lightboxesPreviewGallery').style.display = "none";
    }
    if(lbs_progressIndicator == 'true') {
        lbs_progressMode = true;
        if( lbs_previewMode){
            document.getElementById('lightboxesImgWrapper').style.height = "calc(90% - 70px)";
            document.getElementById('lightboxesPreviewGallery').style.bottom = "10px";
        }
        document.getElementById('lightboxesProgressBar').style.display = "block";
    } else {
        lbs_progressMode = false;
        document.getElementById('lightboxesProgressBar').style.display = "none";
    }
    
    
    //checks and initialization for info box
    var lbs_infoBox = lbs_currLightbox.getAttribute('lbs_infoBox');
    if(lbs_infoBox == 'true'){
        lbs_infoboxMode = true;
        document.getElementById("lightboxesImageInfoSlider").addEventListener("click", lbs_infoBoxClickEventListener);
        lbs_infoboxShowing = false;
        lbs_infoboxVisibility();
        
    } else {
        lbs_infoboxMode = false;
        document.getElementById("lightboxesImageInfo").style.display = "none";
    }
    
    if(lbs_currLightbox.getAttribute("lbs_altHighResSourceMode") == 'true'){
        lbs_altHighResSourceMode = true;
    } else {
        lbs_altHighResSourceMode = false;
    }
    
    //event listener
    document.body.addEventListener("keydown", lbs_keyEvent);//add key event listener
    document.getElementById("lightboxesButtonBack").addEventListener("mousedown", function() {
        lbs_slide("back");
    }); 
    document.getElementById("lightboxesButtonForward").addEventListener("mousedown", function() {
        lbs_slide("forward");
    });
    window.addEventListener("resize", function() {
        lbs_resize(document.getElementById("lbs_currImg"));
        if(lbs_previewMode){
            lbs_preview();
        }
        if(lbs_infoboxMode){
            lbs_infoboxVisibility();   
        }
    });

    //update global variables
    lbs_imgCounter = lbs_lightboxes[lbs_lightboxindex].getElementsByTagName('img').length;
    lbs_imgIndex = parseInt(caller.getAttribute("lbs_pic_index"));
    lbs_images = lbs_getSource(lbs_lightboxindex);
    
    //check index and hide buttons if needed
    if(lbs_imgIndex == 0) {
        document.getElementById("lightboxesButtonBack").style.display = "none";   
    }
    if(lbs_imgIndex == lbs_imgCounter-1) {
        document.getElementById("lightboxesButtonForward").style.display = "none";   
    }
    
    lbs_swap();
}
//shows a new lightbox starting with the given caller (a lightbox img)
shows a new lightbox starting with the given caller (a lightbox img)
shows a new lightbox starting with the given caller ( a lightbox img )
function lbs_pose(caller) {
    lbs_lightboxindex = parseInt(caller.getAttribute("lbs_lbx_index"));
    var lbs_currLightbox = lbs_lightboxes[lbs_lightboxindex];
    document.body.innerHTML = document.body.innerHTML + '<div id="lightboxesBox">\n'
        + '<div id="lightboxesImgWrapper">\n'
        + ' <img class="lightboxesImg" id="lbs_currImg">\n'
        + '</div>\n'
        + ' <div id="lightboxesLoading">\n'
        + ' <div id="lightboxesLoadingInner">Loading...</div>\n'
        + '</div>\n'
        + '<button class="lightboxesButton" id="lightboxesButtonBack"></button>\n'
        + '<button class="lightboxesButton" id="lightboxesButtonForward"></button>\n'
        + '<button id="lightboxesButtonClose" onmousedown="lbs_dispose();"></button>\n'
        + '<div id="lightboxesPreviewGallery"></div>'
        + '<div id="lightboxesProgressBar">'
        + ' <div id="lightboxesProgressBarIndicator"></div>'
        + '</div>'
        + '<div id="lightboxesImageInfo">'
        + ' <div id="lightboxesImageInfoSlider"></div>'
        + ' <div id="lightboxesImageInfoText">'
        + '     <div id="lightboxesImageInfoHeadline"></div>'
        + '     <div id="lightboxesImageInfoSize"></div>'
        + '     <div id="lightboxesImageInfoDescr"></div>'
        + ' </div>'
        + '</div>'
        + '</div>';
    var lbs_progressIndicator = lbs_currLightbox.getAttribute('lbs_progressIndicator');
    var lbs_previewGallery = lbs_currLightbox.getAttribute('lbs_previewGallery');
    var lbs_lightbox = document.getElementById("lightboxesBox");
    if(lbs_previewGallery == 'true'){
        lbs_previewMode = true;
        document.getElementById('lightboxesImgWrapper').style.height = "calc(90% - 60px)";
        document.getElementById('lightboxesPreviewGallery').style.display = "block";
    } else {
        lbs_previewMode = false;
        document.getElementById('lightboxesPreviewGallery').style.display = "none";
    }
    if(lbs_progressIndicator == 'true') {
        lbs_progressMode = true;
        if( lbs_previewMode){
            document.getElementById('lightboxesImgWrapper').style.height = "calc(90% - 70px)";
            document.getElementById('lightboxesPreviewGallery').style.bottom = "10px";
        }
        document.getElementById('lightboxesProgressBar').style.display = "block";
    } else {
        lbs_progressMode = false;
        document.getElementById('lightboxesProgressBar').style.display = "none";
    }
    var lbs_infoBox = lbs_currLightbox.getAttribute('lbs_infoBox');
    if(lbs_infoBox == 'true'){
        lbs_infoboxMode = true;
        document.getElementById("lightboxesImageInfoSlider").addEventListener("click", lbs_infoBoxClickEventListener);
        lbs_infoboxShowing = false;
        lbs_infoboxVisibility();
    } else {
        lbs_infoboxMode = false;
        document.getElementById("lightboxesImageInfo").style.display = "none";
    }
    if(lbs_currLightbox.getAttribute("lbs_altHighResSourceMode") == 'true'){
        lbs_altHighResSourceMode = true;
    } else {
        lbs_altHighResSourceMode = false;
    }
    document.body.addEventListener("keydown", lbs_keyEvent);
    document.getElementById("lightboxesButtonBack").addEventListener("mousedown", function() {
        lbs_slide("back");
    }); 
    document.getElementById("lightboxesButtonForward").addEventListener("mousedown", function() {
        lbs_slide("forward");
    });
    window.addEventListener("resize", function() {
        lbs_resize(document.getElementById("lbs_currImg"));
        if(lbs_previewMode){
            lbs_preview();
        }
        if(lbs_infoboxMode){
            lbs_infoboxVisibility();   
        }
    });
    lbs_imgCounter = lbs_lightboxes[lbs_lightboxindex].getElementsByTagName('img').length;
    lbs_imgIndex = parseInt(caller.getAttribute("lbs_pic_index"));
    lbs_images = lbs_getSource(lbs_lightboxindex);
    if(lbs_imgIndex == 0) {
        document.getElementById("lightboxesButtonBack").style.display = "none";   
    }
    if(lbs_imgIndex == lbs_imgCounter-1) {
        document.getElementById("lightboxesButtonForward").style.display = "none";   
    }
    lbs_swap();
}
function lbs_pose ( caller ) { lbs_lightboxindex = parseInt ( caller . getAttribute ( "lbs_lbx_index" ) ) ; var lbs_currLightbox = lbs_lightboxes [ lbs_lightboxindex ] ; document . body . innerHTML = document . body . innerHTML + '<div id="lightboxesBox">\n' + '<div id="lightboxesImgWrapper">\n' + ' <img class="lightboxesImg" id="lbs_currImg">\n' + '</div>\n' + ' <div id="lightboxesLoading">\n' + ' <div id="lightboxesLoadingInner">Loading...</div>\n' + '</div>\n' + '<button class="lightboxesButton" id="lightboxesButtonBack"></button>\n' + '<button class="lightboxesButton" id="lightboxesButtonForward"></button>\n' + '<button id="lightboxesButtonClose" onmousedown="lbs_dispose();"></button>\n' + '<div id="lightboxesPreviewGallery"></div>' + '<div id="lightboxesProgressBar">' + ' <div id="lightboxesProgressBarIndicator"></div>' + '</div>' + '<div id="lightboxesImageInfo">' + ' <div id="lightboxesImageInfoSlider"></div>' + ' <div id="lightboxesImageInfoText">' + '     <div id="lightboxesImageInfoHeadline"></div>' + '     <div id="lightboxesImageInfoSize"></div>' + '     <div id="lightboxesImageInfoDescr"></div>' + ' </div>' + '</div>' + '</div>' ; var lbs_progressIndicator = lbs_currLightbox . getAttribute ( 'lbs_progressIndicator' ) ; var lbs_previewGallery = lbs_currLightbox . getAttribute ( 'lbs_previewGallery' ) ; var lbs_lightbox = document . getElementById ( "lightboxesBox" ) ; if ( lbs_previewGallery == 'true' ) { lbs_previewMode = true ; document . getElementById ( 'lightboxesImgWrapper' ) . style . height = "calc(90% - 60px)" ; document . getElementById ( 'lightboxesPreviewGallery' ) . style . display = "block" ; } else { lbs_previewMode = false ; document . getElementById ( 'lightboxesPreviewGallery' ) . style . display = "none" ; } if ( lbs_progressIndicator == 'true' ) { lbs_progressMode = true ; if ( lbs_previewMode ) { document . getElementById ( 'lightboxesImgWrapper' ) . style . height = "calc(90% - 70px)" ; document . getElementById ( 'lightboxesPreviewGallery' ) . style . bottom = "10px" ; } document . getElementById ( 'lightboxesProgressBar' ) . style . display = "block" ; } else { lbs_progressMode = false ; document . getElementById ( 'lightboxesProgressBar' ) . style . display = "none" ; } var lbs_infoBox = lbs_currLightbox . getAttribute ( 'lbs_infoBox' ) ; if ( lbs_infoBox == 'true' ) { lbs_infoboxMode = true ; document . getElementById ( "lightboxesImageInfoSlider" ) . addEventListener ( "click" , lbs_infoBoxClickEventListener ) ; lbs_infoboxShowing = false ; lbs_infoboxVisibility ( ) ; } else { lbs_infoboxMode = false ; document . getElementById ( "lightboxesImageInfo" ) . style . display = "none" ; } if ( lbs_currLightbox . getAttribute ( "lbs_altHighResSourceMode" ) == 'true' ) { lbs_altHighResSourceMode = true ; } else { lbs_altHighResSourceMode = false ; } document . body . addEventListener ( "keydown" , lbs_keyEvent ) ; document . getElementById ( "lightboxesButtonBack" ) . addEventListener ( "mousedown" , function ( ) { lbs_slide ( "back" ) ; } ) ; document . getElementById ( "lightboxesButtonForward" ) . addEventListener ( "mousedown" , function ( ) { lbs_slide ( "forward" ) ; } ) ; window . addEventListener ( "resize" , function ( ) { lbs_resize ( document . getElementById ( "lbs_currImg" ) ) ; if ( lbs_previewMode ) { lbs_preview ( ) ; } if ( lbs_infoboxMode ) { lbs_infoboxVisibility ( ) ; } } ) ; lbs_imgCounter = lbs_lightboxes [ lbs_lightboxindex ] . getElementsByTagName ( 'img' ) . length ; lbs_imgIndex = parseInt ( caller . getAttribute ( "lbs_pic_index" ) ) ; lbs_images = lbs_getSource ( lbs_lightboxindex ) ; if ( lbs_imgIndex == 0 ) { document . getElementById ( "lightboxesButtonBack" ) . style . display = "none" ; } if ( lbs_imgIndex == lbs_imgCounter - 1 ) { document . getElementById ( "lightboxesButtonForward" ) . style . display = "none" ; } lbs_swap ( ) ; }
shows a new lightbox starting with the given caller (a lightbox img)
shows a new lightbox starting with the given caller ( a lightbox img )
//get starting index from clicked image //add lightbox html //check if the preview attribute is set and preparing chosen preview/progress mode //checks and initialization for info box //event listener //add key event listener //update global variables //check index and hide buttons if needed