/*
	IND Taranis - HTMLBlock
	InsertImage script utility
	(c)2002-2005. IND Group
*/

fullImageWindow = false;

function viewFullImage(imageRef, imageWidth, imageHeight, title, bgColor)
{
	wWidth = Math.min(imageWidth, screen.width - 20);
	wHeight = Math.min(imageHeight + 4, screen.height - 58);

	if ((wWidth < imageWidth) || (wHeight < imageHeight))
	{
		wScroll = "yes";
	}
	else
	{
		wScroll = "no";
	}

	if (fullImageWindow)
	{
		fullImageWindow.close();
	}

	fullImageWindow = window.open("", "fullImageWindow", "width=" + wWidth + ",height=" + wHeight + ",top=2,left=2,toolbar=no,location=no,resizable=" + wScroll + ",status=no,menubar=no,scrollbars=" + wScroll + ",fullscreen=no");

	fullImageWindow.document.open();
	fullImageWindow.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">');
	fullImageWindow.document.write('<html><head><title>' + title + '</title></head>');
	fullImageWindow.document.write('<body style="background-color: ' + bgColor + '; margin: 0px;">');
	fullImageWindow.document.write('<a href="javascript:window.close();"><img src="' + imageRef + '" width="' + imageWidth + '" height="' + imageHeight + '" border="0" alt="' + title + '" title="' + title + '" /></a>');
	fullImageWindow.document.write('</body></html>');
	fullImageWindow.document.close();
}
