var imgWinH;
var imgWinV;

function PopupImage(imageUri, description, displayHorizontal)
{
	var doc;

	imageUri = imageUri.replace(/thumb\//, '');
	
	if (displayHorizontal) {
		imgWinH = window.open('/Popup.html', 'imgWinH', 'scrollbars=0,toolbar=0,location=0,status=0,menubar=0,width=535,height=466');
		doc = imgWinH.document;
	} else {
		imgWinV = window.open('/Popup.html', 'imgWinV', 'scrollbars=0,toolbar=0,location=0,status=0,menubar=0,width=410,height=591');
		doc = imgWinV.document;
	}
	
	doc.writeln('<html>');
	doc.writeln('	<head>');
	doc.writeln('		<title>The CODART List - ' + description  + '</title>');
	doc.writeln('		<link rel="stylesheet" href="/css/default.css" type="text/css" />');
	doc.writeln('		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
	doc.writeln('	</head>');
	doc.writeln('	<body class="popup">');
	doc.writeln('		<p align="center">');
	doc.writeln('			<a href="/Popup.html" onclick="window.close(); return (false)"><img src="' + imageUri + '" border="1" alt="' + description + '" title="Click to close this window" /></a>');
	doc.writeln('		</p>');
	doc.writeln('		<p>&nbsp;</p>');
	doc.writeln('		<p align="center">' + description + '</p>');
	doc.writeln('	</body>');
	doc.writeln('</html>');
	doc.close();

	if (displayHorizontal) {
		imgWinH.focus();
	} else {
		imgWinV.focus();
	}
}

function PopupImageWidescreen(imageUri, description)
{
	var doc;

	imageUri = imageUri.replace(/thumb\//, '');
	
	imgWin = window.open('/Popup.html', 'imgWin', 'scrollbars=0,toolbar=0,location=0,status=0,menubar=0,width=800,height=198');
	doc = imgWin.document;
	
	doc.writeln('<html>');
	doc.writeln('	<head>');
	doc.writeln('		<title>The CODART List - ' + description  + '</title>');
	doc.writeln('		<link rel="stylesheet" href="/css/default.css" type="text/css" />');
	doc.writeln('		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
	doc.writeln('	</head>');
	doc.writeln('	<body class="popup">');
	doc.writeln('		<p align="center">');
	doc.writeln('			<a href="/Popup.html" onclick="window.close(); return (false)"><img src="' + imageUri + '" border="1" alt="' + description + '" title="Click to close this window" /></a>');
	doc.writeln('		</p>');
	doc.writeln('		<p>&nbsp;</p>');
	doc.writeln('		<p align="center">' + description + '</p>');
	doc.writeln('	</body>');
	doc.writeln('</html>');
	doc.close();

	imgWin.focus();
}

