PositionX = 100;
PositionY = 100;
defaultWidth  = 100;
defaultHeight = 100;
var AutoClose = false;

if (parseInt(navigator.appVersion.charAt(0))>=4){
  var isNN=(navigator.appName=="Netscape")?1:0;
  var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
  
var optNN='scrollbars=yes,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=yes,width=150,height=100,left='+PositionX+',top='+PositionY;

function poptastic(imageURL){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		writeln('<script>');
		writeln('  var isNN,isIE;');
		writeln('  if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('    isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('    isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('  function reSizeToImage(){');
		writeln('    if (isIE){');
		writeln('      window.resizeTo(300,300);');
		writeln('      width=300-(document.body.clientWidth-document.images[0].width);');
		writeln('      height=300-(document.body.clientHeight-document.images[0].height);');
		writeln('      window.resizeTo(width,height);}');
		writeln('    if (isNN){');
		writeln('      var d = document.images["img"];');       
		writeln('      if ((d.width > 800) || (d.height > 600)) {');       
		writeln('        window.innerWidth=700;');       
		writeln('        window.innerHeight=500;');       
		writeln('      } else {');       
		writeln('        window.innerWidth=document.images["img"].width + 50;');
		writeln('        window.innerHeight=document.images["img"].height;');
		writeln('      }');
		writeln('    }');
		writeln('  }');
		writeln('  function doTitle(){document.title="Extreme Moments";}');
		writeln('</script>');
		if (!AutoClose)
		  writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else
		  writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()"><center>');
		writeln('<img name="img" src='+imageURL+' style="display:block"></center></body></html>');
		close();		
  }
}

