function openImageSizedWindow(src){ var i = new Image(); i.src = src; var pop_win = window.open("","_blank","width="+i.width+",height="+i.height+",scrollbars=no,resizable=yes,top=60,left=120"); pop_win.window.document.open(); pop_win.window.document.write( '' +''+i.alt+'' +'' +'' +'' +'' ); pop_win.window.document.close(); }