/**
 * Match function to open a popup window and image size
 * @param src string Popup image
 */
function openImageSizedWindow(src){
    // Get the size of the image to load
    var i = new Image(); 
    i.src = src;
    
    // Image loading
    i.onload = function() {
        // Open a blank window's size image
        var pop_win = window.open(
                          "",
                          "_blank",
                          "width=" + i.width + ",height=" + i.height + ",scrollbars=no,resizable=yes"
                      );

        // Window to print the image empty HTML
        pop_win.document.open();
        pop_win.document.write(
         '<html>'
        +'<head><title>'+i.alt+'</title></head>'
        +'<body style="margin:0;padding:0;border:0;">'
        +'<img src="'+i.src+'" width="100%" alt="" />'
        +'</body>'
        +'</html>'
        );
        pop_win.document.close();
    }
}
