
var winhandle = null;

function popUp(aURL, aWidth, aHeight) {
  if ((winhandle != null) && (! winhandle.closed)){

    winhandle.document.images["arlesimage"].src=aURL;

    var isNN=(navigator.appName=="Netscape")?1:0;
    var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;

    if (isNN) {
      winhandle.innerHeight = aHeight + 20;
      winhandle.innerWidth  = aWidth + 20;
      winhandle.innerHeight = aHeight;
      winhandle.innerWidth  = aWidth;
    }
    else if (isIE) {
      winhandle.resizeTo(aWidth + 10, aHeight+29);
      dWidth = aWidth - winhandle.document.body.clientWidth;
      dHeight = aHeight - winhandle.document.body.clientHeight;
      winhandle.resizeBy(dWidth, dHeight);
    }
    else {
      winhandle.resizeTo(aWidth + 10, aHeight+29);
    }

  }
  else
  {
    winhandle=window.open("", "imagewin", 'width=' + aWidth + ', height=' + aHeight);

    with (winhandle.document){

      writeln('<html><head>');
      writeln('<title>Image</title>');
      writeln('<meta http-equiv="imagetoolbar" content="no">');
      writeln('</head>');
      writeln('<body bgcolor="#000000" topmargin="0" leftmargin="0" style="margin:0px;">');
      writeln('<img name="arlesimage" src="' + aURL + '" style="display:block">');
      writeln('</body></html>');
      close();
    }
  }

  winhandle.focus();

}

function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
    newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
    newWindow.document.open();
    newWindow.document.write('<html><head><title>'+alt+'<\/title><\/head><body style="background: #FFFFFF; margin: 0;" onBlur="self.close()"><img src='+imageName+' width='+imageWidth+' height='+imageHeight+' onClick="window.close();"><\/body><\/html>');
    newWindow.document.close();
    newWindow.focus();
}