function zoomGalleryImage(idSlike, imageSrc, comboBoxID)
{
    galImage = new Image;
    galImage.src = imageSrc;
    
    var docWidth = 0, docHeight = 0;
    var scrollXpos = 0, scrollYpos = 0;
    var imageWidth = galImage.width, imageHeight = galImage.height;
    var topImage = 0, leftImage = 0;
    
        
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        docWidth = window.innerWidth;
        docHeight = window.innerHeight;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
        //IE 6+
        docWidth = document.documentElement.clientWidth;
        docHeight = document.documentElement.clientHeight;
    } 
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
        //IE 4
        docWidth = document.body.clientWidth;
        docHeight = document.body.clientHeight;
    }
            
    if( typeof( window.pageYOffset ) == 'number' ) 
    {
        //Netscape
        scrollYpos = window.pageYOffset;
        scrollXpos = window.pageXOffset;
    }
    else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) )
    {
        //DOM
        scrollYpos = document.body.scrollTop;
        scrollXpos = document.body.scrollLeft;
    }
    else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
    {
         //IE6
         scrollYpos = document.documentElement.scrollTop;
         scrollXpos = document.documentElement.scrollLeft;
    }
    
    document.getElementById('galleryBackground').style.display = "block";
    document.getElementById('galleryBackground').style.height = docHeight + scrollYpos;
    document.getElementById('galleryBackground').style.width = docWidth + scrollXpos;
        
    if ( docHeight / 2 > imageHeight / 2 )
        leftImage = docWidth / 2 - imageWidth / 2 + scrollXpos - 25;
    else
        leftImage = 0;
    
    if ( docHeight / 2 > imageHeight / 2 )
        topImage = docHeight / 2 - imageHeight / 2 + scrollYpos - 25;
    else
        topImage = 0;
    
    document.getElementById(idSlike).style.display = "block";
    document.getElementById(idSlike).style.top = topImage;
    document.getElementById(idSlike).style.left = leftImage;
}

function closeGalleryImage(idSlike)
{
    document.getElementById(idSlike).style.display = "none";
    document.getElementById('galleryBackground').style.display = "none";
}

function writeBigImage( imageName )
{ 
    var docWidth = 0, docHeight = 0;
        
    if( typeof( window.innerWidth ) == 'number' )
    {
        //Non-IE
        docWidth = window.innerWidth;
        docHeight = window.innerHeight;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
        //IE 6+
        docWidth = document.documentElement.clientWidth;
        docHeight = document.documentElement.clientHeight;
    } 
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
        //IE 4
        docWidth = document.body.clientWidth;
        docHeight = document.body.clientHeight;
    }
    
    var disp_setting = "toolbar=no, location=no, directories=no, menubar=no, resizable=no, scrollbars=no, width=10, height=10, left=100, top=25"; 
    var galleryWin = window.open("","",disp_setting); 
    galleryWin.document.write('<html><head><title>Opstina Zitoradja</title>'); 
    galleryWin.document.write('</head><body style="margin: 0px">');
    galleryWin.document.write('<img src="' + imageName + '" name="slika" onload="javascript:window.resizeTo(document.slika.width, document.slika.height); window.moveTo(' + docWidth / 2 + ' - document.slika.width / 2, ' + docHeight / 2 + ' - document.slika.height / 2)">');
    galleryWin.document.write('</body></html>'); 
    galleryWin.document.close(); 
    galleryWin.focus(); 
}
