var pic = null
var viewImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "viewImg"

function openViewImg(picName, windowTitle, windowWidth, windowHeight){
  closeViewImg()
  picTitle = windowTitle
  imgWinName = "viewImg" + imgCount++ 
  viewImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=yes,resizable=yes,top=10,left=10,width=" 
           + (parseInt(windowWidth)+20)  + ",height=" 
           + (parseInt(windowHeight)+15)) 
  }

function closeViewImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) 
    if(viewImg != null) if(!viewImg.closed) viewImg.close() 
  }

function StatusBar(msg){
  status = msg
  return true
  }