function showImg(URL,imgPath) {
var content = '<html><head>' +
'\<\style>'+'BODY { overflow: hidden }'+'<\/style>'
    +'<script>' +    'function selfResizer(obj) {' +
    'var w = obj.width;iWidth='+self.innerWidth+';' +
    'var h = obj.height;iHeight='+document.body.clientHeight  +';' +
    'var left = (self.opera?iWidth:screen.availWidth)/2 - w/2;' +
    'var top = (self.opera?iHeight:screen.availHeight)/2 - h/2;' +
    '  window.resizeTo(w+10, h+26);' +
    '  window.moveTo(left, top);' +
    '}' +    '<\/script>' +'</head><body>' +
'<img onLoad="selfResizer(this)" style="position: absolute; left: 0px; top: 0px" src="'+imgPath+'">' +
'</body></html>';
var wnd = window.open(URL, 'newWnd', 'width=50,height=50,left=0,top=0,screenX=0,screenY=0,resizable,scrollbar=40,stastusbar=0');

    wnd.document.write(content);
    wnd.document.title = "Img Preview";
    wnd.document.close();
}
