function NewWindow(sUrl, sName, W, H, sFeatures) {
//sName - must not contain spaces!
//sFeatures = 'location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes'
var L = (screen.width - W) / 2;
var T = (screen.height - H) / 4;
var sFeat = 'height=' + H + ',width=' + W + ',top=' + T + ',left=' + L;
if (sFeatures != '') {sFeat = sFeat + ',' + sFeatures};
win = window.open(sUrl, sName, sFeat)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function ImgPopupWin(picUrl, winTitle) {
  var now = new Date();
  disp = window.open('',now.getTime(),'width=640,height=480,left=400,top=275,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
  content = '<HTML>';
  content = '<HEAD>';
  content += '<TITLE>' + winTitle + '</TITLE>';
  content += '<' + 'script language=JavaScript>';
  content += '   var NS = (navigator.appName=="Netscape")?true:false;';
  content += '     function FitPic() {';
  content += '       iWidth = (NS)?window.innerWidth:document.body.clientWidth;';
  content += '       iHeight = (NS)?window.innerHeight:document.body.clientHeight;';
  content += '       iWidth = document.images[0].width - iWidth;'; 
  content += '       iHeight = document.images[0].height - iHeight;';
  content += '       window.resizeBy(iWidth, iHeight);';
  content += '       self.moveTo((screen.width / 2) - (document.images[0].width / 2), (screen.height / 2) - (document.images[0].height / 2));';
  content += '       self.focus();';
  content += '     };';
  content += ' </' + 'script>';
  content += '</HEAD>';
  content += '<BODY bgcolor="#000000" onload="FitPic();" topmargin=0 marginheight=0 leftmargin=0 marginwidth=0>';
  content += '<' + 'script language=JavaScript>';
  content += ' document.write("<img src=' + picUrl + ' border=0>");'; 
  content += '<' + '/script>';
  content += '</BODY>';
  content += '</HTML>';
  disp.document.write(content);
  disp.document.close();
}