displayWindow = null;
displayImageWindow = null;

function lookup(id,prepend) {
	var poptop = eval("(" + screen.height + "/2)-100");
	var popleft = eval("(" + screen.width + "/2)-185");
	if (displayWindow != null)
	{
		if (!displayWindow.closed)
		{
			displayWindow.location.href=prepend + "glossary.php?id=" + id
			displayWindow.focus();
		}
		else
		{
			displayWindow = window.open(prepend + "glossary.php?id=" + id,"displayWindow","toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0,location=0,width=370,height=270,top=" + poptop + ",left=" + popleft);
		}
	}
	else
	{
		displayWindow = window.open(prepend + "glossary.php?id=" + id,"displayWindow","toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0,location=0,width=370,height=270,top=" + poptop + ",left=" + popleft);
	}
}


function openImagewindow(id,w,h,prepend) {
	if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)
	{
		w = eval(w + "+45");
		h = eval(h + "+150");
	}
	else
	{
		w = eval(w + "+30");
		h = eval(h + "+150");
	}

	var poptop = eval("(" + screen.height + "/2)-" + eval(h + "/2"));
	var popleft = eval("(" + screen.width + "/2)-" + eval(w + "/2"));
	
	if (displayImageWindow != null)
	{
		if (!displayImageWindow.closed)
		{
			
			displayImageWindow.location.href=prepend + "image.php?id=" + id
			displayImageWindow.resizeTo(eval("15+"+w),h);
			displayImageWindow.focus();
		}
		else
		{
			displayImageWindow = window.open(prepend + "image.php?id=" + id,"displayImagewindow","toolbar=0,resizable=1,directories=0,status=0,menubar=0,scrollbars=1,location=0,width=" + w + ",height=" + h + ",top=" + poptop + ",left=" + popleft);
		}
	}
	else
	{
		displayImageWindow = window.open(prepend + "image.php?id=" + id,"displayImagewindow","toolbar=0,resizable=1,directories=0,status=0,menubar=0,scrollbars=1,location=0,width=" + w + ",height=" + h + ",top=" + poptop + ",left=" + popleft);
	}
}
