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

var fullImageWindow = false;

function viewFullImage (imageRef, imageWidth, imageHeight, picture)
{
	var imgParent = picture.parentNode;
	while (!imgParent.tagName || (imgParent.tagName.toLowerCase() != "body"))
	{
		if (imgParent.tagName.toLowerCase() == "a")
		{
			return false;
		}
		imgParent = imgParent.parentNode;
	}

	var title = picture.title;

	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="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();
}


function openImageGallery(aTarget)
{
	window.open(aTarget,'','width=637,height=680,top=150,left=300,scrollbars=no,resizable=yes');
}
