// for Netscape 3+ and IE 4+

var priorPic = new Array()

var noPic = 0

var foundit = false



function openPopImg(picName,  windowTitle, windowWidth, windowHeight){

  var i = 0

  if(pic == picName && winOpen()){

    popImg.focus()

    }

  else{

    foundit = false

    for(i=0; i<=noPic; i++){

      if (priorPic[i] == picName)

        foundit = true

      }

    pic = picName

    closePopImg()

    picTitle = windowTitle

    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window

    if(!foundit){

      priorPic[noPic++] = pic

      }

    popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)

    }

  }

function openPopImgWin(imgWinName, windowWidth, windowHeight){

  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width="

    + windowWidth + ",height=" + windowHeight

  return window.open("pimg.htm", imgWinName, winFeatures)

  }

function winOpen(){

  if(popImg != null){

    if(popImg.closed != true) return true; else return false

    }

  else

    return false

  }
