// showphoto.js
//
// show a popup picture

var popupWindow;

function showphoto (url,widthVal,heightVal)
  {

  widthVal = widthVal + 8;
  heightVal = heightVal + 8;
  
  featureString = "width="+widthVal  +",height="+heightVal+",scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0"
  if ( popupWindow == undefined )
    {
    popupWindow = window.open(url,'_photo_popup',featureString);
    popupWindow.resizeTo(widthVal,heightVal);
    // need this resizeTo() in case window actually exists
    }
  else
    {
    if ( popupWindow.closed )
      {
      popupWindow = window.open(url,'_photo_popup',featureString);
      }
    else
      {
      popupWindow.resizeTo(widthVal,heightVal);
      }
    }

  pDoc = popupWindow.document;

  pDoc.open();
  pDoc.write("<html><head><link rel=\"stylesheet\" href=\"/styles-site.css\" type=\"text/css\" /></head><body class=\"imagepop\"><center><table class=\"imagepop\" border=0 height=\"100%\" width=\"100%\"><tr valign=\"middle\"><td class=\"imagepop\" align=\"center\"><img class=\"imagepop\" border=0 src=\""+url+"\"></td></tr></table></center></body></html>");
  pDoc.close();


  popupWindow.focus()  ;
  return false;
  }
