var pic = null
var popImg = null  // use this when referring to pop-up image
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle){
  closePopImg()
  imgWinName = "popImg" + imgCount++; //unique name for each pop-up window
  popImg = window.open("/popup.htm?"+picName+"?"+windowTitle, "newwin","resizable=1,width=10,height=600");
}

function openWindow(picUrl, picName, functions){
window.open(picUrl,picName,functions);
}

function closePopImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close() 
}

function setStatus(msg){
  status = msg
  return true
}

function PopupPic(sPicURL) {
window.open( "popup.htm?"+sPicURL, "","resizable=1,height=10,width=10");
}
function thumbsup(imgDir,tnDir,picUrl,picTitle) {
document.writeln("<a href=\"javascript:openPopImg('"+imgDir+"/"+picUrl+"','"+picTitle+"')\"");
document.writeln("onMouseOver=\"return setStatus('Click to display picture.')\"");
document.writeln("onMouseOut=\"return setStatus('')\" >");
document.writeln("<img border=0 src="+tnDir+"/"+picUrl+" width=180 align=left alt=\""+picTitle+"\"></a>");
}
