function PictureOpen(url,title,w,h) {
w += 32;
h += 94;
var resize_w = w;
var resize_h = h+64;
var screen_h = screen.height;
var screen_w = screen.width;

if (w>h) {var h_position = screen_w-w-26;}
else {var h_position = screen_w-h+34;}

newWin = window.open(url,'UniqueID','width='+w+',height='+h+',top=32,left='+h_position+',resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
newWin.resizeTo(resize_w,resize_h);
newWin.focus();

var winContent = '<html><head><title>' +title+ '</title></head><body bgcolor="#FF9900" bottommargin="0" oncontextmenu="return false;">';
winContent += '<table border="0"><tr><td align="left"><b style="font-size:16px;font-family:Verdana,sans-serif;line-height:1.5">' +title+ '</b></td></tr>';
winContent += '<tr><td align="center"><img src="' +url+ '" alt="' +title+ '" galleryImg="no" />';
winContent += '<p><form><input type="button" value="Close this window" onClick=\'javascript:window.close();\'></form></p>';
winContent += '</td></tr></table></body></html>';

newWin.document.write(winContent);
newWin.document.close(); // "Finalizes" new window

//  onMouseDown="window.close(); return false" zatvori okno pri kliknuti
}
