<script type='text/javascript'>
//<![CDATA[
// Lightbox Configuration
LightboxOptions = Object.extend({
    fileLoadingImage:        'http://forum71.ru/public/style_images/master/lightbox/loading.gif',     
    fileBottomNavCloseImage: 'http://forum71.ru/public/style_images/master/lightbox/closelabel.gif',
    overlayOpacity: 0.8,   // controls transparency of shadow overlay
    animate: true,         // toggles resizing animations
    resizeSpeed: 7,        // controls the speed of the image resizing animations (1=slowest and 10=fastest)
    borderSize: 10,         //if you adjust the padding in the CSS, you will need to update this variable
    // When grouping images this is used to write: Image # of #.
    // Change it for non-english localization
    labelImage: "Изображение",
    labelOf: "из"
}, window.LightboxOptions || {});
/* Watch for a lightbox image and set up our downloadbutton watcher */
document.observe('click', (function(event){
    var target = event.findElement('a[rel^=lightbox]') || event.findElement('area[rel^=lightbox]');
    if (target) {
        event.stop();
        gbl_addDownloadButton();
    }
}).bind(this));
var _to    = '';
var _last  = '';
function gbl_addDownloadButton()
{
if ( typeof( ipsLightbox.lightboxImage ) != 'undefined' && ipsLightbox.lightboxImage.src )
{
    if ( _last != ipsLightbox.lightboxImage.src )
    {
    if ( ! $('gbl_d') )
    {
        $('bottomNav').insert( { top: "<div id='gbl_d' style='text-align:right;padding-bottom:4px;'></div>" } );
    }
   
    $('gbl_d').update( "<a href='"+ ipsLightbox.lightboxImage.src + "' target='_blank'><img src='http://forum71.ru/public/style_images/master/lightbox/download-icon.png' /></a>" );
   
    _last = ipsLightbox.lightboxImage.src;
    }
}

/* Check for init and then keep checking for new image */
_to = setTimeout( "gbl_addDownloadButton()", 1000 );
}
//]]>
</script>