var winhandle = null;

function popUp(aURL, aImageWidth, aImageHeight) {

  var lWindowWidth  = Math.min(aImageWidth,  screen.availWidth);
  var lWindowHeight = Math.min(aImageHeight, screen.availHeight);

  if ((winhandle != null) && (! winhandle.closed)) {

    winhandle.location.replace(aURL);

  }
  else
  {
    var lOptions = 'width=' + aImageWidth + ',height=' + aImageHeight + ',resizable,scrollbars';
    winhandle = window.open(aURL, "imagewin", lOptions);
  }

  winhandle.focus();

}

function PageLoaded() {
  imagepreload = new Image;
  imagepreload.src = "";
}

window.onload=PageLoaded;

