PositionX = 100;
PositionY = 100;
defaultWidth  = 800;
defaultHeight = 1000;
var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var isSafari = (navigator.userAgent.indexOf("Safari")>=0)?1:0;

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optSF='toolbar=no,location=no,directories=no,status=yes,menubar=no,resizeable=no,scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle)
{
	var imgWin;
	if (isSafari)
		{imgWin=window.open('','about:blank',optSF);}
	else if (isIE)
		{imgWin=window.open('about:blank','',optIE);}
	else
		{imgWin=window.open('about:blank','',optNN);}
	
	var myWindowCode = ""
	
	myWindowCode += '<html><head><title>Loading...</title><script language="JavaScript1.2" type="text/javascript" src="/Includes/Misc.js"></script><style>body{margin:0px;}</style>';
	myWindowCode += '<sc'+'ript>';
	myWindowCode += 'var isNN,isIE,isSafari;';
	myWindowCode += 'isNN=(navigator.appName=="Netscape")?1:0;';
	myWindowCode += 'isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;';
	myWindowCode += 'isSafari=(navigator.userAgent.indexOf("Safari")>=0)?1:0;';
	myWindowCode += '</sc'+'ript>';
	
	if (!AutoClose){
		myWindowCode += '</head><body bgcolor=000000 scroll="no" onLoad="window.resizeTo(500,550);doTitle();self.focus()">';
	}
	else {
		myWindowCode += '</head><body bgcolor=000000 scroll="no" onLoad="window.resizeTo(500,550);doTitle();self.focus()" onblur="self.close()">';
	}
	myWindowCode += '<img name="George" src='+imageURL+' style="display:block"></body></html>';
	
	imgWin.document.write(myWindowCode);
	imgWin.document.close();
}

function reSizeToImage()
{
	var width,height;
	if (isSafari)
	{
		width=document.images[0].width;
		height=document.images[0].height;
		window.resizeTo(width,height);
	}
	else if (isIE)
	{
		window.resizeTo(800,800);
		width=100-(document.body.clientWidth-document.images[0].width);
		height=100-(document.body.clientHeight-document.images[0].height);
		window.resizeTo(width,height);
	}
	else
	{    
		window.innerWidth=document.images["George"].width;
		window.innerHeight=document.images["George"].height;
	}
}
function doTitle()
{
	document.title="'+imageTitle+'";
}